//  browser checkvar bw=lib_bwcheck();function lib_bwcheck(){	this.ver=navigator.appVersion;	this.agent=navigator.userAgent;	this.dom=document.getElementById?1:0;	this.opera5=this.agent.indexOf("Opera 5")>-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.ie4=(document.all && !this.dom && !this.opera5)? 1: 0;	this.ie=this.ie4||this.ie5||this.ie6;	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}// functionsfunction CambiaColoriHtml(txt) {var indice = txt.indexOf("#");	while (indice !=-1)  {		txt= txt.substring(0,indice)+ "^$" + txt.substring(indice+1, txt.length)		indice = txt.indexOf("#");			}	return txt}function Caricafoto(s,img) {  if (s.substring(0, 1) == "/" ) { document.images[img].src="file://"+s }	else { if (s!="") document.images[img].src="file:///"+s; 	}}function get_foto(newUrl, img) { imgSwap('../photo/'+newUrl, img) }function fotoHtml (foto) {var txt= '<img src="'+foto+'" border="0">'; return txt }function B_submite (formName) { (formName)? document.forms[formName].submit() : document.forms[0].submit() }function open_Win(newUrl,w,h,s) { window.open(newUrl,'_blank','toolbar=no,status=no,scrollbars=no,resizable='+((s)? "yes" : "no" )+',width='+w+',height='+h) }function imgSwap(newUrl, img) { document.images[img].src = newUrl }function ZoomImage(img, speed) {img.width+=speed}// inizializzazione POPWindow// Titlebar text and border color and size  (value 0,1,2,3)var TollbarColorTxt = '#000000' var TollbarBgcolor = '#c0c0c0'var TollbarBorder ="1";var bottone1= 'javascripts/images/SquareButton.gif';var bottone2= 'javascripts/images/CrossButton.gif';// inizialize popwindowfunction PopWindowInit(){	bw = new lib_bwcheck();	if (bw.ns) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);		document.onmouseup = EndMove;	document.onmousedown = CaptureMove;	document.onmousemove = MoveHandler;}// init movingfunction InitializeMove(MyLayer) {		var x,y;		GetOver(MyLayer);		if (bw.ie4) {			x = parseInt(Oggetto(MyLayer).left);			y = parseInt(Oggetto(MyLayer).top);		} else {			x = parseInt(Oggettone(MyLayer).offsetLeft);			y = parseInt(Oggettone(MyLayer).offsetTop);		}				objX = myX - x;		objY = myY - y;		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";	document.close(); }// flayers pop windows public variablevar myX , myY, objX=0, objY=0,  NomeLayer = "emptycell",  LastActWin;// write in  layerfunction WriteLayer(contenuto){ this.elemento.innerHTML = contenuto }function Oggetto(s) { return  (bw.ie4) ? eval('document.all.'+s+'.style') : (bw.dom) ? document.getElementById(s).style : 0;  }function Oggettone(s) { return  (bw.ie4) ? document.all[s] : (bw.dom) ? document.getElementById(s) : 0;  }// set visibilita'function kill() {	var argv=kill.arguments, argc=kill.arguments.length, i;   	for (i = 0; i <argc; i++) { skn = Oggetto(argv[i]).visibility = 'hidden'; }}   	function turnOn() {	var argv=turnOn.arguments, argc=turnOn.arguments.length, i;   	for (i = 0; i <argc; i++) { skn = Oggetto(argv[i]).visibility = 'visible'; }}// over control function GetOver(MyLayer) {  		 	if(LastActWin) LastActWin.zIndex = 3;		LastActWin = Oggetto(MyLayer);		LastActWin.zIndex = 9;}// moving controlfunction WhileMove(MyLayer) {	if(MyLayer != 'emptycell') {		var x=(myX-objX), y= (myY-objY);		MyLayer = Oggetto(MyLayer);		MyLayer.left = x;		MyLayer.top  = y;	}}function MoveHandler(e) {	if ((bw.ns && e.which==2) || (bw.ie && event.button==2)) return true;	myX = (bw.ns) ? e.pageX : event.x;	myY = (bw.ns) ? e.pageY : event.y;	WhileMove(NomeLayer)}// popwindowfunction pop(titolo, msg, bgcolor, MyLayer, status, x, y)  {	this.elemento=(bw.dom) ? document.getElementById(MyLayer): (bw.ie4) ? document.all[MyLayer] : 0;	this.CSS=(bw.dom) ? document.getElementById(MyLayer).style: (bw.ie4) ? document.all[MyLayer].style : 0;var testowin='<table><tr><td>'+'				<table bgcolor="'+TollbarBgcolor+'" border="'+TollbarBorder+'" cellpadding="0" cellspacing="0"><tr><td><table><tr>'+'					<td valign="middle" align="left" width="100%" height="16"><b>'+titolo+'</b></td>'+'					<td valign="middle" align="center" width="16" height="16"><a href="javascript://" onmousedown="kill(\''+MyLayer+'\' )" title="Chiudi Finestra"><img src="'+bottone2+'" border="0"  alt="Chiudi"></a></td>'+'				</tr></table></td></tr><tr><td bgcolor="'+bgcolor+'">'+eval(msg)+'</td></tr></table>'				var testomac='<table><tr><td>'+'				<table bgcolor="'+TollbarBgcolor+'" border="'+TollbarBorder+'" cellpadding="0" cellspacing="0"><tr><td><table><tr>'+'						<td valign="middle" align="left" width="16" height="16" nowrap><a href="javascript://" onmousedown="kill(\''+MyLayer+'\')" title="Chiudi Finestra"><img src="'+bottone1+'" border="0" alt="Chiudi"></a></td>'+'						<td valign="middle" align="center" width="95%" height="16" nowrap><b>'+titolo+'<b></td>'+'				</tr></table></td></tr><tr><td bgcolor="'+bgcolor+'">'+eval(msg)+'</td></tr></table>'	this.elemento.innerHTML =  (bw.mac) ? testomac : testowin;	if (x && y) {		this.CSS.left=x;		this.CSS.top=y;	}	this.CSS.visibility = 'visible';	GetOver(MyLayer);}// popwindow2function popZoom(titolo, msg, bgcolor, MyLayer, x, y)  {	this.elemento=(bw.dom) ? document.getElementById(MyLayer): (bw.ie4) ? document.all[MyLayer] : 0;	this.CSS=(bw.dom) ? document.getElementById(MyLayer).style: (bw.ie4) ? document.all[MyLayer].style : 0;	var testowin='<table><tr><td valign="middle" align="left" height="20">&nbsp;</td></tr>'+'			<tr><td bgcolor="'+bgcolor+'">'+eval(msg)+'</td></tr></table>'+'<div id="'+MyLayer+'Drag" style="background-color: '+TollbarBgcolor+'; position: absolute; z-index: 2; top: 3px; left: 3px; width: auto; height: 10px; visibility: visible">'+'	<table bgcolor="'+TollbarBgcolor+'" border="'+TollbarBorder+'" cellpadding="0" cellspacing="0"><tr>'+'		<td valign="middle" align="left" height="20" nowrap>&nbsp;&nbsp;<b>'+titolo+'&nbsp;</b></td>'+'		<td valign="middle" align="center" width="16" height="20"><a href="javascript://" onmousedown="kill(\''+MyLayer+'\',\''+MyLayer+'Drag\' )" title="Chiudi Finestra"><img src="'+bottone2+'" border="0" height="16"></a></td>'+'</tr></table></div>';var testomac='<table><tr><td valign="middle" align="left" height="20">&nbsp;</td></tr>'+'			<tr><td bgcolor="'+bgcolor+'">'+eval(msg)+'</td></tr></table>'+'<div id="'+MyLayer+'Drag" style="background-color: '+TollbarBgcolor+'; position: absolute; z-index: 2; top: 3px; left: 3px; width: auto; height: 10px; visibility: visible">'+'	<table bgcolor="'+TollbarBgcolor+'" border="'+TollbarBorder+'" cellpadding="0" cellspacing="0"><tr>'+'		<td valign="middle" align="center" width="16" height="20"><a href="javascript://" onmousedown="kill(\''+MyLayer+'\',\''+MyLayer+'Drag\'  )" title="Chiudi Finestra"><img src="'+bottone1+'" border="0" height="16"></a></td>'+'		<td valign="middle" align="left" height="20" nowrap>&nbsp;&nbsp;<b>'+titolo+'&nbsp;</b></td>'+'</tr></table></div>';			this.elemento.innerHTML =  (bw.mac) ? testomac : testowin;	if (x && y) {		this.CSS.left=x;		this.CSS.top=y;	}	this.CSS.visibility = 'visible';	GetOver(MyLayer);}
