function leggiMenu(URL){
	if (URL != "" ){
		location.href=URL;
	} else 	location.href="index.php";
}

function leggiMenu1(pluto){
	var URL=pluto;
	location.href=URL;
}

function MM_preloadImages() { 
	var d=document; 
	
	if(d.images){ 
		
		if(!d.MM_p) 
			d.MM_p=new Array();
	
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	
		if (a[i].indexOf("#")!=0){ 
			d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
		}
	
	}
}

function MM_swapImgRestore() { 
	var i,x,a=document.MM_sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
		x.src=x.oSrc;
}

function MM_findObj(n, d) { 
	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 MM_swapImage() { 
	var i,j=0,x,a=MM_swapImage.arguments; 
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
		
		if ((x=MM_findObj(a[i]))!=null){
			document.MM_sr[j++]=x; 
			
			if(!x.oSrc) 
				x.oSrc=x.src; 
			
			x.src=a[i+2];
		}
}

function MM_jumpMenu(targ,selObj,restore){ 
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) 
		selObj.selectedIndex=0;
}


function url(x) {   
	if (x==0) return "http://search.yahoo.com/bin/search?p="
	if (x==1) return "http://www2.infoseek.com/Titles?qt="
	if (x==2) return "http://www.altavista.digital.com/cgi-bin/query?q="
	if (x==3) return "http://www-msn.lycos.com/cgi-bin/pursuit?query="
	if (x==4) return "http://www.excite.com/search.gw?searchType=Concept;category=default;mode=relevance;showqbe=1;display=msn,hb;search="
	if (x==5) return "http://magellan.mckinley.com:8080/mckinley-cgi/iopcode.pl?query="
	if (x==6) return "http://webfind.home.msn.com/cgi-bin/fts.dll?qu="
	return "" 
}

function vaiURL(q,w) {  
	window.location.href=url(q)+w
	return 0;
}



/******************************************************************
*                                                                 *
*                                                                 *
*                                                                 *
*******************************************************************/



var pageid=Math.floor(Math.random() * 19031982)
function makeAD(sito, tags, dimw, dimh){
	var now = new Date()
	var magic=now.getTime()
	document.write('<sc'+'ript language="JavaScript1.2" src="'+sito+'/jserver' + tags + '/ACC_RANDOM='+magic+'/PAGEID='+pageid+'"></sc'+'ript>');
}

function open_gallery(gallery){
	gal=window.open(gallery,'Galleria_Fototgrafica','scrollbars=no, toolbar=no,location=no,directories=no,status=no,menubar=no,width=500,height=500');
}


function open_poptesto(poptesto){
	gal=window.open(poptesto,'poptesto','scrollbars=yes, toolbar=no,location=no,directories=no,status=no,menubar=no,width=300,height=300');
}


function open_video(video){
	gal=window.open(video,'video','scrollbars=no, toolbar=no,location=no,directories=no,status=no,menubar=no,width=380,height=440');
}

function open_poptesto2(poptesto2){
	gal=window.open(video,'video','scrollbars=no, toolbar=no,location=no,directories=no,status=no,menubar=no,width=380,height=440');
}


/******************************************************************
*                                                                 *
* 							Send Page                             *
*                                                                 *
*******************************************************************/

function send_page(){
	var dest = window.document.location; 
	window.open("http://procedure.tiscali.it/sendpage/europa.php?destinazione=" + dest, "", 'toolbar=no,resizable=no,directories=no,location=no,menubar=no,scrollbars=no ,width=498,height=498')
}


/******************************************************************
*                                                                 *
* 							Print Page                            *
*                                                                 *
*******************************************************************/

function printPage(VALUE){
	paginastampa=window.open(VALUE, 'Stampa', 'height=400,width=466,menubar=yes,resizable=no,scrollbars=yes, toolbar=no'); 
}

var newwin
function photo1(pic,largh,alte){
	newwin = window.open(pic,"titolo", 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,status=no,width=' +largh+ ',height='+alte+',top=0,left=0');
}


function IeCheck(){
	var agt=navigator.userAgent.toLowerCase();
	var nIE =(agt.indexOf("msie") != -1);
	return nIE;
}



function WinCheck(){
	var agt=navigator.userAgent.toLowerCase();
	var nWin = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	return nWin;
}


var tiscali_browser;

function fnInit(){
	if(IeCheck()&&WinCheck()){
		tiscali_browser = window.external.tiscalibrowser;
		
		if( tiscali_browser == "it" ) {
			document.write('<style type=text/css>.TisHeader{display : none;}</style>');
		}
	}
}

fnInit();


/******************************************************************
*                                                                 *
* 				gestione paginazione articoli					  *	
*				in file "rubrica_articoli.php"                    *
*                                                                 *
*******************************************************************/


function rubrica_articoli_first(){
	document.form.action = 'rubrica_articoli.php?flag=first';
	document.form.submit();					
}	

function rubrica_articoli_last(){
	document.form.action = 'rubrica_articoli.php?flag=last';
	document.form.submit();					
}	

function rubrica_articoli_succ(){
	document.form.action = 'rubrica_articoli.php?flag=succ';
	document.form.submit();					
}	

function rubrica_articoli_prec(){
			document.form.action = 'rubrica_articoli.php?flag=prec';
			document.form.submit();					
}


/******************************************************************
*                                                                 *
* 				gestione paginazione articoli					  *	
*				in file "g-tutti.php"                             *
*                                                                 *
*******************************************************************/

function g_tutti_first(){
	document.form.action = 'g-tutti.php?flag=first';
	document.form.submit();					
}	

function g_tutti_last(){
			document.form.action = 'g-tutti.php?flag=last';
			document.form.submit();					
}	

function g_tutti_succ(){
			document.form.action = 'g-tutti.php?flag=succ';
			document.form.submit();					
}	

function g_tutti_prec(){
			document.form.action = 'g-tutti.php?flag=prec';
			document.form.submit();					
}