<!--
var loc = String(self.location)
var offset = loc.indexOf("/",7)                        // salta http:...
var cssdir = loc.substring(0, offset + 1) + "css/"     // dir css sotto root
if ((navigator.userAgent.indexOf("Mac") != -1))
            document.write("<link rel=\"stylesheet\" href=\"" + cssdir + "mac_ie.css\">")
if ((navigator.userAgent.indexOf("Linux") != -1))
            document.write("<link rel=\"stylesheet\" href=\"" + cssdir + "linux.css\">")
if (navigator.userAgent.indexOf("Win") != -1){
            if (navigator.appName.indexOf("Netscape") != -1) {
                document.write("<link rel=\"stylesheet\" href=\"" + cssdir + "pc.css\">")
                }
                else {
                    document.write("<link rel=\"stylesheet\" href=\"" + cssdir + "pc_ie.css\">")
                }
            }


ns4 = (document.layers)? 1:0
ie4 = (document.all)? 1:0
ie5 = (navigator.appVersion.indexOf("MSIE 5")>0)? 1:0

function WM_netscapeCssFix() {
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function Smail() { //v2.0
  var myWin=window.open("/contatti.html","Mail","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=350,top=0,left=0");
  myWin.focus()
}

function Ssms() { //v2.0
  var myWin=window.open("/sms/servizi.asp","Sms","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=400");
  myWin.focus()
}

function Sunicitta() { //v2.0
  var myWin=window.open("http://www.unita.it/unicitta/uni_scrivi.asp","Unicitta","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=630,height=390");
  myWin.focus()
}

function itDante(){
  messa = ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"]
  var today = new Date()
  var anno=today.getYear()
  if (navigator.appName.indexOf("Netscape") != -1) {
  	anno=1900+anno
  }
  return (String(today.getDate())+"  "+messa[today.getMonth()]+"  "+String(anno))
        }
function itVirgilio(){
  giorno = ["Domenica","Lunedi", "Martedi", "Mercoledi", "Giovedi", "Venerdi", "Sabato"]
  var today = new Date()
  return (giorno[today.getDay()])
}

function script_poll(tipo,sezione_cod){
  if (tipo=="result"){
 	URL="m_bin/m_pollres.asp?sezione_cod="+ sezione_cod;
	var myWin=window.open(URL,"sondaggio","toolbar=no,scrollbars=no,resizable=no,width=450,height=450");
	myWin.focus();
	}

  if (tipo=="history"){
	URL='m_bin/m_pollhist.asp?sezione_cod='+ sezione_cod
	var myWin=window.open(URL,"sondaggio","toolbar=no,scrollbars=no,resizable=no,width=450,height=330")
	myWin.focus()
	}

  if (tipo=="vote"){
	 c=99
	 v=0
	 for (var i = 0; i < document.SONDAGGIO.R1.length; i++) {
	  if (document.SONDAGGIO.R1[i].checked) {
	      c=c+1;
	      v=document.SONDAGGIO.R1[i].value;
	    }
	  }

	 if (c==99)
	   {
	   alert ("ATTENZIONE!! Effettuare una scelta")
	   return 22
	   }

	 URL='m_bin/m_pollres.asp?R1='+v+"&action=vote&sezione_cod="+sezione_cod
	 var myWin=window.open(URL,"sondaggio","toolbar=no,scrollbars=no,resizable=no,width=450,height=350")

	 myWin.focus()
	return true
  }
}
function rossa(theURL,winName,features) { //v2.0
  var w;
  var h;
  var str;
  var inizio;
  var str;
  inizio = features.indexOf("width=") + 6;
  fine = features.indexOf(",",inizio);
  if (fine != -1) {
     str = features.substring(inizio,fine);
    } else {
     str = features.substring(inizio);
     }
  w = parseFloat(str)
  inizio = features.indexOf("height=") + 7;
  fine = features.indexOf(",",inizio);
  if (fine != -1) {
     str = features.substring(inizio,fine);
    } else {
     str = features.substring(inizio);
     }
  h = parseFloat(str)

  PosX = (screen.width - w) / 2;
  PosY = (screen.height - h) / 2;

  window.open(theURL,winName,features + ",left=" + PosX + ",top=" +
PosY+",screenX=" + PosX +",screenY=" + PosY);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_preloadImages() { //v3.0
  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() { //v3.0
  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) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  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];}
}

var fin;

function apri(theURL,winName,features)
{
	if (fin != null)
	{
		if (!fin.closed)
		{
		 fin.close();
		 fin=null;

		 fin=window.open(theURL,winName,features);
		 fin.focus();
		}
	 	else
		{
		 fin=window.open(theURL,winName,features);
		 fin.focus();
		}
	}
	else
	{
	 fin=window.open(theURL,winName,features);
	 fin.focus();
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

  function rempwd() {
    popupWin = window.open("/forum/rempwd.asp","RPW","width=290,height=340")
}
 function openWindow2(url) {
  popupWin = window.open(url,'new_page','width=400,height=450')
}

function MM_validateForm() { //v3.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' deve contenere un indirizzo e-mail valido.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (val!=''+num) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' è obbligatorio.\n'; }
  } if (errors) alert('Attenzione:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function caratteriale(cur){
var maxlength=1500
if (cur.recensione.value.length>maxlength){
alert("Hai inserito " + cur.recensione.value.length + " caratteri.La lunghezza massima è di 1500 caratteri!")
return false
}
}
// -->
