// Esempio
// selrep('http://www.cassaforense.it','fullW','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes','100','80','true') 
function selrep(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	//window.document.frm_ute.permessi_.focus();
	var a;
	  if(window.screen)if(isCenter)if(isCenter=="true"){
	    var myLeft = (screen.width-myWidth)/2;
	    var myTop = (screen.height-myHeight)/2;
	    features+=(features!='')?',':'';
	    features+=',left='+myLeft+',top='+myTop;
	  }
	  	a=window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
		a.focus();
	}
	
function display_date() {
var months=new Array(13);
months[1]="Gennaio";
months[2]="Febbraio";
months[3]="Marzo";
months[4]="Aprile";
months[5]="Maggio";
months[6]="Giugno";
months[7]="Luglio";
months[8]="Agosto";
months[9]="Settembre";
months[10]="Ottobre";
months[11]="Novembre";
months[12]="Dicembre";
var time=new Date();
var nday=time.getDay();
if (nday==0)
  nday="Domenica";
if (nday==1)
  nday="Lunedi'";
if (nday==2)
  nday="Martedi'";
if (nday==3)
  nday="Mercoledi'";
if (nday==4)
  nday="Giovedi'";
if (nday==5)
  nday="Venerdi'";
if (nday==6)
  nday="Sabato";
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if ((navigator.appName == "Microsoft Internet Explorer") && (year < 2000))
year="19" + year;
if (navigator.appName == "Netscape")
year=1900 + year;
document.write("<b><font face=Verdana size=1 color=#003366>" + nday + " " + date + " ");
document.write(lmonth + " " + year + ".</font></b>&nbsp;&nbsp;");
}




//function NewWindow(mypage,myname,w,h,scroll){
//var win = null;
//LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
//TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
//settings =
//'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
//win = window.open(mypage,myname,settings);
//win.focus()
//}

function NewWindow(mypage,myname,w,h,scroll){
var winfull = null;
LeftPosition = 0;
TopPosition = 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable,location,menubar,toolbar'
winfull = window.open(mypage,myname,settings);
winfull.focus()
}



function NewWindowSenza(mypage,myname,w,h,scroll){
var winfull = null;
LeftPosition = 0;
TopPosition = 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable,menubar'
winfull = window.open(mypage,myname,settings);
winfull.focus()
}

function NewWindowSolo(mypage,myname,w,h,scroll,menu,resize){
var winfull = null;
LeftPosition = 0;
TopPosition = 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',menubar='+menu+',resizable='+resize+''
winfull = window.open(mypage,myname,settings);
winfull.focus()
}

function NewWindowFull(mypage,myname,w,h,scroll,menu,locat,status,resize){
var winfull = null;
LeftPosition = 0;
TopPosition = 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',menubar='+menu+',location='+locat+',status='+status+',resizable='+resize+''
winfull = window.open(mypage,myname,settings);
winfull.focus()
}

function NewWFull(mypage,myname,w,h,scroll,menu,locat,status,tool,resize){
var winfull = null;
LeftPosition = 0;
TopPosition = 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',menubar='+menu+',location='+locat+',status='+status+',toolbar='+tool+',resizable='+resize+''
winfull = window.open(mypage,myname,settings);
winfull.focus()
}

function NewPopup(mypage,myname,w,h,scroll,menu,locat,status,tool,resize,toppos,leftpos,scrx,scry){
var winfull = null;
settings =
'height='+h+',width='+w+',top='+toppos+',left='+leftpos+',scrollbars='+scroll+',menubar='+menu+',location='+locat+',status='+status+',toolbar='+tool+',screenX='+scrx+',screenY='+scry+',resizable='+resize+''
winfull = window.open(mypage,myname,settings);
winfull.focus()
}

function modelesswin(url,mwidth,mheight){
if (document.all&&window.print) //if ie5
eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogleft:0;dialogtop:0;dialogWidth:'+mwidth+'px;dialogHeight:'+mheight+'px")')
else
eval('window.open(url,"","width='+mwidth+'px,height='+mheight+'px,left=0,top=0,resizable=1,scrollbars=1")')
}

function custom_print() {
    window.print();
	/*
	if (document.all) {
        if (navigator.appVersion.indexOf("5.0") == -1) {
            var OLECMDID_PRINT = 6;
            var OLECMDEXECOPT_DONTPROMPTUSER = 2;
            var OLECMDEXECOPT_PROMPTUSER = 1;
            var WebBrowser = "<OBJECT ID=\"WebBrowser1\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>";
            document.body.insertAdjacentHTML("beforeEnd", WebBrowser);
            WebBrowser1.ExecWB(6, 2);
            WebBrowser1.outerHTML = "";
        } else {
            self.print();
        }
    } else {
        self.print();
    }*/
}

function accedi(dove) {
	if (dove == 'riservato') {
	html = 'reserved/drvisapi.dll'
	}
	else {
	html = 'cgix-ifmx/drvisapi.dll?MIval=/_Index_.html'
	}
	popup=window.open('https://195.223.117.243/' + html,"popupwin","location=no,directories=no,status=yes,resizable=no,menubar=no,scrollbars=yes,width=765,height=520,toolbar=no,marginwidth=80,marginheight=60");
	}
	
	function Reindirizza(TheForm)
	{
	var invio=true;
	/* Lo script di validazione va inserito qui.
	 * Se l'invio puo' essere eseguito la variabile "invio" diventa "true" altrimenti resta "false"
	 */
	if (invio==true)
		{
		popupwin=window.open("about:blank","popupwin","location=no,directories=no,status=yes,resizable=no,menubar=no,scrollbars=yes,width=780,height=520,toolbar=no,marginwidth=80,marginheight=60");
		//fin=window.open("about:blank","fin","width=400,height=300");
		timer=setTimeout("return true",200)
		}
		else
		{
		alert("Il form non puo' essere inviato");
		return false;
		}
	}

	//jsdir.com
function carica()
   {
   var Where = location.search.substr(1).split("&");
   if (Where.length > 1)
      {
      documento.location.href=Where[0]+".html"+"#"+Where[1];
	  //destra.location.href=Where[1]+".html";
      }
   }
   function caricaonly()
   {
   var Where = location.search.substr(1).split("&");
   if (Where.length > 1)
      {
      documento.location.href=Where[0];
	  //destra.location.href=Where[1]+".html";
      }
   }
   function caricacfm()
  {
   var Where = location.search.substr(1).split("&");
   if (Where.length > 1)
      {
      documento.location.href=Where[0]+"#"+Where[1];
	  //destra.location.href=Where[1]+".html";
      }
   }
