<!--

function cambiaImmagine(origine,cambiaDa,cambiaA){
  if(cambiaDa==undefined){
		cambiaDa = "min";
	}
	if(cambiaA==undefined){
		cambiaA = "max";
	}
	var orig =  document.getElementById(origine);
	var origAlt = orig.alt
	var origTitle = orig.title
	var newOrig = orig.src.replace('/'+ cambiaDa +'/','/'+ cambiaA +'/')
	var dest = document.getElementById("Dett_image");
	var oldDest = dest.src.replace('/'+ cambiaA +'/','/'+ cambiaDa +'/')
	
	var oldAlt = dest.alt
	var oldTitle = dest.title
	dest.src = newOrig;
	dest.alt = origAlt;
	dest.title = origTitle;
	orig.src = oldDest;
	orig.alt = oldAlt;
	orig.title = oldTitle;

	//var elem = document.getElementsByClassName('image')
	//for (i=0;i<elem.length;i++){
	//	if (elem[i].id==id){
	//		elem[i].style.background='url(css/img/bgimgsel.gif)';
	//	}else{
	//		elem[i].style.background='url(css/img/bgimg.gif)';
	//	}
	//}
}

function RichiediInformazioni(qualeDiv,ilForm,qualePagina){
	$(qualeDiv).innerHTML = '<div style="padding-top:6px;padding-bottom:3px;margin:auto;text-align:center;"><img src="/css/img/indicator.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	$(qualeDiv).show();
	new Ajax.Updater(qualeDiv, qualePagina , {
														asynchronous:true,
														evalScripts:true,
														/*-encoding:'UTF-8',*/
														parameters:Form.serialize(ilForm)
														}
					);
	return false;
}

function loadhref(qualeDiv,qualePagina){
	//$(qualeDiv).hide();
	new Ajax.Updater(qualeDiv, qualePagina ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8',
							onComplete:function(){
														new Effect.Appear(qualeDiv,{duration:0.4,from:0,to:1.0})
							}
						}
					);
}

function cambiaimg(idPhoto){
	var orig = $('imgTwilight'+idPhoto);
	var newOrig = orig.src.replace('/'+ idPhoto,'/'+ idPhoto +'_s')
	orig.src = newOrig;
}

function settaimg(idPhoto){
	var orig = $('imgTwilight'+idPhoto);
	var newOrig = orig.src.replace('/'+ idPhoto +'_s','/'+ idPhoto )
	orig.src = newOrig;
}

function InsCarrello(idArt,tipoadd,link){
	$('boxcarrello').innerHTML = '<div style="padding-top:6px;padding-bottom:3px;margin:auto;text-align:center;"><img src="/css/img/indicator.gif" alt="" width="16" height="16" border="0" align="absmiddle"></div>';
	$('boxcarrello').show();
	if(tipoadd==undefined){
		addlink = "&add=ok";
	} else {
		if (tipoadd==0) {
			addlink = "&add=ok";
		} else {
			addlink = "&add=ko";
		}
	}
	if(link!=undefined){
		addpage = "&linkpage=ok";
	} else {
		addpage = "&linkpage=ko";
	}
	new Ajax.Updater('boxcarrello', '/_inc/carrello.asp?id='+idArt + addlink + addpage  ,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8'
						}
					);
}

function updateCarrello(num){
	$('boxcarrello').show();
	new Ajax.Updater('boxcarrello', '/_inc/dettcarrello.asp',
		{
			asynchronous:true,
			evalScripts:true,
			encoding:'UTF-8'
		}
	);
	if (num==1) {
		//new Ajax.Updater('listacarrello', '/_inc/listacart.asp' ,
		//				{
		//					asynchronous:true,
		//					evalScripts:true,
		//					encoding:'UTF-8'
		//				}
		//			);
		document.location.href='/cart.asp';
	};
}

function delArt(id,testoConferma){
	if(confirm(testoConferma)){
		new Ajax.Updater('boxcarrello', '/_inc/delcarrello.asp?id='+id,
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8'
						}
					);
	}
}
function delCarrello(testoConferma){
	if(confirm(testoConferma)){
		new Ajax.Updater('boxcarrello', '/_inc/delcarrello.asp',
						{
							asynchronous:true,
							evalScripts:true,
							encoding:'UTF-8'
						}
					);
	}
}

function confCarrello(){
	Shadowbox.init();
	setTimeout(function() {
		Shadowbox.open({player: "iframe", title: "", content: "/_inc/confcarrello.asp", height: 500, width: 650});
	 },300)
}

function startStopTimer(stop){
	var oggetto = document.getElementById('imgStr');
	if (stop==0){
		oggetto.style.background = "url(/css/img/bgplay.png) no-repeat";
		oggetto.innerHTML ="<a href='#' onClick='my_glider.start();startStopTimer(1);' style='display:block;height:13px;width:15px;text-decoration:none;'>&nbsp;</a>";
	}else{
		oggetto.style.background = "url(/css/img/bgpause.png) no-repeat";
		oggetto.innerHTML ="<a href='#' onClick='my_glider.stop();startStopTimer(0);' style='display:block;height:13px;width:15px;text-decoration:none;'>&nbsp;</a>";
	}
}

//-->

