function openOrder(url, name) {popupWin = window.open(url, name, 'scrollbars,width=580,height=630,left=50,top=50')}
function Stampa(url, name) {popupWin = window.open(url, name, 'scrollbars,width=600,height=500,left=50,top=50')}
function varitext(text){text=document ; print(text)}
function openWindow420(url, name) {popupWin = window.open(url, name, 'scrollbars,width=420,height=600,left=50,top=50')}
function opencert(url, name) {popupWin = window.open(url, name, 'scrollbars,width=580,height=565,left=50,top=50')}
function opentrasp(url, name) {popupWin = window.open(url, name, 'scrollbars,width=550,height=540,left=120,top=80')}
function openWindowhelp(url, name) {popupWin = window.open(url, name, 'scrollbars,width=350,height=400,left=50,top=50')}
function openWinNew(url, name) {popupWin = window.open(url, name, 'scrollbars,width=535,height=450,left=50,top=50')}
function openPrevCaveau(url, name) {popupWin = window.open(url, name, 'scrollbars,width=626,height=600,left=50,top=50')}
function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
  return "";
  else
  return results[1];
}
function displayInfoTable() {
expand_id = gup("expand");
if (expand_id) {
document.getElementById("serie_head_" + expand_id).style.display="";
document.getElementById("serie_link_" + expand_id).className="link act";
document.getElementById("serie_link_" + expand_id).onclick=function(){
document.getElementById("serie_head_" + expand_id).style.display="none";	
document.getElementById("serie_link_" + expand_id).className="link";            //aggiunta per riportare il link allo stato non attivo se si fa 2° click che richiude
document.getElementById("serie_link_" + expand_id).onclick="";
return false;	
}
}
}
function swapDataTable(tableId) {
row=document.getElementById("available_data").value;
var blocks=row.split(",");
var part_num=0;
while (part_num < blocks.length) {
block_id = blocks[part_num];	
document.getElementById("data_"+block_id).className="display_none";		
document.getElementById("dataSwaper_"+block_id).className="";	  
part_num+=1;
}	
document.getElementById("dataSwaper_" + tableId).className="act";
document.getElementById("data_" + tableId).className="display_block";
}  
function addEvenToUl (ul_Id) {
specUl = document.getElementById(ul_Id);
var li = specUl.getElementsByTagName("li");
even=2;
for(var i=0; i<li.length; i++) {
if (even==2) {
li[i].className="even_2";
even=0;
}
else even=2;
}
}
// trovata in internet - per imporre opzione di stampa al 100%  stampando da IE - per gli altri browser applica il comando normale
function newprint() {
var browser = navigator.appName;
if ((browser == "Microsoft Internet Explorer"))
   {
document.execCommand('print', false, null);                // set second parameter to "false" if don't want to "shrink to fit", "true" if you want to
   }
else
   {
window.print();
   }
}
// fine
var safecart;
function getCookie(NameOfCookie){
if (document.cookie.length > 0) {              
begin = document.cookie.indexOf(NameOfCookie+"=");       
if (begin != -1) {           
begin += NameOfCookie.length+1;       
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end));
} 
}
return null;
}
function setCookie(NameOfCookie, value, expiredays) {
document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; member=true; expires=" + ExpireDate.toGMTString()) + "; path=/";}
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
rnd.seed = (rnd.seed*9301+49297) % 233280; 
return rnd.seed/(233280.0);};
function rand(number) {return Math.ceil(rnd()*number);};
function setSAFEcookie(NameOfCookie) {
safecart = getCookie(NameOfCookie);
if (safecart==null) {
dt=new Date(); 
year=dt.getYear(); 
month=dt.getMonth()+1; if (month<=9) {month="0"+month};
date=dt.getDate(); if (date<=9) {date="0"+date};
hour = dt.getHours();if (hour<=9) {hour="0"+hour};
minute = dt.getMinutes();if (minute<=9) {minute="0"+minute};
second = dt.getSeconds();if (second<=9) {second="0"+second};
today = year+month+date+hour+minute+second;
safecart=today+rand(100);
setCookie(NameOfCookie,safecart,null,'/');
};
}
function delCookie(NameOfCookie) {
if (getCookie('safecart')) {
expireDate = new Date;
expireDate.setDate(expireDate.getDate()-30);
document.cookie = NameOfCookie + "=vuoto; expires=" + expireDate.toGMTString();
}
}

