function previewTire(section,action)
{
	$('loadingArt').show();
	data='isAuto=2';

if(action!='default')
	{ 
	if($('step2').textTop)   {   var text_Top=$('step2').textTop.value; data+="&textTop="+escape(text_Top);} 
	if($('step2').textMiddle){   var text_Middle=$('step2').textMiddle.value; data+="&textMiddle="+escape(text_Middle);}
	if($('step2').textBottom){   var text_Bottom=$('step2').textBottom.value; data+="&textBottom="+escape(text_Bottom);}
	
	if($('step2').h1_font)   {   var fontTop=$('step2').h1_font.value; data+="&h1_font="+fontTop;}
	if($('step2').h1_color)  {   var fonttopColor=$('step2').h1_color.value; data+="&h1_color="+fonttopColor;}
	if($('step2').h1_size)   {   var fonttopSize=$('step2').h1_size.value; data+="&h1_size="+fonttopSize;}
	
	if($('step2').h2_font)   {   var fontMiddle=$('step2').h2_font.value; data+="&h2_font="+fontMiddle;}
	if($('step2').h2_color)  {   var fontmiddleColor=$('step2').h2_color.value; data+="&h2_color="+fontmiddleColor;}
	if($('step2').h2_size)   {   var fontmiddleSize=$('step2').h2_size.value; data+="&h2_size="+fontmiddleSize;}

	if($('step2').h3_font)   {   var fontBottom=$('step2').h3_font.value; data+="&h3_font="+fontBottom;}
	if($('step2').h3_color)  {   var fontbottomColor=$('step2').h3_color.value; data+="&h3_color="+fontbottomColor;}
	if($('step2').h3_size)   {   var fontbottomSize=$('step2').h3_size.value; data+="&h3_size="+fontbottomSize;}

/////////////////Shape///////////////////////////////////
////top text arch
	if($('step2').h1_shape)
	{
	for (var i=0; i < $('step2').h1_shape.length; i++)
	   {
	   if ($('step2').h1_shape[i].checked)
		  {
		  var arcTop = $('step2').h1_shape[i].value;
		  data+="&h1_shape="+arcTop;
		  }
	   }
	}
////bottom text arch	
	if($('step2').h3_shape)
	{   
	  for (var i=0; i < $('step2').h3_shape.length; i++)
	    {
		   if ($('step2').h3_shape[i].checked)
			  {
			  var arcBottom = $('step2').h3_shape[i].value;
			  data+="&h3_shape="+arcBottom;
			  }
	      }
	   }
	   
/////////////////Shadow///////////////////////////////////
///top text	shadow
if($('step2').h1_shadow)
	{
	for (var i=0; i < $('step2').h1_shadow.length; i++)
	   {
	   if ($('step2').h1_shadow[i].checked)
		  {
		  var shadow1 = $('step2').h1_shadow[i].value;
		  data+="&h1_shadow="+shadow1;
		  }
	   }
	}
///middle text	shadow	
	if($('step2').h2_shadow)
	{  
	for (var i=0; i < $('step2').h2_shadow.length; i++)
	   {
	   if ($('step2').h2_shadow[i].checked)
		  {
		  var shadow2 = $('step2').h2_shadow[i].value;
		  data+="&h2_shadow="+shadow2;
		  }
	   }
	}
///bottom text	shadow
	if($('step2').h3_shadow)
	{   
	for (var i=0; i < $('step2').h3_shadow.length; i++)
	   {
	   if ($('step2').h3_shadow[i].checked)
		  {
		  var shadow3 = $('step2').h3_shadow[i].value;
		  data+="&h3_shadow="+shadow3;
		  }
	   }
	}
	   
/////////////////Shadow Color ///////////////////////////////////
	if($('step2').h1_shadow_color) {   var fonttopShadowColor=$('step2').h1_shadow_color.value; data+="&h1_shadow_color="+fonttopShadowColor;}
	if($('step2').h2_shadow_color) {   var fontmiddleShadowColor=$('step2').h2_shadow_color.value; data+="&h2_shadow_color="+fontmiddleShadowColor;}
	if($('step2').h3_shadow_color) {   var fontbottomShadowColor=$('step2').h3_shadow_color.value; data+="&h3_shadow_color="+fontbottomShadowColor;}
	  
/////////////////OutLines///////////////////////////////////
///top text OutLine
	  if($('step2').h1_outline)
	  {
		  for (var i=0; i < $('step2').h1_outline.length; i++)
		   {
		     if($('step2').h1_outline[i].checked)
			   {
				  var outline1 = $('step2').h1_outline[i].value;
				  data+="&h1_outline="+outline1;
			   }
		   }
	   }
///middle text OutLine	   
	  if($('step2').h2_outline)
	  {
		  for (var i=0; i < $('step2').h2_outline.length; i++)
		   {
		    if ($('step2').h2_outline[i].checked)
			  {
			  var outline2 = $('step2').h2_outline[i].value;
			  data+="&h2_outline="+outline2;
			  }
		   }
	   }
///bottom text OutLine	   
	  if($('step2').h3_outline)
	  { 
		  for (var i=0; i < $('step2').h3_outline.length; i++)
		   {
		    if ($('step2').h3_outline[i].checked)
			  {
			  var outline3 = $('step2').h3_outline[i].value;
			  data+="&h3_outline="+outline3;
			  }
		   }
	   }
//////Outline Color ///////////////////////////////////
	if($('step2').h1_outline_color) {   var fonttopShadowColor=$('step2').h1_outline_color.value; data+="&h1_outline_color="+fonttopShadowColor;}
	if($('step2').h2_outline_color) {   var fontmiddleShadowColor=$('step2').h2_outline_color.value; data+="&h2_outline_color="+fontmiddleShadowColor;}
	if($('step2').h3_outline_color) {   var fontbottomShadowColor=$('step2').h3_outline_color.value; data+="&h3_outline_color="+fontbottomShadowColor;}
	
	}
///////////////////top text alignment///////////////////////////////////
var hieght1=$('step2').topTextheight.value;
var hieght2=$('step2').middleTextheight.value;
var hieght3=$('step2').bottomTextheight.value;

	if(section=='top')
		{ 
			if(action=='up')
			{
				hieght1=parseInt(hieght1)+4;
				$('step2').topTextheight.value=hieght1;
			}
			else if(action=='down')
			{
				hieght1=parseInt(hieght1)-4;
				$('step2').topTextheight.value=hieght1;
			}
			else if(action=='default')
			{
				hieght1=0;
				$('step2').topTextheight.value=0;
			}
	   }
	data+="&topTextheight="+hieght1;	  

///////////////////////middle text alignment///////////////////////////////////
	if(section=='middle')
		{
			if(action=='up')
			{
				hieght2=parseInt(hieght2)+4;
				$('step2').middleTextheight.value=hieght2;
			}
			else if(action=='down')
			{
				hieght2=parseInt(hieght2)-4;
				$('step2').middleTextheight.value=hieght2;
			}
			else if(action=='default')
			{
				hieght2=0;
				$('step2').middleTextheight.value=0;
			}
	   }
	 data+="&middleTextheight="+hieght2;  
///////////////////////////bottom text alignment///////////////////
	if(section=='bottom')
		{
			if(action=='up')
			{
				hieght3=parseInt(hieght3)+4;
				$('step2').bottomTextheight.value=hieght3;
			}
			else if(action=='down')
			{
				hieght3=parseInt(hieght3)-4;
				$('step2').bottomTextheight.value=hieght3;
			}
			else if(action=='default')
			{
				hieght3=0;
				$('step2').bottomTextheight.value=0;
			}
	   }
	   var si=$('step2').step2SpecialInstructions.value;
	   data+="&bottomTextheight="+hieght3;
	   data+="&step2SpecialInstructions="+si;
	   //data1=document.write(data.replace(/./, "*"));
/////////////Process form data/////////////
	new Ajax.Request('step2Proc.php', {
 		method: 'post',
  		parameters: data,
		onSuccess: completed,
		onFailure: failed
  		});	  
//////////////Process Prices////////////////
}
function failed()
{
	alert("Sorry! Page not found...Try again!");	
}
function completed(response)
{	
		new Ajax.Request('ajax_price.php', {
 		//method: 'post',
  		parameters: null,
		onSuccess: priceCompleted,
		onFailure: failed
  		});

	$('loadingArt').hide();
	$('previewArt').update(response.responseText);
}
function priceCompleted(response)
{
	$('pricetotal').update(response.responseText);
	var redirect=$('url').value;
	if(redirect!=0)
	{
		window.location.href=redirect;
	}
}
