	deliverymessages= new Array();
	deliverymessages[100]="Descrizione Consegna_A";
	deliverymessages[101]="Descrizione Consegna_B";
	deliverymessages[102]="Descrizione Consegna_C";
	deliverymessages[103]="Descrizione Consegna_D";
	deliverymessages[104]="Descrizione Consegna_E";
	deliverymessages[105]="Descrizione Consegna_F";
	deliverymessages[106]="Descrizione Consegna_H";
	deliverymessages[107]="Descrizione Consegna_L";
	deliverymessages[108]="Descrizione Consegna_M";


function openWinJ(Cada)
	{ 	while(Cada.indexOf(' ') > 0) {
			Cada = Cada.replace(' ','');
		}
		window.open(Cada,1,'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=480,height=480');
	}
	
	
function openWinVideo(Cada)
	{ 	while(Cada.indexOf(' ') > 0) {
			Cada = Cada.replace(' ','');
		}
		window.open(Cada,1,'toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width=700,height=530');
	}	
	
	function get_cookie(Name) 
    { 	var search = Name + "="
        var returnvalue = "";
        if (document.cookie.length > 0) 
        { 	offset = document.cookie.indexOf(search)
            // if cookie exists
            if (offset != -1) 
            {	offset += search.length
				// set index of beginning of value
				end = document.cookie.indexOf(";", offset);
				 // set index of end of cookie value
				if (end == -1) end = document.cookie.length;
				returnvalue = unescape(document.cookie.substring(offset, end))
			}
		}
		if(returnvalue == '7000000000000000999' ||  returnvalue == '7000000000000000998') return true;
		else return false;
	}
	
	function openWin(link,num,email) 
	{ 	
		
		po=window.open('','centroassistenza','width=440,height=170,toolbar=no,title=no,directories=no,scrollbars=no,resizable=no');             
		doc=po.document;                                                                                                                        
		if (link!='') link = '<A HREF=http://' + link + ' TARGET=_blank>Centro assistenza on line</A>';                                     
		else link = '<b>Le informazioni on-line sul centro assistenza non sono disponibili</b>';                                                
		if (num=="") num = '800-882288'; 
		if (email!='') email = 'Indirizzo e-mail: ' + email;
		else email = '<b>L\'indirizzo e-mail non è disponibile</b>';                                                                                                                
		str='<HTML><HEAD><TITLE>'+storeTitle+'</TITLE><LINK  href="'+stylePath+'/stylepopup.css" type="text/css" rel=stylesheet></HEAD>' +                                                                  
			'<BODY CLASS="body0">' +                                                  
			' <TABLE cellSpacing=0 cellPadding=0 width=440 align=center border=0><TBODY><TR><TD align=left><IMG SRC="'+imgDir+'/testata_assistenza.gif" BORDER="0"></TD></TR>' +  
			'<TR><TD>&nbsp;</TD><TR><TR></TABLE>' +
			'<TABLE cellSpacing=0 cellPadding=0 width=400 align=center border=0>' +                                                         
			'<TR><TD CLASS="VoceFormPopASS"><IMG SRC="'+imgDir+'/arrow_titoli.gif" BORDER="0"></TD><TD CLASS="VoceFormPopASS">' + link + '</TD></TR>' +
			'<TR><TD CLASS="VoceFormPopASS"><IMG SRC="'+imgDir+'/arrow_titoli.gif" BORDER="0"></TD><TD CLASS="VoceFormPopASS">Centro assistenza telefonico: ' + num + '</TD></TR>' +    
			'<TR><TD CLASS="VoceFormPopASS"><IMG SRC="'+imgDir+'/arrow_titoli.gif" BORDER="0"></TD><TD CLASS="VoceFormPopASS">' + email + '</TD></TR>' +
			'</TBODY></TABLE></BODY></HTML>';                                                                                                         
		doc.write(str);                                                                                                                         

	}
	

	function createForm()
	{ 	// Questa funzione deve controllare se ci sono prodotti checcatti
		// Se il proddotto è ceccato modifico i nomi delle input:
		//		da Corr_ID 	a catEntryId_prg
		//		da quant_ID a quantity_prg
		// Se il prodotto non è acquistabile non modifico nulla
		doc = document.OrderItemAddForm;
		nprc = doc.totpr.value;	//Totale prodotti correlati (attenzione partono da 0)
		prg = 2;	//Progressivo esatto inserimento
		prgc = 0;	//Progressivo correlati
		var isCheck = false;
		var namecr = ''; // Nome del prodotto correlato checkbox
		var corrId = ''; // Memorizza Id correlato
		var oldIdName = ''; // Nome ID da modificare della input 
		var newIdName = ''; // Nuovo ID  nome della input 
		var oldQName = ''; // Nome quantity da modificare della input 
		var newQdName = ''; // Nuovo quantity  nome della input 
		var changeNum = 0; 	// Memorizzo quante modifiche sono state fatte
		
		if (nprc > 0) {
			for (i = 0; i < doc.elements.length; i++) {
				//Ciclo su tutti gli elementi della form
				namecr = 'PrCorr_' + prgc;
				if((doc.elements[i].type == 'checkbox') && (doc.elements[i].name == namecr)) {
					if(doc.elements[i].checked) {
						isCheck = true;
						corrId = doc.elements[i].value;
					} else {
						prgc++;
					}
				} else {
					if(isCheck) {
						oldIdName = 'corrId_' + corrId;
						newIdName = 'catEntryId_' + prg;
						oldQName = 'quant_' + corrId;
						newQName = 'quantity_' + prg;
						oldF1Name = 'field1_' + corrId;
						newF1Name = 'field1_' + prg;
						
						if((doc.elements[i].name == oldIdName) || (doc.elements[i].name == oldQName) || (doc.elements[i].name == oldF1Name)) {
							if(doc.elements[i].name == oldIdName) doc.elements[i].name = newIdName;
							if(doc.elements[i].name == oldQName) doc.elements[i].name = newQName;
							if(doc.elements[i].name == oldF1Name) doc.elements[i].name = newF1Name;
							
							changeNum++;
						}
					}
				}
				if(changeNum == 3) {
					changeNum = 0;
					prgc++;
					prg++;
					isCheck = false;
				}
				if(prgc == nprc) i = doc.elements.length;			
			}
		}
		return;
	}
	
	function cutEuro(price) {
		document.write(price.substring(12,price.length));
	}
	
	var width = "100";
	var border = "1";
	var offsetx = -115;
	var offsety = 2;
	var fcolor = "#ffffff";
	var backcolor = "#000000";
	var textcolor = "#000000";
	var capcolor = "#ffffff";
	var closecolor = "#ffffff";
	function onLoad() { }
	function remBrowser() {
		if (document.Login.akey.checked)
			if (!confirm("This option will auto-login this browser\n"+
					"with your email address, everytime you access\n"+
					"this site.\n\n"+
					"Don't use this option at public Internet workstations\n"+
					"or Internet cafe's"))
				document.Login.akey.checked = false;
	}	

	function openWindowGaranzia() {
	  var url = "/html/multiservice/multiservice.htm";
	  window.open(url,'','width=567,height=420,toolbar=no,title=no,directories=no,scrollbars=yes,resizable=no');
	}
	
	function openWindowGaranziaMultiservice(tipo) {
	  var url = "pop_multiservice.html";
	  
	  if (tipo == '10') {
	  	url = "pop_multiservice_10.html";
	  }
	  else if (tipo == '11') { 
	  	url = "pop_multiservice_pc.html";
	  }
	  else if (tipo == '13') {
	  	url = "pop_multiservice_tv_maxi_1.html";
	  }
	  else if (tipo == '13_2') {
	  	url = "pop_multiservice_tv_maxi_2.html";
	  }
	  else if (tipo == '13_3') {
	  	url = "pop_multiservice_tv_maxi_3.html";
	  }
	  
	  url = "/html/multiservice/" + url;
	  
	  window.open(url,'','width=584,height=575,toolbar=no,title=no,directories=no,scrollbars=yes,resizable=no');
	}
	
	function openWindowGaranziaSafeCell() {
	  var url = "/html/safe_cell/safe_cell.htm";
	  window.open(url,'','width=550,height=413,toolbar=no,title=no,directories=no,scrollbars=no,resizable=no');
	}
	
	function pop_up_tv() {
		window.open("/html/product/installatori.html","Installatori","width=550,height=260,scrollbars=yes,resizable=no");
	}
	
	function pop_up_cond() {
	    window.open("/html/popup/nuovo_sito/popup_installatori/pop_condizionamento.htm","","width=650,height=650,scrollbars=yes,resizable=no");
     }	
	
	function toggle(){
		var elem = document.getElementById('altreImmagini');
		var display = elem.style.display;
		if( display == null || display == "none" || display == "" ){
			elem.style.display = "block";
		}else{
			elem.style.display = "none";
		}
	}
	
	function putFoto3D(title, pId){
		var nome = 'photo3D'+pId;
		var links = document.getElementById(nome);
		var url = linksFoto3D[pId];
		if(links != null && links != 'undefined' && url != null && url != 'undefined'){
			var nuovohtml = '<a href="javascript:openWinVideo(\'VideoProductView?kiave='+pId+'&amp;storeId=20000&amp;titolo='+title+'\')">Foto 3D</a>';
			links.innerHTML = nuovohtml;
		}
	}	
	
					
	function buildSlides(isNovita, grandi, productId, titolo,  imgBProduct){
		var immagini = grandi.split(',');
		var inizio = '<a rel="lightbox-'+productId+'" title="'+titolo+'" class="" href="'+imgBProduct;
		var html = "";
		if(isNovita == 'true')
			html += '<a rel="lightbox-'+productId+'" title="'+titolo+'" class="" href="'+imgBProduct+immagini[0]+'"><img id="imgNovita" alt="'+titolo+'" src="'+imgDir+'/striscia_novita.gif" style=\"border: 0px; z-index: -1; position: absolute; overflow:hidden;\"/></a>';
		for(var y = 0; y < immagini.length; y++){
			if(immagini[y] != ''){
				if(isNovita == 'false' || y>0) html += inizio + immagini[y] + '" >';
				if(y==0) html += '<img id="firstImage" class="product_firstImage" alt="'+ titolo +'" src="'+imgBProduct+immagini[y]+'" />';
				if(isNovita == 'false' || y>0) html += '</a>';
			}	
		}
		document.getElementById('product_divImage').innerHTML = html;
		Slimbox.scanPage();
	}
	
					function navLeft(isNovita) 
				{
					if (currentThumb <= 1) 
					{
						currentThumb = countThumb;
					}
					else 
					{
						currentThumb--;
					}
					
					drawThumbs(isNovita);
				}
				
				function navRight(isNovita) {
					if (currentThumb >= countThumb) 
					{
						currentThumb = 1;
					}
					else 
					{
						currentThumb++;
					}
					
					drawThumbs(isNovita);
				}

				function drawThumbs(isNovita) {
					thumb1 = document.getElementById('thumb_1');
					thumb2 = document.getElementById('thumb_2');
					thumb3 = document.getElementById('thumb_3');
					
					if (currentThumb == countThumb) 
					{
						thumb1.src = prefixImgUrl + arrThumbnails[countThumb - 1];
						thumb2.src = prefixImgUrl + arrThumbnails[0];
						thumb3.src = prefixImgUrl + arrThumbnails[1];
					}
					else if (currentThumb == countThumb - 1) 
					{
						thumb1.src = prefixImgUrl + arrThumbnails[countThumb - 2];
						thumb2.src = prefixImgUrl + arrThumbnails[countThumb - 1];
						thumb3.src = prefixImgUrl + arrThumbnails[0];
					}
					else 
					{
						thumb1.src = prefixImgUrl + arrThumbnails[currentThumb - 1];
						thumb2.src = prefixImgUrl + arrThumbnails[currentThumb];
						thumb3.src = prefixImgUrl + arrThumbnails[currentThumb + 1];
					}
					
					// thumbnails events
					thumb1.onclick = function() { show(thumb1.src, isNovita); };
					thumb2.onclick = function() { show(thumb2.src, isNovita); };
					thumb3.onclick = function() { show(thumb3.src, isNovita); };
				}
				
				
				function customImagePopup(imageUrl) {
					var fullPrefixImgUrl = document.location.protocol + '/' + serverCompraonline + prefixImgUrl;
					var thumbName = imageUrl.substring(fullPrefixImgUrl.length + 1);
					
					var sufixImgStr = new String();
					var imgStr = new String();
					var matchPosition = arrThumbnails.length;
					
					for (i = 0; i < arrThumbnails.length; i++) {
						if (thumbName == arrThumbnails[i] || matchPosition < i) 
						{
							imgStr += arrThumbnails[i] + ',';
							matchPosition = i;
						}
						else 
						{
							sufixImgStr += arrThumbnails[i] + ',';
						}
					}
					
					imgStr += sufixImgStr.substring(0, sufixImgStr.length - 1);
					return imgStr;
				}				
				
			function show( img, isNovita) {
					var firstImage = document.getElementById('firstImage');
					firstImage.src = img;
					var arr = customImagePopup(firstImage.src);
					buildSlides(isNovita, arr, productId, titolo, prefixImgUrl);
			}
			
			function alza(first, novita){
			document.getElementById(first).style.zIndex = '1';
			document.getElementById(first).style.overflow='hidden';
			if(document.getElementById(novita) != null && document.getElementById(novita) != 'undefined'){
				document.getElementById(novita).style.zIndex = '2';
				document.getElementById(novita).style.overflow='hidden';
			}	
			}
			
			function abbassa(first, novita){
			document.getElementById(first).style.zIndex = '-2';
			document.getElementById(first).style.overflow='hidden';
			if(document.getElementById(novita) != null && document.getElementById(novita) != 'undefined'){
				document.getElementById(novita).style.zIndex = '-1';
				document.getElementById(novita).style.overflow='hidden';
			}	
			}