function showDiv(idtoshow,idtohide)
	{
		if( document.getElementById )
			{
				if( document.getElementById(idtoshow).style.display)
					{
						document.getElementById(idtoshow).style.display = "block";
					} 
				if( document.getElementById(idtohide).style.display)
					{
						document.getElementById(idtohide).style.display = "none";
					} 
			}
	}
	
function showhideDiv(idtoshow)
	{
		if( document.getElementById )
			{
				if( document.getElementById(idtoshow).style.display)
					{
						if (document.getElementById(idtoshow).style.display=='block')
							{
								document.getElementById(idtoshow).style.display = "none";
							} 
						else
							{
								document.getElementById(idtoshow).style.display = "block";
							}
					}
			}
	}
	

/**
 *  
 * @FileName: funzioni.js
 * @Original Author:
 * @Created: 11/15/2005
 * $LastChangedDate: 2006-04-07 18:05:42 +0200 (Fri, 07 Apr 2006) $
 * $LastChangedRevision: 3201 $
 * $LastChangedBy: andrea $
*/


//HELP
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
	
function showHelp() { //v6.0
  var i,p,v,obj,args=showHelp.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
	objHelp = document.getElementById('help');
	if(objHelp.style.visibility == 'hidden'){
		typeVis = 'visible';
	} else {
		typeVis = 'hidden';
	}
	
	visSelect(typeVis);
		
	
}	
function visSelect(type) {		
	objDivTO = document.getElementById('divto');
	objDivoff = document.getElementById('property2');
	objDivpasso = document.getElementById('numberPagina');
	
	if (objDivTO) {
		objDivTO.style.visibility = type;
	}
	if (objDivoff) {
		objDivoff.style.visibility = type;
	}
	if (objDivpasso) {
		objDivpasso.style.visibility = type;
	}
}

function apriWait(tipo, w, h) {
	
	uagent = window.navigator.userAgent.toLowerCase();
	IE = false;

	if (uagent.indexOf('msie 6.0') != -1) {
		IE = true;
	}

	if (IE) {
		TopPosition 	= document.body.clientHeight; 
	    LeftPosition 	= document.body.clientWidth; 		
	} else {
		TopPosition 	= window.innerHeight; 
	    LeftPosition 	= window.innerWidth; 
	}
	
	if(tipo == 'TO') {
		objDivWait	= document.getElementById("divWTO");
	} else {
		objDivWait	= document.getElementById("divW");
	}	
	
	if(objDivWait) {
		objDivWait.style.top 	= '200px'; 
		//objDivWait.style.left 	= ((LeftPosition) 	? (LeftPosition	- w)/2 : 0)  +'px';
		objDivWait.style.left 	= '250px';
		objDivWait.style.visibility = 'visible';
	}	
}
function openPopup(paramlink) {
	NewWindow(paramlink, 'PopUp', 500,400, 'yes', 'yes');
}	

function locationOpener(paramlink) {
	window.opener.location.href = paramlink;
	window.close();
}				

function NewWindow(mypage,myname,w,h,scroll,resize,toolbar){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	if(toolbar == ''){
		toolbar = 'No';
	}	
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable='+resize+', toolbar='+toolbar
	finestra = window.open(mypage,myname,settings);
	finestra.focus();
}
function closePupUp() {
	finestra.close();
}

var finestra = window.document;
//window.document.body.onunload = function (){closePupUp();};	


//************ Settaggi per il popUp dell'immagine ***************************
PositionX = 200
PositionY = 200;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
var imgWin = window.open('','_blank','scrollbars=no,resizable=1 ,width='+defaultWidth+',height='+defaultHeight+',l eft='+PositionX+',top='+PositionY);
if( !imgWin ) { return true; } //popup blockers should not cause errors
imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n'+
'function resizeWinTo() {\n'+
'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+
'var oH = document.images[0].height, oW = document.images[0].width;\n'+
'if( !oH || window.doneAlready ) { return; }\n'+ //in case images are disabled
'window.doneAlready = true;\n'+ //for Safari and Opera
'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }\n'+
'}\n'+
'<\/script>'+
'<\/head><body onload="resizeWinTo();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
(document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;display: table;">'))+
'<img src=\''+imageURL+'\' alt="Loading image ..." title="" onload="resizeWinTo();">'+
(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
imgWin.document.close();
}
	


