// Variabili per lasciare i layer che scrollano al posto precedente dopo il reset della grafica  
var TopColoriStep2 = 0;
var TopCerchioniStep2 = 0;
var TopInterniStep2 = 0;
var TopOptStep3 = 0;
var TopDetailLay = 0;
 
// Varie Utilis:
var interniListTMP = new Array();
var cerchioniListTMP = new Array();
var flagNextStep = true;
var flagStart = 0;
setLayerProperty = new Function();

function graphic() {  
	switch(Vehicle.step) {
		case 0: displayStep0(); break;
		case 1: displayStep1(); break;
		case 2:
			interniListTMP = getConstrainEsclusive(MvsIPList, Vehicle.MvsBodyColor.code);
			cerchioniListTMP = getOptByCategory('-');
			if (TopColoriStep2 != 0) 		TopColoriStep2 = parseInt(document.getElementById('ccInnColori').style.top);
			if (TopInterniStep2 != 0) 		TopInterniStep2 = parseInt(document.getElementById('ccInnInterni').style.top);
			if (TopCerchioniStep2 != 0) 	TopCerchioniStep2 = parseInt(document.getElementById('ccInnCerchioni').style.top);
			displayStep2();
			document.getElementById('ccInnColori').style.top = TopColoriStep2 + "px";
			document.getElementById('ccInnInterni').style.top = TopInterniStep2 + "px";
			document.getElementById('ccInnCerchioni').style.top = TopCerchioniStep2 + "px";
		break;
		case 3: displayStep3(); break;
		case 4: displayStep4(); break;
	}

	if (ServerSide["useFlash"] == 'true') 
	{ 
		document.getElementById('flash').style.display = "block";
	}

	flagStart++;
}

/******************************************/

// INIZIO DISPLAY STEP 0 (scelta modelli)
function displayStep0() {}

// INIZIO DISPLAY STEP 1 (scelta mvs)
function displayStep1() {
	CodiceHTML = 
		NumImgCode()+
		menuTopRightCode()+
		'<table border="0" cellspacing="0" cellpadding="0" width="790" class="side1">'+
			'<tr>'+
				'<td valign="top" colspan="3" class="bg_strana_1_nadpis nospace" ><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["Page1TitleImageFE"]+'" style="width:782px; height:61px;paddind:0;margin:0;border:0;display:block;"></td>'+
				'<td valign="top">'+
					'<table border="0" cellspacing="0" cellpadding="0" class="nospace">'+
						'<tr>'+
							'<td class="bkBianco brdr_tprght" style="width:8px; height:9px;" ></td>'+
						'</tr>'+
						'<tr>'+
							
							'<td class="linka_right" style="width:8px; height:52px;"></td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
		  '<tr>'+
				// FLASH OBJECT
		    '<td class="bkBianco" id="tdFlash" style="height:180px;width:363px;margin:0;padding:0;border:0;"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="363" height="1"></td>'+
		    '<td class="bkBianco" valign="top" style="height:180px;margin:0;padding:0;border:0;">'+
					'<table border="0" cellspacing="0" cellpadding="0" style="height:180px;margin:0;padding:0;border:0;">'+
		        '<tr>'+
		          
		          '<td class="txt text_left_banner_s1" valign="top"><br>'+
								ServerSide["Page1TextFE"]+
		          '</td>'+
		        '</tr>'+
		      '</table>'+
		      
				'</td>'+
				'<td valign="top" class="bk1" style="height:180px;width:215px;margin:0; padding:0;border:0;"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="215" height="1"></td>'+
				'<td class="bk1" style="height:180px;width:8px;margin:0; padding:0;border:0;">'+
					'<table  style="height:180px;width:8px;margin:0;padding:0;border:0;" border="0" cellspacing="0" cellpadding="0">'+
						'<tr>'+
							'<td valign="top" class="bg_roh_s1_model" style="width:7px;"></td>'+
							'<td style="width:1px; height: 171px; background-color:#a2a29a;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td colspan="2" valign="bottom" class="bg_roh_dolni_s1_model" style="width:8px; height: 9px;"></td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
		  '</tr>'+
		  '<tr>'+
		    '<td colspan="4">'+
					'<table border="0" cellspacing="0" cellpadding="0"  style="height:1px;width:783px;margin:0;padding:0;border:0;">'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:15px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td class="bkBianco" style="width:551px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:215px;height:1px;margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table border="0" cellspacing="0" cellpadding="0">'+
		  '<tr>'+
		    '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="15" height="1"></td>'+
		    '<td valign="top" class="bkBianco">'+
		      '<table border="0" cellspacing="0" cellpadding="0" width="548">'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		          '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="7" height="1"></td>'+
		          '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="537" height="1"></td>'+
		          '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="7" height="1"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		          '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		          '<td valign="top" align="center">'+
								'<table border="0" cellspacing="0" cellpadding="0">'+
		              '<tr>'+
		                '<td><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["Page1SubTitleImageFE"]+'" border="0" width="491" height="45"></td>'+
		              '</tr>'+
					  			'<tr>'+
		                '<td align="right">'+
											'<img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="15">'+
										'</td>'+
		              '</tr>';
                if (ServerSide["TextDodatVerze"]) {
	              CodiceHTML += '<tr class="bk2">'+
              	                '<td align="left">'+
              										ServerSide["TextDodatVerze"]+
              									'</td>'+
              	              '</tr>';
	              }
	              
						var gg = 0;
						var foTMP = false;
						for (var pr in Vehicle.Promos) {
							if (Vehicle.Promos[pr].promoType == 'E') {
								if (gg == 0) {
									CodiceHTML += 
		              '<tr>'+
		                '<td valign="top">'+
											'<table border="0" cellspacing="0" cellpadding="2" class="tbldotted" width="100%">'+
		                    '<tr class="bk2">'+
													'<td height="15" class="trc" align="left"><span class="txtbold">'+ServerSide["page1HComm"]+'</span></td>'+
		                    '</tr>';
								}
								CodiceHTML += 
												'<td align="left" class="trc">'+Vehicle.Promos[pr].communication+'</td>'+
											'</tr>';
								foTMP = true;
							}
			
							gg++;
						}
						if (foTMP) {
							CodiceHTML += 
											'</table>'+
										'</td>'+
									'</tr>'+
					  			'<tr>'+
		                '<td>'+
											'<img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="15">'+
										'</td>'+
		              '</tr>';
						}
						var rozdil=0;
						var doplMezery='';
						if (ServerSide["doplnekCenaSDPH"]!="")
						{
						  rozdil=2;						  
						  doplMezery='';						
						}
						else
						  doplMezery='&nbsp;&nbsp;';						
						  
						  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
              CodiceHTML += 
		              '<tr>'+
		                '<td valign="top">'+ // totez o kousek nize!
											'<table border="0" cellspacing="0" cellpadding="2" class="tbldotted" width="100%">'+
		                    '<tr class="bk2">'+
		                      '<td width="'+(65-rozdil)+'%" align="left" class="trc"><span class="txtbold">'+ServerSide["page1H1"]+'</span></td>'+
							  					'<td width="'+(20+rozdil)+'%" align="center" class="trc" colspan="2"><span class="txtbold">'+ServerSide["page1H2"]+ServerSide["doplnekCenaSDPH"]+'</span></td>'+
							  					'<td width="15%" align="center" class="trc"><span class="txtbold">'+ServerSide["page1H4"]+'</span></td>'+
		                    '</tr>';
              }
              else
              {
							CodiceHTML += 
		              '<tr>'+
		                '<td valign="top">'+ // totez o kousek nize!
											'<table border="0" cellspacing="0" cellpadding="2" class="tbldotted" width="100%">'+
		                    '<tr class="bk2">'+
		                      '<td width="'+(65-rozdil)+'%" align="left" class="trc"><span class="txtbold">'+ServerSide["page1H1"]+'</span></td>'+
							  					'<td width="'+(20+rozdil)+'%" align="right" class="trc"><span class="txtbold">'+ServerSide["page1H2"]+ServerSide["doplnekCenaSDPH"]+doplMezery+'</span></td>'+
							  					'<td width="15%" align="center" class="trc"><span class="txtbold">'+ServerSide["page1H4"]+'</span></td>'+
		                    '</tr>';
              }

	var prom = '';
	var bylaOdpoctovaVerze=0;
	for (m = 0; m < MvsList.length; m++) 
	{
	  
	  if (MvsList[m].odpoctovaVerze&&!bylaOdpoctovaVerze)
	  {
	    CodiceHTML+='</table><br >';
	    if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
	    CodiceHTML+='<table border="0" cellspacing="0" cellpadding="2" class="tbldotted" width="100%">'+
		                    '<tr class="bk2">'+
		                      '<td width="63%" align="left" class="trc"><span class="txtbold">'+ServerSide["page1H1"]+ServerSide["OdpoctovaVerzeTabulkaDoplnek"]+'</span></td>'+
							  					'<td width="22%" align="center" class="trc"><span class="txtbold" colspan="2">'+ServerSide["page1H2"]+' '+ServerSide["doplnekBezDPH"]+'</span></td>'+
							  					'<td width="15%" align="center" class="trc"><span class="txtbold">'+ServerSide["page1H4"]+'</span></td>'+
		                    '</tr>';
	    }
	    else
	    {
	    CodiceHTML+='<table border="0" cellspacing="0" cellpadding="2" class="tbldotted" width="100%">'+
		                    '<tr class="bk2">'+
		                      '<td width="63%" align="left" class="trc"><span class="txtbold">'+ServerSide["page1H1"]+ServerSide["OdpoctovaVerzeTabulkaDoplnek"]+'</span></td>'+
							  					'<td width="22%" align="right" class="trc"><span class="txtbold">'+ServerSide["page1H2"]+' '+ServerSide["doplnekBezDPH"]+'</span></td>'+
							  					'<td width="15%" align="center" class="trc"><span class="txtbold">'+ServerSide["page1H4"]+'</span></td>'+
		                    '</tr>';
		  }                  
	    bylaOdpoctovaVerze=1;
	  }
	  
		var promFlag = true;
		var che = '';
		if(MvsList[m].code == Vehicle.Mvs.code) che = ' checked';
		var coloRig = '';
		if (m%2 != 0) coloRig = ' class="bk3"';
		for (k = 0; k < PromoList.length; k++) {
			if (PromoList[k].promoType == 'F' && PromoList[k].objCode == MvsList[m].code) {
				prom1 = '<br><b>'+getPrice(PromoList[k].price,0,1)+'</b>';
				prom2 = '<br><b>'+getPrice(PromoList[k].price,0,2)+'</b>';
				if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
				CodiceHTML +=
												'<tr '+coloRig+'>'+
		                      '<td class="trc" align="left">'+convertApici(MvsList[m].desc)+'</td>'+
		                      '<td class="trc" align="right" nowrap><s>'+getPrice(MvsList[m].price,0,1)+'</s>&nbsp;&nbsp;&nbsp;&nbsp;'+prom+'&nbsp;&nbsp;</td>'+
		                      '<td class="trc" align="right" nowrap><s>'+getPrice(MvsList[m].price,0,2)+'</s>&nbsp;&nbsp;'+prom2+'&nbsp;&nbsp;</td>'+
		                      '<td class="trc" align="center"><input style="position:relative;z-index:60;" type="checkbox" onclick="javascript:mvsChanged(\''+MvsList[m].code+'\');"'+che+'></td>'+
		                    '</tr>';
				}
				else
				{
				CodiceHTML +=
												'<tr '+coloRig+'>'+
		                      '<td class="trc" align="left">'+convertApici(MvsList[m].desc)+'</td>'+
		                      '<td class="trc" align="right" nowrap><s>'+getPrice(MvsList[m].price,0,1)+'</s>&nbsp;&nbsp;&nbsp;&nbsp;'+prom1+'&nbsp;&nbsp;</td>'+
		                      
		                      '<td class="trc" align="center"><input style="position:relative;z-index:60;" type="checkbox" onclick="javascript:mvsChanged(\''+MvsList[m].code+'\');"'+che+'></td>'+
		                    '</tr>';
		    }                
				promFlag = false;
				break;
			}
		}
		if (promFlag) {
    if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
    CodiceHTML +=
					'<tr '+coloRig+'>'+
            '<td class="trc" align="left">'+MvsList[m].desc+'</td>'+
            '<td class="trc" align="right" nowrap>&nbsp;&nbsp;'+getPrice(MvsList[m].price, 0,1)+'&nbsp;&nbsp;</td>'+
            '<td class="trc" align="right" nowrap>&nbsp;&nbsp;'+getPrice(MvsList[m].price, 0,2)+'&nbsp;&nbsp;</td>'+
            '<td class="trc" align="center"><input type="checkbox" style="position:relative;z-index:60;" onclick="javascript:mvsChanged(\''+MvsList[m].code+'\');"'+che+'></td>'+
          '</tr>';
    }
    else
    {
		CodiceHTML +=
					'<tr '+coloRig+'>'+
            '<td class="trc" align="left">'+MvsList[m].desc+'</td>'+
            '<td class="trc" align="right" nowrap>&nbsp;&nbsp;'+getPrice(MvsList[m].price, 0,1)+'&nbsp;&nbsp;</td>'+

            '<td class="trc" align="center"><input type="checkbox" style="position:relative;z-index:60;" onclick="javascript:mvsChanged(\''+MvsList[m].code+'\');"'+che+'></td>'+
          '</tr>';
    }      
		}
	}

	CodiceHTML += 
		                  '</table>'+
										'</td>'+
		              '</tr>'+
									footerTasti()+
		            '</table>'+
							'</td>'+
		          '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td colspan="2" rowspan="2" class="bg_roh_dolni_s1_left"></td>'+
		          '<td style="width:1px;height:8px;"></td>'+
		          '<td colspan="2" rowspan="2" class="bg_roh_dolni_s1_right"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td height="1" background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px; height:1px; margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		      '</table><!-- fine tab dati yyy-->'+
				'</td>'+
		    '<td style="width:18px;"></td>'+
		    '<td valign="top"><br>'+
		      '<table border="0" cellspacing="0" cellpadding="0" width="204" style="border:0;padding:0;margin:0;">'+
		        '<tr style="border:0;padding:0;margin:0;">'+
		          '<td class="bkBianco bg_roh_horni_s1_left" rowspan="2" colspan="2" width="8" style="width:8px;height:9px;border:0;padding:0;margin:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:188px; height:1px; margin:0;padding:0;border:0;"></td>'+
		          '<td class="bkBianco bg_roh_horni_s1_right" rowspan="2" colspan="2" width="8" style="width:8px;height:9px;border:0;padding:0;margin:0;"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td class="bkBianco" style="width:188px;height:8px;"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="232"></td>'+
		          '<td class="bkBianco" style="width:7px;height:1px;"></td>'+
		          '<td class="bkBianco" valign="top"><!-- inizio tabella testuale box -->'+
							boxDXCode()+
							'</td>'+
		          '<td class="bkBianco" style="width:7px;height:1px;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="1"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td class="bkBianco bg_roh_dolni_s1_left" rowspan="2" colspan="2"></td>'+
		          '<td class="bkBianco" style="height:8px;"></td>'+
		          '<td class="bkBianco bg_roh_dolni_s1_right" rowspan="2" colspan="2"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:188px; height:1px; margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table width="790" cellspacing="0" cellpadding="0">'+
				'<tr>'+
					'<td align="right" class="txt" height="20"><a href="#" class="lnormalg">'+ServerSide["backToTopPageFE"]+'</a> <sup><img src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" border="0"></sup></td>'+
				'</tr>'+
		'</table>';

	document.getElementById('fiatcc').innerHTML = CodiceHTML;

}
// FINE DISPLAY STEP 1 (scelta mvs)

/******************************************/

// INIZIO DISPLAY STEP 2 (scelta colore, interni cerchione)
function displayStep2() {

	CodiceHTML = 
		NumImgCode()+
		menuTopRightCode()+
		'<table border="0" cellspacing="0" cellpadding="0" width="790">'+
			'<tr>'+
				'<td valign="top" colspan="2" class="bg_strana_1_nadpis nospace"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["Page2TitleImageFE"]+'" style="width:782px; height:61px;paddind:0;margin:0;border:0;display:block;"></td>'+
				'<td valign="top">'+
					'<table width="8" border="0" cellspacing="0" cellpadding="0" height="100%">'+
						'<tr>'+
							'<td class="bkBianco brdr_tprght" style="width:8px; height:9px;" ></td>'+
						'</tr>'+
						'<tr>'+
							'<td class="linka_right" style="width:8px; height:52px;"></td>'+
            '</tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
		  '<tr>'+
				// FLASH OBJECT
		    '<td class="bkBianco" id="tdFlash" style="height:180px;width:363px;margin:0;padding:0;border:0;"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="363" height="1"></td>'+
		    '<td class="bkBianco" valign="top" style="height:180px;margin:0;padding:0;border:0;">'+
					'<table border="0" cellspacing="0" cellpadding="0" width="419">'+
		        '<tr>'+
		          '<td style="width:4px;"></td>'+
		          '<td class="txt" valign="top"><br>'+
								ServerSide["Page2TextFE"]+
								'<br><br>'+
								'<span class="txtg">'+ServerSide["page2H1"]+'</span><br>'+
// DESCRIZIONE COLORE //
								'<b id="ncolore">'+convertApici(Vehicle.MvsBodyColor.desc)+'</b>'+
								'<table border="0" cellspacing="0" cellpadding="0" align="right">'+
								  '<tr>'+
								    '<td valign="top" align="left"><img align="left" onMouseOver="javascript:parteScrolling(\'giu\', \'colori\')" onMouseOut="javascript:fermaScrolling()" src="'+ServerSide["imagePath"]+'rrw_tp.gif" width="8" height="6" style="margin-right:7px;cursor:pointer" border="0"></td>'+
								  '</tr>'+
								  '<tr>'+
								    '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="8" height="70"></td>'+
								  '</tr>'+
								  '<tr>'+
								    '<td valign="bottom" align="left"><img align="left" onMouseOver="javascript:parteScrolling(\'su\', \'colori\')" onMouseOut="javascript:fermaScrolling()" src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" style="margin-right:7px;cursor:pointer" border="0"></td>'+
								  '</tr>'+
								'</table>'+
							'</td>'+
		          '<td style="width:10px"></td>'+
		        '</tr>'+
		      '</table>'+
		      
				'</td>'+
				'<td class="bk1" style="height:180px;width:8px;margin:0; padding:0;border:0;">'+
					'<table  style="height:180px;width:8px;margin:0;padding:0;border:0;" border="0" cellspacing="0" cellpadding="0">'+
						'<tr>'+
							'<td valign="top" style="width:7px;background-color:#ffffff;"></td>'+
							'<td style="width:1px; height: 171px; background-color:#a2a29a;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td colspan="2" valign="bottom" class="bg_roh_dolni_s2_model" style="width:8px; height: 9px;"></td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
		  '</tr>'+
		  '<tr>'+
		    '<td colspan="3">'+
					'<table border="0" cellspacing="0" cellpadding="0"  style="height:1px;width:783px;margin:0;padding:0;border:0;">'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:15px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td class="bkBianco" style="width:546px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:220px;height:1px;margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table border="0" cellspacing="0" cellpadding="0">'+
		  '<tr>'+
		    '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="15" height="1"></td>'+
		    '<td valign="top"><!-- inizio tab dati -->'+
		      '<table border="0" cellspacing="0" cellpadding="0" width="548" class="bkBianco">'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td style="width:7px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td style="width:537px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td style="width:7px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"></td>'+
		          '<td></td>'+
		          '<td valign="top" align="center">'+
								'<table border="0" cellspacing="0" cellpadding="0" width="100%">'+
					  			'<tr>'+
		                '<td align="right" style="height:15px;">'+
											
										'</td>'+
		              '</tr>'+
		              '<tr>'+
		                '<td valign="top" align="left">'+
											'<table border="0" cellspacing="0" cellpadding="2" width="100%">'+
		                    '<tr>'+
													'<td class="txt">'+
														'<table border="0" cellspacing="0" cellpadding="0" width="90%" align="right">'+
														  '<tr>'+
														    '<td align="right"><img name="interniimgbig" id="interniimgbig"  src="'+Vehicle.MvsInnerPreparation.imgBig+'" align="right" width="212" height="109"></td>'+
																'<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="50" height="1"></td>'+
														    '<td class="txt" valign="top" align="right" width="191">'+
																	'<table border="0" cellspacing="0" cellpadding="0" width="191">'+
																	  '<tr>'+
// DESCRIZIONE INTERNI //
																	    '<td class="txtbold" style="text-align:left;"><span class="txtg">'+ServerSide["page2H3"]+'</span><br>';
										var descInterniTMP = Vehicle.MvsInnerPreparation.desc;
										
										if (descInterniTMP.length > 26) descInterniTMP = '<a title="'+convertApici(descInterniTMP)+'" style="cursor:default;">'+convertApici(descInterniTMP.substring(0, 25))+'...</a>';
										CodiceHTML +=
																	    '<b id="ntessuto">'+descInterniTMP+'</b></td>'+
																	  '</tr>'+
														  			'<tr>'+
														    			'<td valign="top" align="right" class="txt">'+
														    			  '<table style="margin:0;padding:0;border:0;" vspace="0" hspace="0" cellpadding=0 cellspacing=0>'+
														    			    '<tr>'+
														    			      '<td style="height:0;"></td>'+
														    			    '</tr>'+
                                          '<tr>'+  
														    			       '<td style="margin:0; padding:0; border:0;height:6px;line-height:6px;">'+
                                             '<img onMouseOver="javascript:parteScrolling(\'giu\', \'interni\')" onMouseOut="javascript:fermaScrolling()" src="'+ServerSide["imagePath"]+'rrw_tp.gif" width="8" height="6" border="0" style="cursor:pointer; margin:0; padding:0; border:0; width:8px; height:6px;">'+
                                             '</td>'+
                                           '</tr>'+
                                           '<tr>'+
                                             '<td style="height:70px"></td>'+
														    			     '</tr>'+
                                           '<tr>'+
														    			       '<td>'+ 
                                               '<img onMouseOver="javascript:parteScrolling(\'su\', \'interni\')" onMouseOut="javascript:fermaScrolling()" src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" border="0" style="cursor:pointer">'+
                                             '</td>'+
                                           '</tr>'+    
														    			   '</table>'+
																				
																				'</td>'+
														  			'</tr>'+
																	'</table>'+
																'</td>'+
															'</tr>'+
														'</table>'+
													'</td>'+
		                    '</tr>'+
		                  '</table>'+
										'</td>'+
		              '</tr>'+
									'<tr>'+
		                '<td valign="top" align="left">'+
											'<table border="0" cellspacing="0" cellpadding="2" width="100%">'+
		                    '<tr>'+
													'<td class="txt">'+
														'<table border="0" cellspacing="0" cellpadding="0" width="90%" align="right">'+
															'<tr>'+
																'<td class="txt">'+
																	'<img src="'+ServerSide["imagePath"]+'spacer.gif" width="212" height="20">'+
																'</td>'+
																'<td style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="50" height="1"></td>'+
																'<td width="191">&nbsp;</td>'+
															'</tr>'+
															'<tr>'+
																'<td align="right" valign="top"><img src="'+getCerchione().imgBig+'" align="right" name="cerchioniimgbig" id="cerchioniimgbig" width="81" height="81"></td>'+
																'<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="50" height="1"></td>'+
																'<td class="txt" valign="top" width="191">'+
																	'<table border="0" cellspacing="0" cellpadding="0" width="191">'+
																		'<tr>'+
																			'<td class="txtbold"><span class="txtg">'+ServerSide["page2H2"]+'</span><br>';
			// DESCRIZIONE CERCHIONI //
																	var descCerchioneTemp = getCerchione().desc;
																if (descCerchioneTemp.length > 26) descCerchioneTemp = '<a title="'+descCerchioneTemp+'" style="color:#625e3d;cursor:default;">'+convertApici(descCerchioneTemp.substring(0, 25))+'...</a>';
																CodiceHTML += 
																				'<b id="ncerchione">'+descCerchioneTemp+'</b>'+
																			'</td>'+
																		'</tr>'+
																		'<tr>'+
																			'<td valign="top" align="right" class="txt">'+
																			  '<table style="margin:0;padding:0;border:0;" vspace="0" hspace="0" cellpadding=0 cellspacing=0>'+
														    			    '<tr>'+
														    			      '<td style="height:0;"></td>'+
														    			    '</tr>'+
                                          '<tr>'+  
														    			       '<td style="margin:0; padding:0; border:0;height:6px;line-height:6px;">'+
                                             '<img onMouseOver="javascript:parteScrolling(\'giu\', \'cerchioni\')" onMouseOut="fermaScrolling()" src="'+ServerSide["imagePath"]+'rrw_tp.gif" width="8" height="6" border="0" style="cursor:pointer">'+
                                             '</td>'+
                                           '</tr>'+
                                           '<tr>'+
                                             '<td style="height:45px"></td>'+
														    			     '</tr>'+
                                           '<tr>'+
														    			       '<td>'+ 
                                               '<img onMouseOver="javascript:parteScrolling(\'su\', \'cerchioni\')" onMouseOut="fermaScrolling()" src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" border="0" style="cursor:pointer">'+
                                             '</td>'+
                                           '</tr>'+    
														    			   '</table>'+
														    			   
																				'</td>'+
																		'</tr>'+
																	'</table>'+
																'</td>'+
															'</tr>'+
														'</table>'+
													'</tr>'+
												'</td>'+
											'</table>'+
										'<td>'+
									'</tr>'+
									footerTasti()+
		            '</table>'+
							'</td>'+
		          '<td style="line-height:1px;height:1px;width:1px;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="line-height:1px;height:1px;"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td colspan="2" rowspan="2" style="line-height:1px;height:9px;width:8px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmlft.gif" width="8" height="9"></td>'+
		          '<td style="line-height:1px;height:8px;"></td>'+
		          '<td colspan="2" rowspan="2" style="line-height:1px;height:9px;width:8px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmrght.gif" width="8" height="9"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="line-height:1px;height:1px;"></td>'+
		        '</tr>'+
		      '</table><!-- fine tab dati -->'+
				'</td>'+
		    '<td style="line-height:1px;height:1px;width:18px;"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="18" height="1"></td>'+
		    '<td valign="top"><br>'+
		      '<table border="0" cellspacing="0" cellpadding="0" width="204">'+
		        '<tr>'+
		          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tplft.gif" width="8" height="9"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="line-height:1px;height:1px;width:188px;"></td>'+
		          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tprght.gif"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td class="bkBianco" style="line-height:1px;height:8px;width:1px;"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="232"></td>'+
		          '<td class="bkBianco"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="7" height="1"></td>'+
		          '<td class="bkBianco" valign="top"><!-- inizio tabella testuale box -->'+
							boxDXCode()+
							'</td>'+
		          '<td class="bkBianco" style="line-height:1px;height:1px;width:7px;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="line-height:1px;height:1px;width:1px;"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;height:9px;width:8px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmlft.gif" width="8" height="9"></td>'+
		          '<td class="bkBianco" style="line-height:1px;height:8px;width:1px;"></td>'+
		          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;height:9px;width:8px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmrght.gif"></td>'+
		        '</tr>'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="line-height:1px;height:1px;width:1px;"></td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table width="790" cellspacing="0" cellpadding="0">'+
				'<tr>'+
					'<td align="right" class="txt" height="20"><a href="#" class="lnormalg">'+ServerSide["backToTopPageFE"]+'</a> <sup><img src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" border="0"></sup></td>'+
				'</tr>'+
		'</table>'+
// LAYER SCROLLABILE COLORE //
		'<div id="ccContColori">'+
		  '<div id="ccInnColori">'+
				'<table border="0" cellspacing="0" cellpadding="0">';
	for (i = 0; i < MvsBCList.length/6; i++) {
		CodiceHTML +=
		  		'<tr>'+
		    		'<td valign="top">';
		for (j = 0; j < 6; j++) {
			if (((i*6)+j) < MvsBCList.length) {
				var curSel = 'bot_layer';
				var margTop = '';
				if (i > 0) margTop = 'margin-top:5px;';
				if (MvsBCList[((i*6)+j)].code == Vehicle.MvsBodyColor.code) curSel = 'bot_selected_layer';
				CodiceHTML += '<img onMouseOut="javascript:mouseOutBC(\''+MvsBCList[((i*6)+j)].code +'\');" onMouseOver="mouseOverBC(\''+MvsBCList[((i*6)+j)].code+'\');" onClick="javascript:mvsBCChanged(\''+MvsBCList[((i*6)+j)].code+'\');" class="'+curSel+'" valign="top" src="'+MvsBCList[((i*6)+j)].imgSmall+'" width="43" height="33" border="0" vspace="0" hspace="0" style="cursor:pointer;margin:0px;'+margTop+'margin-right:20px;">';
			}
		}
		CodiceHTML +=
						'</td>'+
				  '</tr>';
	}
	CodiceHTML +=
				'</table>'+
		  '</div>'+
		'</div>'+
// LAYER SCROLLABILE INTERNI //
		'<div id="ccContInterni">'+
		  '<div id="ccInnInterni">'+
				'<table border="0" cellspacing="0" cellpadding="0">';
	for (i = 0; i < interniListTMP.length/3; i++) {
		CodiceHTML +=
		  		'<tr>'+
		    		'<td valign="top" style="padding:5px 0 0 0;">';
		for (j = 0; j < 3; j++) {
			if (((i*3)+j) < interniListTMP.length) {
				var curSel = 'bot_layer';
				var margTop = '';
				if (i > 0) margTop = 'margin-top:5px;';
				if (j==2) margPom = '0'; else margPom = '22px';
				if (interniListTMP[((i*3)+j)].code == Vehicle.MvsInnerPreparation.code) curSel = 'bot_selected_layer';
				CodiceHTML += '<img onMouseOut="javascript:mouseOutIP(\''+interniListTMP[((i*3)+j)].code+'\');" onMouseOver="mouseOverIP(\''+interniListTMP[((i*3)+j)].code+'\');" onClick="javascript:mvsIPChanged(\''+interniListTMP[((i*3)+j)].code+'\');" class="'+curSel+'" valign="top" src="'+interniListTMP[((i*3)+j)].imgSmall+'" width="43" height="33" border="0" vspace="0" hspace="0" style="cursor:pointer;margin:0px;'+margTop+'margin-right:'+margPom+';">';
			}
		}
		CodiceHTML +=
						'</td>'+
				  '</tr>';
	}
	CodiceHTML +=
				'</table>'+
		  '</div>'+
		'</div>'+
// LAYER SCROLLABILE CERCHIONI //
		'<div id="ccContCerchioni">'+
		  '<div id="ccInnCerchioni">'+
				'<table border="0" cellspacing="0" cellpadding="0">';
	for (i = 0; i < cerchioniListTMP.length/3; i++) {
		CodiceHTML +=
		  		'<tr>'+
		    		'<td valign="top">';
		for (j = 0; j < 3; j++) {
			if (((i*3)+j) < cerchioniListTMP.length) {
				var curSel = 'bot_layer';
				var margTop = '';
				if (i > 0) margTop = 'margin-top:5px;';
				if (j==2) margPom = '0'; else margPom = '22px';
				if (cerchioniListTMP[((i*3)+j)].code == getCerchione().code) curSel = 'bot_selected_layer';
				CodiceHTML += '<img onMouseOut="javascript:mouseOutRim(\''+cerchioniListTMP[((i*3)+j)].code+'\');" onMouseOver="mouseOverRim(\''+cerchioniListTMP[((i*3)+j)].code+'\');" onClick="javascript:mvsOptChanged(\''+cerchioniListTMP[((i*3)+j)].code+'\');" class="'+curSel+'" valign="top" src="'+cerchioniListTMP[((i*3)+j)].imgSmall+'" width="43" height="33" border="0" vspace="0" style="cursor:pointer;margin:0;'+margTop+'margin-right:'+margPom+';">';
			}
		}
		CodiceHTML +=
						'</td>'+
				  '</tr>';
	}
	CodiceHTML +=
				'</table>'+
		  '</div>'+
		'</div>';

	document.getElementById('fiatcc').innerHTML = CodiceHTML;

}
// FINE DISPLAY STEP 2 (scelta colore, interni cerchione)

/******************************************/

// INIZIO DISPLAY STEP 3 (scelta altri optional)
function displayStep3() {

	CodiceHTML = 
		NumImgCode()+
		menuTopRightCode()+
		'<table border="0" cellspacing="0" cellpadding="0" width="790">'+
			'<tr>'+
				'<td valign="top" colspan="2" class="bg_strana_1_nadpis nospace"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["Page3TitleImageFE"]+'" width="782" height="61" style="width:782px; height:61px;paddind:0;margin:0;border:0;display:block;"></td>'+
				'<td valign="top">'+
					'<table width="8" border="0" cellspacing="0" cellpadding="0" height="100%">'+
						'<tr>'+
							'<td class="bkBianco brdr_tprght" style="width:8px; height:9px;" ></td>'+
						'</tr>'+
						'<tr>'+
							'<td class="linka_right" style="width:8px; height:52px;"></td>'+
            '</tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
		  '<tr>'+
				// FLASH OBJECT
		    '<td class="bkBianco" id="tdFlash" style="height:180px;width:363px;margin:0;padding:0;border:0;"></td>'+
		    '<td class="bkBianco" valign="top" style="height:180px;margin:0;padding:0;border:0;">'+
					'<table border="0" cellspacing="0" cellpadding="0" width="419">'+
		        '<tr>'+
		          '<td style="width:9px;"></td>'+
		          '<td class="txt" valign="top" align="left"><br>'+
								ServerSide["Page3TextFE"]+'<br><br>'+
								'<img src="'+Vehicle.MvsInnerPreparation.imgBig+'" align="left" width="212" height="109">'+
								'<img src="'+getCerchione().imgBig+'" align="right" width="81" height="81" hspace="22" vspace="15">'+
							'</td>'+
		          '<td style="width:10px;height:1px;"></td>'+
		        '</tr>'+
		      '</table>'+

				'</td>'+
				'<td class="bk1" style="height:180px;width:8px;margin:0; padding:0;border:0;">'+
					'<table  style="height:180px;width:8px;margin:0;padding:0;border:0;" border="0" cellspacing="0" cellpadding="0">'+
						'<tr>'+
							'<td valign="top" style="width:7px;background-color:#ffffff;"></td>'+
							'<td style="width:1px; height: 171px; background-color:#a2a29a;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td colspan="2" valign="bottom" class="bg_roh_dolni_s2_model" style="width:8px; height: 9px;"></td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
		  '</tr>'+
		  '<tr>'+
		    '<td colspan="3">'+
					'<table border="0" cellspacing="0" cellpadding="0" width="783">'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:15px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:551px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:215px;height:1px;margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table border="0" cellspacing="0" cellpadding="0">'+
		  '<tr>'+
		    '<td colspan="4"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="11"></td>'+
		  '</tr>'+
		  '<tr>'+
		    '<td style="width:15px;height:1px;"></td>'+
		    '<td valign="top"><!-- inizio tab dati -->'+
					'<table border="0" cellspacing="0" cellpadding="0" width="548" class="bkBianco">'+
						'<tr>'+
							'<td rowspan="2" colspan="2" class="bk4" style="width:8px;height:9px;line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tplft.gif"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:10px;height:1px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:2px;height:1px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:508px;height:1px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:2px;height:1px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:10px;height:1px;"></td>'+
							'<td rowspan="2" colspan="2" class="bk4" style="width:8px;height:9px;line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tprght.gif"></td>'+
						'</tr>'+
						'<tr>'+
							'<td class="bk4" style="width:10px;height:8px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'brdr_bxcntnt.gif" style="width:2px;height:8px;"></td>'+
							'<td class="bkBianco" style="width:508px;height:8px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'brdr_bxcntnt.gif" style="width:2px;height:8px;"></td>'+
							'<td class="bk4" style="width:10px;height:8px;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;"></td>'+
							'<td class="bk4" style="width:7px;height:8px;"></td>'+
							'<td class="bk4" style="width:1px;height:8px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'brdr_bxcntnt.gif" style="width:2px;height:1px;"></td>'+
							'<td valign="top" class="bkBianco" align="center">'+
								'<table border="0" cellspacing="0" cellpadding="0">'+
									'<tr><td align="center"><img src="'+ServerSide["Page3SubTitleImageFE"]+'" align="center" width="491" height="45"></td>'+
//zde
									'</tr>'+
									'<tr>'+
										'<td valign="top" align="center">'+
											'<table border="0" cellspacing="0" cellpadding="2" class="tbldotted" width="96%">'+
												'<tr class="bk2">'+
													'<td class="trc" colspan="3" align="center" width="20"><span class="txtbold">'+ServerSide["page3H1"]+'</span></td>'+
													'<td class="trc" width="85%" align="center"><span class="txtbold">'+ServerSide["page3H2"]+'</span></td>';
											if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {		
                        CodiceHTML += '<td class="trc" width="15%" align="center" colspan="2"><span class="txtbold">'+ServerSide["page3H3"]+'</span></td>';
                      }
                      else
                      {
                        CodiceHTML += '<td class="trc" width="15%" align="center"><span class="txtbold">'+ServerSide["page3H3"]+'</span></td>';
                      }    
											CodiceHTML +=	'</tr>'+
'<!-- INIZIO LOOP OPTIONALS -->';
var currentOpts = getVehicleOpts();
flagNextStep = true;
							for (var cati in Categories) {
								if (cati != '-') {
								  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
                    CodiceHTML += 
  											  '<tr class="bk3">'+
  											  	'<td class="trc" colspan="6" align="left"><span class="txtbold">'+Categories[cati]+'</span></td>'+
  											  '</tr>';
                  }
                  else
                  {
  									CodiceHTML += 
  											  '<tr class="bk3">'+
  											  	'<td class="trc" colspan="5" align="left"><span class="txtbold">'+Categories[cati]+'</span></td>'+
  											  '</tr>';
									}		  
									for (k = 0; k < getOptByCategory(cati).length; k++) {
										var escla = '<img src="'+ServerSide["imagePath"]+'spaziatore.gif" width="13" height="13" vspace="0" hspace="0" border="0" style="margin-left:5px;">';
										var esplo = '<img src="'+ServerSide["imagePath"]+'spaziatore.gif" width="13" height="13" vspace="0" hspace="0" border="0" style="margin-left:5px;">';
										var che = '';
										var disab = '';
										for (var COC in currentOpts) {
											if (COC == getOptByCategory(cati)[k].code) che = ' checked';
										}
										if (setChecked(getOptByCategory(cati)[k].code)) che = ' checked';
										if (getOptByCategory(cati)[k].optType == 'S' || setDisabled(getOptByCategory(cati)[k].code) || odpoctovaVerzePolozkuZakazat(getOptByCategory(cati)[k].code) ) disab = ' disabled';
										var stc = '';
										if (che == ' checked') { 
											var oe = toBeIncluded(getOptByCategory(cati)[k].code);
											var oi = mustInclude(getOptByCategory(cati)[k].code);
											if (!oe[0] || oi) {
												if (oi && !oe[0]) stc = 'ei';
												if (oi && oe[0]) stc = 'i';
												if (!oi && !oe[0]) stc = 'e';
												escla = '<img onclick="javascript:checkCons(\''+getOptByCategory(cati)[k].code+'\',\''+stc+'\');" src="'+ServerSide["imagePath"]+'fiatcc_icona_escla.gif" width="13" align="center" height="13" vspace="0" hspace="0" border="0" style="cursor:pointer;margin-left:5px;">';
												flagNextStep = false;
											}
										}
										if (getOptByCategory(cati)[k].info == 'true') {
											esplo = '<img src="'+ServerSide["imagePath"]+'fiatcc_icona_esplora.gif" onclick="javascript:optionalInfoRequested(\''+getOptByCategory(cati)[k].code+'\')" width="14" height="15" vspace="0" align="center" hspace="0" border="0" style="cursor:pointer;margin-left:5px;">';
										}
										var checkB = '<input type="checkbox" class="formChe"'+che+disab+' onclick="javascript:addOrRemoveOpt(\''+getOptByCategory(cati)[k].code+'\', this);">';
										var promoFlag = true;
										for (p = 0; p < PromoList.length; p++) {
											if (PromoList[p].promoType == 'C' && PromoList[p].objCode == getOptByCategory(cati)[k].code) {
											  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
												CodiceHTML += 
													  '<tr class="bkred">'+
														  '<td class="trc" width="20" align="center">'+escla+'</td>'+
														  '<td class="trc" width="20" align="center">'+esplo+'</td>'+
														  '<td align="center" class="trc">'+checkB+'</td>'+
														  '<td class="trc" align="left">'+convertApici(getOptByCategory(cati)[k].desc)+'</td>'+
														  '<td class="trc" align="right" nowrap><s>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price,1,1)+'</s>&nbsp;&nbsp;<br><b>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price + PromoList[p].price,1,1)+'</b>&nbsp;&nbsp;</td>'+
													    '<td class="trc" align="right" nowrap><s>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price,1,2)+'</s>&nbsp;&nbsp;<br><b>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price + PromoList[p].price,1,2)+'</b>&nbsp;&nbsp;</td>'+
                            '</tr>';
                        }
                        else
                        {
                          CodiceHTML += 
													  '<tr class="bkred">'+
														  '<td class="trc" width="20" align="center">'+escla+'</td>'+
														  '<td class="trc" width="20" align="center">'+esplo+'</td>'+
														  '<td align="center" class="trc">'+checkB+'</td>'+
														  '<td class="trc" align="left">'+convertApici(getOptByCategory(cati)[k].desc)+'</td>'+
														  '<td class="trc" align="right" nowrap><s>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price,1,0)+'</s>&nbsp;&nbsp;<br><b>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price + PromoList[p].price,1,0)+'</b>&nbsp;&nbsp;</td>'+
                            '</tr>';
                        }    
												promoFlag = false;
											}
										}
										if (promoFlag) {
										  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
											CodiceHTML += 
													  '<tr>'+
														  '<td class="trc" width="20" align="center">'+escla+'</td>'+
														  '<td class="trc" width="20" align="center">'+esplo+'</td>'+
														  '<td valign="top" align="center" class="trc">'+checkB+'</td>'+
														  '<td class="trc" align="left">'+convertApici(getOptByCategory(cati)[k].desc)+'</td>'+
														  '<td class="trc" align="right" nowrap>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price,1,1)+'&nbsp;&nbsp;</td>'+
													    '<td class="trc" align="right" nowrap>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price,1,2)+'&nbsp;&nbsp;</td>'+
                            '</tr>';
                      }
                      else
                      {
                        CodiceHTML += 
													  '<tr>'+
														  '<td class="trc" width="20" align="center">'+escla+'</td>'+
														  '<td class="trc" width="20" align="center">'+esplo+'</td>'+
														  '<td valign="top" align="center" class="trc">'+checkB+'</td>'+
														  '<td class="trc" align="left">'+convertApici(getOptByCategory(cati)[k].desc)+'</td>'+
														  '<td class="trc" align="right" nowrap>&nbsp;&nbsp;'+getPrice(getOptByCategory(cati)[k].price,1,0)+'&nbsp;&nbsp;</td>'+
                            '</tr>';
                      }      
										}
									}
								}
							}



 			flagPromozioni = false;
			for (pp = 0; pp < PromoList.length; pp++) {
				if (PromoList[pp].promoType == 'A' || PromoList[pp].promoType == 'B' || PromoList[pp].promoType == 'D' ) flagPromozioni = true;
			}
			if (flagPromozioni) {
					CodiceHTML += 
									'<tr>'+
										'<td colspan="6" class="trc">'+
											'<table border="0" cellpadding="0" cellspacing="0" width="100%">';
				for (pro = 0; pro < PromoList.length; pro++) {
					if (PromoList[pro].promoType == 'A') {
						var proComA = '';
						var proCheckA = '';
						var proDisableA = '';
						if (PromoList[pro].communication != '') proComA = '<span class="txt">'+PromoList[pro].communication;+'</span>';
						if (Vehicle.Promos[PromoList[pro].code] != null) proCheckA = ' checked';
						if (PromoList[pro].switchable == '0') proDisableA = ' disabled';
						CodiceHTML += 
										'<tr>'+
											'<td align="left">'+
												'<table cellpadding="0" cellspacing="0" border="0">'+
												'<tr>'+
													'<td height="18" width="3" style="font-size:2px;" align="center">'+
														'<input onclick="javascript:addOrRemovePromo(\''+PromoList[pro].code+'\', this);" type="checkbox" '+proCheckA+proDisableA+'>'+
													'</td>'+
													'<td class="txtbold" style="padding-left:2px;">'+PromoList[pro].choice+' '+proComA+'</td>'+
												'</tr>'+
												'</table>'+
									 		'</td>'+
										'</tr>';
					}
					if (PromoList[pro].promoType == 'B') {
						var proCheckB = '';
						var proDisableB = '';
						if (Vehicle.Promos[PromoList[pro].code] != null) proCheckB = ' checked';
						if (PromoList[pro].switchable == '0') proDisableB = ' disabled';
						CodiceHTML += 
										'<tr>'+
											'<td height="19" align="left" valign="center" style="padding-left:2px;" class="txt">'+
												'<input onclick="javascript:addOrRemovePromo(\''+PromoList[pro].code+'\', this);" type="checkbox" '+proCheckB+proDisableB+'> '+PromoList[pro].choice+
											'</td>'+
										'</tr>';
					}
					if (PromoList[pro].promoType == 'D') {
						CodiceHTML += 
										'<tr>'+
										'<td height="19" align="left" style="padding-left:2px;" class="txt">'+
											PromoList[pro].communication+
										'</td>'+
									'</tr>';
					}
				}
				CodiceHTML += 
								'</table>'+
							'</td>'+
						'</tr>';
			}



											CodiceHTML += 
'<!-- FINE LOOP OPTIONALS -->'+
														'</table>'+
													'</td>'+
												'</tr>'+
												'<tr>'+
													'<td align="center">'+
														'<table border="0" cellspacing="0" cellpadding="2" width="96%">'+
																footerTasti()+
														'</table>'+ /*ServerSide["TextLEDARdodat"] +*/
													'</td>'+
												'</tr>'+
											'</table>'+
										'</td>'+
	                  '<td background="'+ServerSide["imagePath"]+'brdr_bxcntnt.gif" style="width:2px;height:8px;"></td>'+
	                  '<td class="bk4" style="width:1px;height:8px;"></td>'+
	                  '<td class="bk4" style="width:7px;height:8px;"></td>'+
	                  '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;"></td>'+
	                '</tr>'+
  	              '<tr>'+
    	              '<td rowspan="2" colspan="2" class="bk4" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmlft.gif"></td>'+
    	              '<td colspan="5" class="bk4" style="width:1px;height:8px;"></td>'+
    	              '<td rowspan="2" colspan="2" class="bk4" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmrght.gif"></td>'+
    	            '</tr>'+
      	          '<tr>'+
        	          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" colspan="5" style="height:1px;"></td>'+
        	        '</tr>'+
					      '</table>'+
							'</td>'+
					    '<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="18" height="1"></td>'+
					    '<td valign="top">'+
					      '<table border="0" cellspacing="0" cellpadding="0" width="204">'+
					        '<tr>'+
					          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tplft.gif" width="8" height="9"></td>'+
					          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:188px;height:1px;"></td>'+
					          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tprght.gif"></td>'+
					        '</tr>'+
					        '<tr>'+
					          '<td class="bkBianco" style="height:8px;"></td>'+
					        '</tr>'+
					        '<tr>'+
					          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:232px;"></td>'+
					          '<td class="bkBianco" style="width:7px;height:1px;"></td>'+
					          '<td class="bkBianco" valign="top"><!-- inizio tabella testuale box -->'+
										boxDXCode()+
										'</td>'+
					          '<td class="bkBianco" style="width:7px;height:1px;"></td>'+
					          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;"></td>'+
					        '</tr>'+
					        '<tr>'+
					          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmlft.gif" width="8" height="9"></td>'+
					          '<td class="bkBianco" style="width:1px;height:8px;"></td>'+
					          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmrght.gif"></td>'+
					        '</tr>'+
					        '<tr>'+
					          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="height:1px;"></td>'+
					        '</tr>'+
					      '</table>'+
							'</td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table width="790" cellspacing="0" cellpadding="0">'+
				'<tr>'+
					'<td align="right" class="txt" height="20"><a href="#" class="lnormalg">'+ServerSide["backToTopPageFE"]+'</a> <sup><img src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" border="0"></sup></td>'+
				'</tr>'+
		'</table>';

	document.getElementById('fiatcc').innerHTML = CodiceHTML;

}
// FINE DISPLAY STEP 3 (scelta altri optional)

/******************************************/


// INIZIO DISPLAY STEP 4
function displayStep4() {
	/* prendo gli oggetti ExternalLink per stampare i testi linkati, le immagini
	linkate ed i percorsi da passare a externalLinkCalled(code) */
	var financing = getExternalLinkByCode("financing");
	var dealerLocator = getExternalLinkByCode("dealerLocator");
	var saveConfig = getExternalLinkByCode("saveConfig");
	var brochure = getExternalLinkByCode("brochure");
	var printLeaflet = getExternalLinkByCode("printLeaflet");
	var sendToFriend = getExternalLinkByCode("sendToFriend");
	var loadConfig = getExternalLinkByCode("loadConfig");
	var testDrive = getExternalLinkByCode("testDrive");
	var sendLead = getExternalLinkByCode("sendLead");

	CodiceHTML = 
		NumImgCode()+
		menuTopRightCode()+
		'<table border="0" cellspacing="0" cellpadding="0" width="790">'+
			'<tr>'+
				'<td valign="top" colspan="2" class="bg_strana_1_nadpis nospace"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["Page4TitleImageFE"]+'" width="782" height="61" style="width:782px; height:61px;paddind:0;margin:0;border:0;display:block;"></td>'+
				'<td valign="top">'+
					'<table width="8" border="0" cellspacing="0" cellpadding="0" height="100%">'+
						'<tr>'+
							'<td class="bkBianco brdr_tprght" style="width:8px; height:9px;" ></td>'+
						'</tr>'+
						'<tr>'+
							'<td class="linka_right" style="width:8px; height:52px;"></td>'+
            '</tr>'+
					'</table>'+
				'</td>'+
			'</tr>'+
		  '<tr>'+
			// FLASH OBJECT
			  '<td class="bkBianco" id="tdFlash" style="height:180px;width:363px;margin:0;padding:0;border:0;"></td>'+
		    '<td class="bkBianco" valign="top" style="height:180px;margin:0;padding:0;border:0;">'+
					'<table border="0" cellspacing="0" cellpadding="0" width="419">'+
		        '<tr>'+
		          '<td style="width:9px;"></td>'+
		          '<td class="txt" valign="top" align="left"><br>'+
								ServerSide["page4Text"]+'<br><br>'+
								'<img src="'+Vehicle.MvsInnerPreparation.imgBig+'" align="left" width="212" height="109">'+
								'<img src="'+getCerchione().imgBig+'" align="right" width="81" height="81" hspace="22" vspace="15">'+
							'</td>'+
		          '<td style="width:10px;height:1px;"></td>'+
		        '</tr>'+
		      '</table>'+
		    '</td>'+
				'</td>'+
				'<td class="bk1" style="height:180px;width:8px;margin:0; padding:0;border:0;">'+
					'<table  style="height:180px;width:8px;margin:0;padding:0;border:0;" border="0" cellspacing="0" cellpadding="0">'+
						'<tr>'+
							'<td valign="top" style="width:7px;background-color:#ffffff;"></td>'+
							'<td style="width:1px; height: 171px; background-color:#a2a29a;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td colspan="2" valign="bottom" class="bg_roh_dolni_s2_model" style="width:8px; height: 9px;"></td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
		  '</tr>'+
		  '<tr>'+
		    '<td colspan="3">'+
					'<table border="0" cellspacing="0" cellpadding="0" width="783">'+
		        '<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:15px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:551px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;margin:0;padding:0;border:0;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:215px;height:1px;margin:0;padding:0;border:0;"></td>'+
		        '</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
		'</table>'+
		'<table border="0" cellspacing="0" cellpadding="0" width="790">'+
		  '<tr>'+
		    '<td colspan="3"><img src="'+ServerSide["imagePath"]+'spacer.gif" height="11"></td>'+
		  '</tr>'+
		  '<tr>'+
		    '<td width="15"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="15" height="1"></td>'+
		    '<td width="571" valign="top">'+
					'<table border="0" cellspacing="0" cellpadding="0" class="bkBianco" width="571">'+
						'<tr>'+
							'<td rowspan="2" colspan="2" class="bkBianco" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tplft.gif"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="height:1px;"></td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" colspan="2" style="width:8px;height:1px;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td style="width:571px;height:8px;"></td>'+
							'<td colspan="2" style="width:1px;height:8px;"></td>'+
						'</tr>'+
						'<tr>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;"></td>'+
							'<td style="width:7px;height:8px;"></td>'+
							'<td valign="top" align="center" class="txt">'+
								'<table border="0" cellspacing="0" cellpadding="0" width="100%" id="vysl_tabulka_id">'+
									'<tr>'+
										'<td style="width:10px;height:1px;"></td>'+
										'<td valign="bottom"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["BoxYourCarTitleImageFE"]+'" border="0" class="img_bx10px"></td>'+
										'<td align="right" ><img src="'+ServerSide["imagePath"]+'curva_tit.gif"></td>'+
										'<td style="width:10px;height:1px;"></td>'+
									'</tr>'+
									'<tr>'+
										'<td style="width:10px;height:1px;"></td>'+
										'<td colspan="2" class="txt" align="left">'+convertApici(Vehicle.Mvs.desc)+'<br>'+
									    '<br>'+
									    '<table border="0" cellspacing="0" cellpadding="0" width="100%">'+
									      '<tr>'+
									        '<td background="'+ServerSide["imagePath"]+'brdr_ttlbxcntnt.gif" style="height:1px;"></td>'+
									      '</tr>'+
									    '</table>'+
											'<br>'+
											'<td></td><td style="width:10px;height:1px;"></td>'+
									'</tr>'+
									'<tr>'+
                  	'<td style="width:10px;height:1px;"></td>'+	
                  	'<td colspan="2" class="txt" align="left">'+
											'<img id="BoxBasePriceTitleImageFE_pic" src="'+ServerSide["imageUploadPathFE"]+(ServerSide["BoxBasePriceTitleImageFE"])+'"><br>';
					if (calculatePrice('basicPrice') != calculatePrice('basicPricePromo')) {
          	CodiceHTML += '<s>'+ServerSide["currency"]+' '+getPrice(calculatePrice('basicPrice'),0,0)+'</b> '+'</s>'+
												 '<br><b>'+ServerSide["boxOnPromotionLabelFE"]+'</b><br>'+ServerSide["currency"]+' '+getPrice(calculatePrice('basicPricePromo'),0,0)+'</b> ';
					} else {
          	CodiceHTML += ServerSide["currency"]+' '+getPrice(calculatePrice('basicPrice'),0,0)+'</b> ';
					}
					
					
					CodiceHTML += 
											'<br><br>'+
										'</td>'+
										'<td style="width:10px;height:1px;"></td>'+
									'</tr>'+
									'<tr>'+
										'<td colspan="4">'+
											'<table border="0" width="100%" class="bk5">'+
										    '<tr>'+
										      '<td class="txt" align="left" style="padding:10px;"><img id="BoxTotalPriceTitleImageFE_pic" src="'+ServerSide["imageUploadPathFE"]+(ServerSide["BoxTotalPriceTitleImageFE"])+'"><br>';
													if (calculatePrice('totalPrice') != calculatePrice('totalPriceNoPromo')) {
								          	var cPrice = calculatePrice('totalPriceNoPromo');
                            CodiceHTML += '<s>'+ServerSide["currency"]+' '+getPrice(calculatePrice('totalPriceNoPromo'),0,0)+'</b> '+'</s>'+
																				 '<br><b>'+ServerSide["boxOnPromotionLabelFE"]+'</b><br>'+ServerSide["currency"]+' '+getPrice(calculatePrice('totalPrice'),0,0)+'</b> ';
													} else {
													  var cPrice = calculatePrice('totalPrice');
								          	CodiceHTML += ServerSide["currency"]+' '+getPrice(calculatePrice('totalPriceNoPromo'),0,0)+'</b> ';
													}
					CodiceHTML += 	'<br><br></td></tr></table></td></tr>';
					
					if (Vehicle.Mvs.sleva>0)
					{
						CodiceHTML += 
											'<tr><td colspan="4"><table border="0" width="100%">'+
										    '<tr>'+
										      '<td class="txt" align="left" style="padding:10px;"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["BoxSlevaTitleImageFE"]+'"><br>';
						var cSleva = getDiscount(cPrice,Vehicle.Mvs.sleva);
            CodiceHTML += ServerSide["currency"]+' '+getPrice(cSleva,0,0)+'</b> ';
						CodiceHTML +=								''+ // !!!!! CELKOVY SOUHRN
													'</td>'+
										    '</tr>'+
										  '</table></td></tr>';
									
						CodiceHTML += 
											'<tr><td colspan="4"><table border="0" width="100%" class="bk5">'+
										    '<tr>'+
										      '<td class="txt" align="left" style="padding:10px;"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["BoxTotalPriceBezSlevyTitleImageFE"]+'"><br>';
						CodiceHTML += ServerSide["currency"]+' '+getPrice(calculatePrice('totalPriceNoPromo')-cSleva,0,0)+'</b> ';
						CodiceHTML +=	'<br>'+ // !!!!! CELKOVY SOUHRN
													'</td>'+
										    '</tr>'+
										  '</table></td></tr>';			
					}				
					
					CodiceHTML += 
									
									'<tr>'+
										'<td colspan="4" class="txt"><br>'+
											'<table border="0" width="100%" class="bk6" align="left">'+
												'<tr>'+
													'<td valign="top" class="txt" align="left" style="padding:10px;"><img src="'+ServerSide["imageUploadPathFE"]+ServerSide["BoxConfDetailsTitleImageFE"]+'"><br>'+
														'<br>'+
// INIZIO DETTAGLI DI CONFIGURAZIONE //
														'<table border="0" cellspacing="0" cellpadding="2" class="tblBk6" width="100%"> '+
														  '<tr class="bkBianco">'+
																'<td class="trc" width="82%"><span class="txtbold">'+ServerSide["page4Header1FE"]+'</span></td>';
                                if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
																  CodiceHTML += '<td class="trc" colspan="2" align="center"><span class="txtbold">'+ServerSide["page3H3"]+'</span></td>';
																}
                                else {
                                  CodiceHTML += '<td class="trc"><span class="txtbold">'+ServerSide["page3H3"]+'</span></td>';
                                }
                                  
								CodiceHTML +='</tr>'+
														  '<tr>'+
															  '<td class="trc" valign="top"><span class="txtbold">'+ServerSide["boxDetailBodyColor"]+':</span> '+convertApici(Vehicle.MvsBodyColor.desc)+'</td>';
															  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
															   CodiceHTML += '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.MvsBodyColor.price,0,1)+'&nbsp;&nbsp;</td>'+
															   '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.MvsBodyColor.price,0,2)+'&nbsp;&nbsp;</td>'
															  }
															  else
															  {
                                 CodiceHTML += '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+numberToFormattedString(Vehicle.MvsBodyColor.price)+'&nbsp;&nbsp;</td>';
                                }
							  CodiceHTML += '</tr>'+
														  '<tr>'+
															  '<td class="trc" valign="top"><span class="txtbold">'+ServerSide["boxDetailnnerPreparation"]+':</span> '+convertApici(Vehicle.MvsInnerPreparation.desc)+'</td>';
															  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
															   CodiceHTML += '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.MvsInnerPreparation.price,0,1)+'&nbsp;&nbsp;</td>'+
															   '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.MvsInnerPreparation.price,0,2)+'&nbsp;&nbsp;</td>'
															  }
															  else
															  {
                                 CodiceHTML += '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.MvsInnerPreparation.price,0,0)+'&nbsp;&nbsp;</td>';
                                }
															  
								CodiceHTML += '</tr>'+
														  '<tr>'+
															  '<td class="trc" valign="top"><span class="txtbold">'+ServerSide["boxDetailRim"]+':</span> '+convertApici(getCerchione().desc)+'</td>';
															  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
															   CodiceHTML += '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(getCerchione().price,0,1)+'&nbsp;&nbsp;</td>'+
															   '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(getCerchione().price,0,2)+'&nbsp;&nbsp;</td>'
															  }
															  else
															  {
                                 CodiceHTML += '<td class="trc" valign="top" nowrap>&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(getCerchione().price,0,0)+'&nbsp;&nbsp;</td>';
                                }
                 if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
                    colspanNew = 3;
                  }
                  else
                  {
                    colspanNew = 2;
                  }                
															  
								CodiceHTML += '</tr>'+
														  '<tr>'+
															  '<td colspan="'+colspanNew+'" class="trc" valign="top">&nbsp;</td>'+
														  '</tr>'+
														  '<tr class="bkBianco">'+
																'<td class="trc" width="82%"><span class="txtbold">'+ServerSide["page4Header2FE"]+'</span></td>';
																if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
																  CodiceHTML += '<td class="trc" colspan="2" align="center"><span class="txtbold">'+ServerSide["page3H3"]+'</span></td>';
																}
																else
																{
																  CodiceHTML += '<td class="trc"><span class="txtbold">'+ServerSide["page3H3"]+'</span></td>';
                                }
																
								CodiceHTML += '</tr>';
              var userOpts=Array();
							for (var VO in Vehicle.Optionals) {
								if (Vehicle.Optionals[VO].category != '-' && Vehicle.Optionals[VO].optType == 'O') {
								  userOpts[userOpts.length]=Vehicle.Optionals[VO].code;
									CodiceHTML += 
														  '<tr>'+
															  '<td class="trc" valign="top" align="left"><span class="txtbold"></span> '+convertApici(Vehicle.Optionals[VO].desc)+'</td>';
															  if (ServerSide["cenaDruh"] ==2 || ServerSide["cenaDruh"] == 3) {
										CodiceHTML +='<td class="trc" valign="top" align="left">';
									var eventualPricePromo = calculateSingleOptPromoPrice(Vehicle.Optionals[VO].code);
									if (Vehicle.Optionals[VO].price != eventualPricePromo) {
									  CodiceHTML += '&nbsp;&nbsp;<s>'+ServerSide["currency"]+' '+getPrice(Vehicle.Optionals[VO].price,0,1)+'</s>&nbsp;&nbsp;<br>'+
  																'&nbsp;&nbsp;<b>'+ServerSide["currency"]+' '+getPrice(eventualPricePromo,0,1)+'</b>&nbsp;&nbsp;</td><td class="trc" valign="top" align="left">'+
  																'&nbsp;&nbsp;<s>'+ServerSide["currency"]+' '+getPrice(Vehicle.Optionals[VO].price,0,2)+'</s>&nbsp;&nbsp;<br>'+
  																'&nbsp;&nbsp;<b>'+ServerSide["currency"]+' '+getPrice(eventualPricePromo,0,2)+'</b>&nbsp;&nbsp;</td><td class="trc" valign="top" align="left">';
																	
									} else {
										CodiceHTML += '&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.Optionals[VO].price,0,1)+'&nbsp;&nbsp;</td><td class="trc" valign="top" align="left">'+
                    '&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.Optionals[VO].price,0,2)+'&nbsp;&nbsp;';
									}
									CodiceHTML += 
																'</td>';
																}
																else
																{
                    CodiceHTML +='<td class="trc" valign="top" align="left">';
									var eventualPricePromo = calculateSingleOptPromoPrice(Vehicle.Optionals[VO].code);
									if (Vehicle.Optionals[VO].price != eventualPricePromo) {
									  CodiceHTML += '&nbsp;&nbsp;<s>'+ServerSide["currency"]+' '+getPrice(Vehicle.Optionals[VO].price,0,0)+'</s>&nbsp;&nbsp;<br>'+
  																'&nbsp;&nbsp;<b>'+ServerSide["currency"]+' '+getPrice(eventualPricePromo,0,0)+'</b>&nbsp;&nbsp;';
																	
									} else {
										CodiceHTML += '&nbsp;&nbsp;'+ServerSide["currency"]+' '+getPrice(Vehicle.Optionals[VO].price,0,0)+'&nbsp;&nbsp;';
									}
									CodiceHTML += 
																'</td>';
                                }
								CodiceHTML += '</tr>';
								}
							}
									CodiceHTML += 
														  '<tr>';
														 CodiceHTML += '<td colspan="'+colspanNew+'" class="trc" valign="top">&nbsp;</td>';
														 
															  
								 CodiceHTML +='</tr>'+
														  '<tr class="bkBianco">';
									CodiceHTML += '<td class="trc" colspan="'+colspanNew+'" align="left"><span class="txtbold">'+ServerSide["page4Header3FE"]+'</span></td>';
															
								CodiceHTML +='</tr>';
               
							for (var cati in StandardCategories) {
								if (cati != '-') {
									CodiceHTML += 
											  '<tr class="bk3">'+
											  	'<td class="trc" colspan="'+colspanNew+'" align="left"><span class="txtbold">'+StandardCategories[cati]+'</span></td>'+
											  '</tr>';
											  
									for (k = 0; k < getStandardOptByCategory(cati).length; k++) 
									{
									  var ok=true;
									  for (var oi=0;oi<userOpts.length;oi++)
									  {
										  if (!areOtpionalsCompatible(getStandardOptByCategory(cati)[k].code,userOpts[oi]))	
										  {
										    ok=false;
										    break;
										  }
									  } 
									  if (ok)
									  {
									   CodiceHTML += 
													  '<tr>'+
														  '<td class="trc" colspan="'+colspanNew+'" align="left">'+convertApici(getStandardOptByCategory(cati)[k].desc)+'</td>'+
													  '</tr>';
									  }			  
									}
											CodiceHTML += 
														  '<tr>'+
															  '<td colspan="'+colspanNew+'" class="trc" valign="top">&nbsp;</td>'+
														  '</tr>';
								}
							}

							for (var ad = 0; ad < ExternalLinkDataList.length; ad++) {
								if (ExternalLinkDataList[ad].length > 0) {
									CodiceHTML += 
													  '<tr class="bkBianco">'+
													  	'<td class="trc" colspan="'+colspanNew+'" align="left"><span class="txtbold">'+ExternalLinkDataList[ad][0]+'</span></td>'+
													  '</tr>'+
													  '<tr>'+
														  '<td class="trc" colspan="'+colspanNew+'" align="left">'+ExternalLinkDataList[ad][1]+'</td>'+
													  '</tr>'+
													  '<tr>'+
														  '<td colspan="'+colspanNew+'" class="trc" valign="top">&nbsp;</td>'+
													  '</tr>';
								}
							}
								CodiceHTML += 
														'</table><br clear=all>'/*+ServerSide["TextVAT"]*/ + ServerSide["TextLEDARdodat"] + 

// INIZIO DETTAGLI DI CONFIGURAZIONE //
													'</td>'+
												'</tr>'+
											'</table>'+
										'</td>'+
										'<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="10" height="1"></td>'+
									'</tr>'+
									'<tr>'+
										'<td colspan="4" class="txtBk6" style="line-height:1px;"><br>'+
											'<table border="0" cellspacing="0" cellpadding="0" width="100%">'+
												'<tr>'+
													'<td align="left" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_green_left.gif"></td>'+
													'<td align="right" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_green_right.gif"></td>'+
												'</tr>'+
											'</table>'+
										'</td>'+
										'<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="10" height="1"></td>'+
									'</tr>'+
									'<tr id="content_additional">'+
										'<td colspan="4" class="txt"><br>';
			if (financing.disabled == "false") CodiceHTML += '<a href="javascript:externalLinkCalled(\''+financing.code+'\')" class="lunderline" >'+financing.desc+'</a>';
			if (testDrive.disabled == "false") CodiceHTML += ' | <a href="javascript:externalLinkCalled(\''+testDrive.code+'\')" class="lunderline" >'+testDrive.desc+'</a>';
			if (dealerLocator.disabled == "false") CodiceHTML += '<a href="javascript:externalLinkCalled(\''+dealerLocator.code+'\')" class="lunderline" >'+dealerLocator.desc+'</a>';
			if (sendLead.disabled == "false") CodiceHTML += ' | <a href="javascript:externalLinkCalled(\''+sendLead.code+'\')" class="lunderline" >'+sendLead.desc+'</a>';
			if (saveConfig.disabled == "false") CodiceHTML += ' | <a href="javascript:externalLinkCalled(\''+saveConfig.code+'\')" class="lunderline" >'+saveConfig.desc+'</a>';
			if (brochure.disabled == "false") CodiceHTML += ' | <a href="javascript:externalLinkCalled(\''+brochure.code+'\')" class="lunderline" >'+brochure.desc+'</a>';
			if (printLeaflet.disabled == "false") CodiceHTML += ' | <a href="javascript:externalLinkCalled(\''+printLeaflet.code+'\')" class="lunderline">'+printLeaflet.desc+'</a>';
			if (sendToFriend.disabled == "false") CodiceHTML += ' | <a href="javascript:externalLinkCalled(\''+sendToFriend.code+'\')" class="lunderline" >'+sendToFriend.desc+'</a>';
			CodiceHTML += 
										'</td>'+
										'<td><img src="'+ServerSide["imagePath"]+'spacer.gif" width="10" height="1"></td>'+
									'</tr>'+
								'</table>'+ 
							'</td>'+
							'<td>'+
								'<img src="'+ServerSide["imagePath"]+'spacer.gif" width="7" height="8">'+
							'</td>'+
							'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" valign="top">'+
								'<table border="0" cellspacing="0" cellpadding="0">'+
							  	'<tr>'+
							  	  '<td class="bkBianco"><img src="'+ServerSide["imagePath"]+'spacer.gif" width="1" height="240"></td>'+
							  	'</tr>'+
								'</table>'+
							'</td>'+
						'</tr>'+
						'<tr>'+
						  '<td rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmlft.gif"></td>'+
						  '<td style="height:8px;"></td>'+
						  '<td rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmrght.gif"></td>'+
						'</tr>'+
						'<tr>'+
						  '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="height:1px;"></td>'+
						'</tr>'+
					'</table>'+
				'</td>'+
		    '<td valign="top">'+
					'<table border="0" cellspacing="0" cellpadding="0" width="204">'+
						'<tr>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" colspan="2" style="width:1px;height:1px;line-height:1px;"></td>'+
		          '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:188px;height:1px;"></td>'+
		          '<td class="bkBianco" rowspan="2" colspan="2" style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_tprght.gif"></td>'+
		        '</tr>'+
		        '<tr> '+
							'<td class="bkBianco" colspan="2" style="width:1px;height:8px;line-height:1px;"></td>'+
							'<td class="bkBianco" style="width:1px;height:1px;line-height:8px;"></td> '+
						'</tr>'+
						'<tr>'+
							'<td class="bkBianco" style="width:1px;height:232px;line-height:1px;"></td>'+
							'<td class="bkBianco" style="width:7px;height:1px;line-height:1px;"></td>'+
							'<td class="bkBianco" valign="top">'+
								'<table border="0" cellspacing="10" cellpadding="0" width="100%" style="z-index:60;position:relative;">'+
		              '<tr>'+
		                '<td class="txt" valign="top" align="left"><br>'+ServerSide["page4BoxLabel"]+':<br>';

					//inizio estensioni 17.06.2004
					var maxGroup=findExternalLinkMaxGroup();
					var maxGroupPos=findExternalLinkMaxGroupPos();
					var cont=1;
					var voce='opvoce';
					var formerGroup=-1;
					for(var gr=0;gr<=maxGroup;gr++){
						for(var pos=0;pos<=maxGroupPos;pos++){
							for(var i=0; i<ExternalLinkList.length;i++){
								var exL=ExternalLinkList[i];
								if(exL.disabled=="false" && exL.displayAs=="image" && exL.group==gr && exL.groupPos==pos){
									if(formerGroup!=-1 && formerGroup!=exL.group){
										CodiceHTML += '<br><br>';
									}
									voce='opvoce'+cont;
									CodiceHTML += '<br><img onclick="javascript:externalLinkCalled(\''+exL.code+'\')" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage(\''+voce+'\',\'\',\''+ServerSide["imageUploadPathFE"]+exL.imageOver+'\',0)" src="'+ServerSide["imageUploadPathFE"]+exL.image+'" name="'+voce+'" border="0" class="img_brdrbottom" style="cursor:pointer;margin:0px;" width="165" height="16" hspace="0" vspace="1">';
									formerGroup=exL.group;
									cont++;
								}
							}
						}
					}
					cont=0;
					for(var gr=0;gr<=maxGroup;gr++){
						for(var pos=0;pos<=maxGroupPos;pos++){
							for(var i=0; i<ExternalLinkList.length;i++){
								var exL=ExternalLinkList[i];
								if(exL.disabled=="false" && exL.displayAs=="text" && exL.group==gr && exL.groupPos==pos){
									if(cont==0){
										CodiceHTML +='<br><br><br>'; // toto je pro levy sloupec
									}
									else{
										CodiceHTML +=' | ';
									}									
									CodiceHTML += '<a href="javascript:externalLinkCalled(\''+exL.code+'\')"  class="lunderline">'+exL.desc+'</a>';
									cont++;
								}
							}
						}
					}
					//fine estensioni 17.06.2004

					CodiceHTML += 
										'</td> '+
		              '</tr>'+
		            '</table>'+
		           '</td>'+
			         '<td class="bkBianco" style="width:7px;height:1px;line-height:1px;"></td>'+
		  	       '<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;line-height:1px;"></td>'+
						'</tr> '+
						'<tr> '+
			         '<td class="bkBianco" colspan="2" style="width:8px;height:8px;line-height:1px;"></td> '+
			         '<td class="bkBianco" style="width:1px;height:8px;line-height:1px;"></td> '+
			         '<td class="bkBianco" rowspan="2" colspan="2"  style="line-height:1px;"><img src="'+ServerSide["imagePath"]+'brdr_bttmrght.gif"></td> '+
						'</tr>'+
						'<tr>'+
				  		'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" colspan="2" style="width:1px;height:1px;line-height:1px;"></td>'+
		         	'<td background="'+ServerSide["imagePath"]+'pxl_grey.gif" style="width:1px;height:1px;line-height:1px;"></td> '+
		       	'</tr>'+
		      '</table>'+
				'</td>'+
		  '</tr>'+
 		'</table>'+
		'<table width="790" cellspacing="0" cellpadding="0" border="0">'+
				'<tr>'+
					'<td align="right" class="txt" height="20"><a href="#" class="lnormalg">'+ServerSide["backToTopPageFE"]+'</a> <sup><img src="'+ServerSide["imagePath"]+'rrw_bttm.gif" width="8" height="6" border="0"></sup></td>'+
				'</tr>'+
		'</table>';

	document.getElementById('fiatcc').innerHTML = CodiceHTML;

	//cursorManagerStep4();
}
// FINE DISPLAY STEP 4
