function Trim(s){
   // Remove leading spaces and carriage returns
   while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')){
      s = s.substring(1,s.length);
   }

   // Remove trailing spaces and carriage returns

   while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')){
      s = s.substring(0,s.length-1);
   }
   return s;
}

function popupPrivacy(file){
  var l = Math.floor((screen.width-300)/2);
  var t = Math.floor((screen.height-450)/2);
  var prop = "top=0, left=0";
  window.open(file, null, 'width=400,height=300,top='+ t +', left='+ l);
}

function setCookieForHead(){
    var path="/";
    var today = new Date();
    var expires = new Date();
    
    expires.setTime(today.getTime() + (7200000));
    avviso = "showhead=no" + "; expires=" + expires.toGMTString() + "; path=" + path;
    document.cookie = avviso;
}

function JsGetCookie(cookieName) {
 var theCookie=document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}




