//  browser checkvar bw=lib_bwcheck();function lib_bwcheck(){	this.ver=navigator.appVersion;	this.agent=navigator.userAgent;	this.dom=document.getElementById?1:0;	this.opera=this.agent.indexOf("Opera")>-1;	this.moz = (this.agent.indexOf("gecko")!= -1);	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)? 1: 0; 	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)? 1: 0;	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)? 1: 0;	this.ie4=(document.all && !this.dom && !this.opera5)? 1: 0;	this.ie=this.ie4||this.ie5||this.ie6||this.ie7;	this.mac=this.agent.indexOf("Mac")>-1;	this.ns6=(this.dom && parseInt(this.ver) >= 5)? 1: 0; 	this.ns4=(document.layers && !this.dom)? 1: 0;	this.ns=this.ns4||this.ns6;	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.moz);	return this}// others functionsfunction get_foto(path, img) { document.images[img].src = path }function Caricafoto(path,img) {get_foto( ((!path)? "" : (path.substring(0, 1) == "/" )? "file://"+path : "file:///"+path), img)}function fotoHtml (img) {var txt= '<img src="'+ img +'" border="0">'; return txt }function B_submite (form) { (form)? document.forms[form].submit() : document.forms[0].submit() }// calcola ridimensionamentofunction resizePop(w,h){		this.TTCont.css.width=w+'px';	this.TTCont.css.height=h+'px';	this.TcCont.css.width=(w==0)? '100%' : w+'px';	this.vCont.css.width=(w==0)? '100%' : (w)+'px';		this.vCont.css.height=(h==0)? '100%' : (h-60)+'px';		if (this.vScroll){			this.vCont.css.width=(w==0)? '100%' : (w-5)+'px';		this.cCont.css.width=w+'px';		this.cCont.css.height=(h-60)+'px';		this.vScroll.css.width=(w-50)+'px';		this.vScroll.css.height=h+'px';		this.vCont.css.clip='rect(0px '+ (w-5)+'px '+ (h-60)+'px 0px)';	}}// ingrandisce a tutto schermo il popUpfunction FullScreen() {	var x, y, w, h;		if (parseInt(this.TTCont.css.width)==((bw.ie)? parseInt(document.body.clientWidth) : parseInt(window.innerWidth)-15)) { 		x= this.x;		y= this.y;			w =this.Width;		h =this.Height;	} else {			this.x=parseInt(this.TTCont.css.left);		this.y=parseInt(this.TTCont.css.top);		this.Width=parseInt(this.TTCont.css.width);		this.Height=parseInt(this.TTCont.css.height);		x=0;		y=0;				if(bw.ie){			w=parseInt(document.body.clientWidth);			h=parseInt(document.body.clientHeight);		}else{			w= parseInt(window.innerWidth)-15;			h = parseInt(window.innerHeight)-15;		}		}	this.resize=resizePop;	this.TTCont.moveIt(x,y);	this.resize(w,h)}// ridimensiona il popUpfunction scroll_D() {	var w= myX - parseInt(this.TTCont.css.left) + 15 ;	var h= myY - parseInt(this.TTCont.css.top) + 15 ;		var myW=bw.ie? this.TcCont.elemento.offsetWidth : this.TcCont.elemento.scrollHeight;		w=(w>=(myW-15))? w : myW;	h=(h>60)? h : 60;		this.resize=resizePop;	if (resizeFlag) {		this.resize( w , h );		timer = setTimeout(this.obj +".Resize()",speed)	}		}function noDscroll(){ resizeFlag = false; if (timer) clearTimeout(timer);}			// objects functionsfunction Oggetto(s, nest) {return (bw.dom) ? document.getElementById(s).style :  (bw.ie4) ? eval('document.all.'+s+'.style') : (bw.ns4) ? eval(nest+'document.'+s) :  0; }function Oggettone(s, nest) { return (bw.dom) ? document.getElementById(s): (bw.ie4) ? document.all[s] : bw.ns4? eval(nest+'document.'+s)  : 0; }// pop windows Public variablevar myX , myY, objX=0, objY=0,  NomeLayer = "emptycell",  LastActWin, resizeFlag=false;var loop, timer=50, speed=50;// default tema da impostare tramite cookievar Tema;// IMAGE FAIL TO LOADfunction imgFailed(imgObj) {alert('Image [' +this.src+ '] failed to load, likely a broken link.  Skipping image.  Please contact the webmaster about this.');}// LOAD IMAGEfunction ImageLoadArray(pics,tema) {	var imgObjs = new Array(pics.length);	for (var i=0; i<pics.length; i++) {		imgObjs[i] = new Image();		imgObjs[i].onerror = imgFailed;		imgObjs[i].src = tema+pics[i];	}}// SET TEMAfunction setTema(num){	var ImageToLoad = new Array('EnlargeButton.gif','CrossButton.gif','LineButton.gif','drag.gif','sidebox-title-left.gif','sidebox-title-bg.gif','sidebox-title-right.gif','sidebox-bar-left.gif','sidebox-bar-bg.gif','sidebox-bar-right.gif','sidebox-bottom-left.gif','sidebox-bottom-bg.gif','sidebox-bottom-right.gif','space.gif');	if (num==1) Tema="themes/metallic";	if (num==2) Tema="themes/bluemetallic";	if (num==3) Tema="themes/orange";	ImageLoadArray(ImageToLoad,Tema+'/');}var space_gif=Tema + "/space.gif";// costantivar TxTHeader = function (titolo, oggetto, tipo, categorie) {var bottone1= Tema +'/EnlargeButton.gif';var bottone2= Tema +'/CrossButton.gif';var bottone3=  Tema +'/LineButton.gif';var bottoneRsx= Tema +'/drag.gif';var head_L= Tema +'/sidebox-title-left.gif';var head_Bg=  Tema +'/sidebox-title-bg.gif';var head_R=  Tema +'/sidebox-title-right.gif';var cattext=(categorie)? categorie : '';var txt= ''+'	<table border="0" cellspacing="0" cellpadding="0" class="PopUpHeader">'+'		<tr>'+'			<td align="left" valign="top" width="26" height="30"><img src="'+ head_L +'"></td>'+'			<td width="100%" background="'+ head_Bg +'" nowrap>&nbsp;'+titolo+'&nbsp;</td>'+'			<td background="'+ head_Bg +'"><img src="Themes/space.gif" alt="" height="6" width="4" border="0"></td>'+'			<td background="'+ head_Bg +'"><a href="javascript:if('+oggetto+'.vCont.css.visibility==\'hidden\')'+oggetto+'.Show('+cattext+');else '+oggetto+'.Hide('+cattext+');" title="Minimize"><img src="'+bottone3+'" width="16" border="0" alt="Minimize/Massimize"></a></td>'+'			<td background="'+ head_Bg +'"><img src="Themes/space.gif" alt="" height="6" width="4" border="0"></td>'+''+((!tipo)? '' : '			<td background="'+ head_Bg +'"><a href="javascript:'+oggetto+'.Full();"" title="Schermo Pieno"><img src="'+bottone1+'" width="16" border="0" alt="Schermo pieno"></a></td>'+'			<td background="'+ head_Bg +'"><img src="Themes/space.gif" alt="" height="6" width="4" border="0"></td>')+'			<td background="'+ head_Bg +'"><a href="javascript:'+oggetto+'.Kill('+cattext+');" title="Chiudi Finestra"><img src="'+bottone2+'"  width="16" border="0" alt="Close"></a></td>'+'			<td align="left" valign="top" width="6" height="30"><img src="'+ head_R +'"></td>'+'		</tr>'+'	</table>';return txt}var TxTBody = function(msg) {var body_L=Tema + '/sidebox-bar-left.gif';var body_Bg= Tema + '/sidebox-bar-bg.gif';var body_R= Tema + '/sidebox-bar-right.gif';var txt = ''+'	<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">'+'		<tr>'+'			<td width="1" background="'+ body_L +'"><img src="Themes/space.gif" alt="" height="6" width="4" border="0"></td>'+'			<td width="100%" height="100%" background="'+ body_Bg +'">'+ msg +'</td>'+'			<td width="1" background="'+ body_R +'"><img src="Themes/space.gif" alt="" height="6" width="4" border="0"></td>'+'		</tr>'+'	</table>';return txt}var TxTFooter = function(msg, oggetto) {var foot_L=Tema + '/sidebox-bottom-left.gif';var foot_Bg= Tema + '/sidebox-bottom-bg.gif';var foot_R=Tema + '/sidebox-bottom-right.gif';txt=''+'	<table width="100%" border="0" cellspacing="0" cellpadding="0">'+'		<tr>'+'			<td align="left" valign="top" width="1"><img src="'+ foot_L +'" border="0"></td>'+'			<td width="100%" background="'+ foot_Bg +'">'+ msg +'</td>'+'			<td align="left" valign="top" width="1"><a href="#" onmousedown="resizeFlag=true;'+ oggetto +'.Resize();" onmouseup="noDscroll();" title="ridimensionamento" style="cursor: nw-resize;"><img src="'+ foot_R +'"  border="0"  alt="resize"></a></td>'+'		</tr>'+'	</table>';return txt}// init popupfunction PopWindowInit(){	if (bw.ns) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);	document.onmouseup = EndMove;	document.onmousedown = CaptureMove;	document.onmousemove = MoveHandler;	setTema(2);}// init moving layerfunction InitializeMove(MyLayer) {	if(LastActWin) LastActWin.zIndex = 3;	LastActWin = Oggetto(MyLayer);	LastActWin.visibility = 'visible';	LastActWin.zIndex = 9000;	objX = myX - ((bw.ie4) ? parseInt(Oggetto(MyLayer).left) : parseInt(Oggettone(MyLayer).offsetLeft));	objY = myY - ((bw.ie4) ? parseInt(Oggetto(MyLayer).top) : parseInt(Oggettone(MyLayer).offsetTop));			NomeLayer = MyLayer ;}function CaptureMove(){ if (bw.ns) document.captureEvents( Event.MOUSEMOVE); }function EndMove() { 	if (bw.ns) document.releaseEvents( Event.MouseMove);	objX = 0;objY= 0;	NomeLayer = "emptycell";	noDscroll();}function MoveHandler(e) {//	if ((!bw.ie && e.which==2) || (bw.ie && event.button==2)) return;		myX = (bw.ns) ? e.pageX : event.x;	myY = (bw.ns) ? e.pageY : event.y;	if(NomeLayer != 'emptycell'){		Oggetto(NomeLayer).left = (myX-objX);		Oggetto(NomeLayer).top = (myY-objY);	}} // set visibilita'function kill() {	var argv=kill.arguments, argc=kill.arguments.length, i;   	for (i = 0; i <argc; i++) { Oggetto(argv[i]).visibility = 'hidden'; }}   	function turnOn() {	var argv=turnOn.arguments, argc=turnOn.arguments.length, i;   	for (i = 0; i <argc; i++) { Oggetto(argv[i]).visibility = 'visible'; }}// layer obj	function makeObj(obj, nest) {	nest=(nest) ? nest+'.' : '' ;	this.ns4nest = nest+'document.'+obj;	this.elemento=Oggettone(obj, nest);	this.css=Oggetto(obj, nest)		this.scrollHeight=(bw.ns4)? this.css.document.height : this.elemento.offsetHeight;	this.scrollWidth=(bw.ns4) ? this.css.document.width : this.elemento.offsetWidth;	this.clipHeight=(bw.ns4)? this.css.clip.height : this.elemento.offsetHeight;	this.clipWidth=(bw.ns4) ? this.css.clip.width: this.elemento.offsetWidth;	//	this.clipHeight= this.elemento.offsetHeight;//	this.clipWidth= this.elemento.offsetWidth;	this.Width= this.css.width;	this.Height= this.css.height;	this.x=this.css.left;	this.y=this.css.top;	this.moveIt=moveIt;	this.show =showIt;	this.Write=WriteLayer;	    	this.obj = obj + "Object";   	eval(this.obj + "=this");    return this}//function CreateDiv(id, x, y, w, h){	var str='<div id="'+ id +'" style="position: absolute; z-index: 3; top: '+ ((y)? y : 0) +'px; left: ' + ((x)? x : 0) + 'px; width:  '+ w +'px; height:  '+ h +'px;"></div>';	var str_ns4='<layer id="' + id + '" left="' + ((x)? x : 0) + '" top="' + ((y)? y : 0) + '" width="'+ ((w)? w : 0)+'" height="'+ ((h)? h : 0)+'"></layer>';	if (bw.dom) {		this.elemento = document.createElement('div');		document.getElementsByTagName('body').item(0).appendChild(this.elemento);		this.elemento.innerHTML = str;	}	if (bw.ie4) document.body.insertAdjacentHTML('beforeEnd', str );	if (bw.ns4) {		ref = new Layer(0);		ref.document.write(str_ns4);		ref.document.close();	}}function WriteLayer(contenuto){ 	if(bw.ns4){		this.elemento.open();		this.elemento.write(contenuto);		this.elemento.close();	} else this.elemento.innerHTML = contenuto}function showIt(s){ this.css.visibility=(s)? 'visible' : 'hidden' }function moveIt(x,y){	this.x = ((x)? x : 0);	this.y = ((y)? y : 0);	this.css.left = this.x+"px";	this.css.top = this.y+"px";}// popwindowfunction BuildPops( MyLayer, w) {var	testo=''+'	<table border="0" cellspacing="0" cellpadding="0">'+'		<tr><td><div id="'+ MyLayer +'Drag" onmousedown="InitializeMove(\''+ MyLayer +'\')" style="cursor: move; top: 0px; left: 0px; width: '+ ((w)? w : '100%') +'; height: 30px; visibility: visible"></div></td></tr>'+'		<tr><td valign="top"><div id="'+ MyLayer +'Text" style="width: 100%; height: 0px; visibility: visible"></div></td></tr>'+'	</table>';	return testo}function PopWin(titolo,msg, MyLayer, x,y,stili, w, h) { var obj =  new InitPopUp (titolo,msg, MyLayer, x,y,stili, w, h);  }function InitPopUp(titolo, msg, MyLayer, x, y, stili, w, h) {	this.nlay = (!MyLayer) ? 'div'+Math.round(50000*Math.random()): MyLayer ;    	this.obj = this.nlay + "Object";	this.Titolo=titolo;	this.Msg=msg;	this.Stili=stili;	this.Footer='';		this.Width=0;	this.Height=0;	this.x=0;	this.y=0;			CreateDiv(this.nlay, x, y, this.Width, this.Height);	this.TTCont = new makeObj(this.nlay, this.Width);	this.TTCont.Write(BuildPops(this.nlay));	this.TcCont = new makeObj(this.nlay+'Drag',  this.TTCont.ns4nest);		this.vCont = new makeObj(this.nlay+'Text',  this.TTCont.ns4nest);			this.TcCont.Write(TxTHeader(this.Titolo, this.obj, true));	this.vCont.Write(TxTBody(this.Msg) + TxTFooter(this.Footer,  this.obj));		this.Show =ShowPop;	this.Kill =KillPop;	this.Hide=HidePop;	this.Full=FullScreen;		this.Resize = scroll_D;	this.TTCont.moveIt(x, y);   	eval(this.obj + "=this");    return this}function HidePop(){	noScroll() 	this.vCont.Write('');	this.vCont.show(false);	this.TTCont.css.height = '30px';}function KillPop(){	this.Hide();	this.TcCont.show(false);	this.TTCont.show(false)}function ShowPop(){	this.TTCont.show(true);	this.vCont.Write(TxTBody(this.Msg) + TxTFooter(this.Footer,  this.obj));	this.vCont.show(true);}// PopZoom scrollerfunction ZoomImage(img, speed) {img.width+=speed}function ZoomScroll(foto, move){	this.fotoimg=foto;	this.resize=resizePop;		if (fotoimg.width>100 || fotoimg.heigth>100 || move>0) {		ZoomImage(foto, move);//		this.resize(fotoimg.width, fotoimg.heigth);		if (loop) timer = setTimeout("ZoomScroll(this.fotoimg,"+move+");",speed)	}}function scroll_Z(foto, speed) { loop = true; ZoomScroll(foto, speed) }function noScroll(){ loop = false; if (timer) clearTimeout(timer);}//// Pop con ZoomImage//function PopZoom(nome, foto, idprodotto, x, y, stili, w, h)  {var nFoto='Foto'+Math.round(50000*Math.random());var MyLayer='Zoom'+nFoto;var titolo=nome +'&nbsp;&nbsp;<a href="javascript://" onmouseover="if (document.images.'+ nFoto +') scroll_Z(document.images.'+ nFoto +',40);" onmouseout="noScroll();"><img src="javascripts/images/piuZoom.gif" alt="+ zoom" border="0"></a><img src="javascripts/images/zoom.gif" border="0" alt="Zoom"><a href="javascript://" onmouseover="if (document.images.'+ nFoto +') scroll_Z(document.images.'+ nFoto +',-40)" onmouseout="noScroll();"><img src="javascripts/images/menoZoom.gif" alt=" - zoom" border="0"></a>';var infoprodotto='&nbsp;<a href="index.asp?page=prodotti&productid='+ idprodotto +'" title="Info&nbsp;'+ nome +'"><img src="javascripts/images/info.gif" border="0" alt="Info&nbsp;'+nome+'"></a></b>&nbsp;';var msg='<img src="'+ foto +'" border="0" name="'+ nFoto +'">';var obj = new InitPopUp(((idprodotto)? titolo+infoprodotto : titolo), msg, MyLayer, x, y, stili, w, h);obj.Show()}//// Pop con Pagina scrolling//function BuildTscroll (MyLayer, w, h) {var	testo=''+'<div id="'+MyLayer+'Drag" onmousedown="InitializeMove(\''+MyLayer+'\')" style="	cursor: move; top: 0px; left: 0px; width: '+ w +'px; height: 30px; visibility: visible"></div>'+'<div id="'+MyLayer+'Corpo" style="position: absolute; top: 30px; left: 0px; width: '+ w +'px; height: '+(h-60)+'px; visibility: visible"></div>'+'<div id="'+MyLayer+'TextCont" style="position: absolute; top: 30px; left: 0px; width: '+( w-5)+'px; height: '+ (h-60) +'px; visibility: visible; clip: rect(0px '+ (w-5)+'px '+ (h-60)+'px 0px); overflow: auto">'+'	<div id="'+MyLayer+'Text" style="position: absolute; top: 0px; left: 5px; width: auto; height : auto; visibility: visible"></div>'+'</div>';return testo}function PopWin2(titolo, msg, MyLayer, x, y, stili, w, h)  { var obj =  new InitTscroll (titolo,msg, MyLayer, x,y,stili, w, h); obj.Show()}function InitTscroll(titolo, msg, MyLayer, x, y, stili, w, h) {	this.nlay = MyLayer+Math.round(50000*Math.random());    	this.obj = this.nlay + "Object";		this.Titolo=titolo;	this.Msg=msg	this.Stili=stili;	this.Footer='';		this.Width=0;	this.Height=0;	this.x=0;	this.y=0;			CreateDiv(this.nlay, x, y, w, h);		this.TTCont = new makeObj(this.nlay);		this.TTCont.Write(BuildTscroll (this.nlay, w, h));	this.TcCont = new makeObj(this.nlay+'Drag',  this.TTCont.ns4nest);	this.cCont = new makeObj(this.nlay+'Corpo',  this.TTCont.ns4nest);	this.vCont = new makeObj(this.nlay+'TextCont',  this.TTCont.ns4nest);	this.vScroll = new makeObj(this.nlay+'Text',  this.vCont.ns4nest);		this.TcCont.Write(TxTHeader(this.Titolo, this.obj, true));	this.cCont.Write(TxTBody('') + TxTFooter(this.Footer,  this.obj));	this.vScroll.Write(this.Msg);		this.Hide = HideTScroll;	this.Full=FullScreen;	this.Show = ShowTScroll;	this.Kill = KillTScroll;		this.Resize = scroll_D;		this.TTCont.moveIt(x, y);	   	eval(this.obj + "=this");    return this}// controlli visibilita scrolling	function HideTScroll(){	this.vScroll.show(false);	this.vCont.show(false);	this.cCont.show(false);	this.Height=this.TTCont.css.height;	this.TTCont.css.height = '30px';}function KillTScroll(){	this.Hide();	this.TcCont.show(false);	this.TTCont.show(false);}function ShowTScroll(){	this.TTCont.show(true);	if (this.Height!=0) this.TTCont.css.height = this.Height;	this.TcCont.show(true);	this.cCont.show(true);	this.vCont.show(true);	this.vScroll.show(true);}