
function getCookieVal (offset) {  
var endstr = document.cookie.indexOf (";", offset);  
if (endstr == -1)    
endstr = document.cookie.length;  
return unescape(document.cookie.substring(offset, endstr));
}


function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}

function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}

function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}












function popupPage(URL,w,h) {
var iTop=window.screen.height/2-h/2-10;
var iLeft=window.screen.width/2-w/2-10;
var windowprops = "location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no" + ",left=" + iLeft + ",top=" + iTop + ",width=" + w + ",height=" + h;
popup = window.open(URL,"emailit2",windowprops);
popup.focus();
}

function popupPage_resize(URL,w,h) {
var iTop=window.screen.height/2-h/2-10;
var iLeft=window.screen.width/2-w/2-10;
var windowprops = "location=no,scrollbars=yes,menubars=no,toolbars=no,resizable=yes" + ",left=" + iLeft + ",top=" + iTop + ",width=" + w + ",height=" + h;
popup = window.open(URL,"emailit",windowprops);
popup.focus();
}


function apriwindow_td(pag) {
    this.name = "myWindow";
    myRemote = open(pag, "myRemote", "height=500,width=480,alwaysLowered=0,alwaysRaised=1,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=1,toolbar=0,z-lock=0");
  myRemote.focus();
}


function fullScreen(pag) {
popup = window.open(pag,"ebay");
popup.focus();
}




 function LTrim(str) {
      for (var i=0; str.charAt(i)==" "; i++);
      return str.substring(i,str.length);
 }
 function RTrim(str) {
      for (var i=str.length-1; str.charAt(i)==" "; i--);
      return str.substring(0,i+1);
 }
 function Trim(str) {
      return LTrim(RTrim(str));
 }


function exit_1(){
		   this.document.location.replace("http://www.sireon.com");
    }


function MakeArray() {
        var lngth = MakeArray.arguments.length;
        for ( i = 0 ; i<lngth ; i++ ) { this[i]=MakeArray.arguments[i] }
        }

    
function _data()
{
if (top.frames.length >1) {top.location ="/";}

var time = new Date();
var anno = time.getFullYear();
var mese = time.getMonth();
var giorno = time.getDate();

var huss= time.getTime();
var DOWArray = new MakeArray("Domenica","Luned&igrave","Marted&igrave","Mercoled&igrave","Gioved&igrave","Venerd&igrave","Sabato");   
    
var MOYArray = new MakeArray("gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"); 

var min=time.getMinutes();
if (min<10)
  min='0'+min;
document.write('<FONT  COLOR=#ffffff SIZE="1" FACE="Arial"><B>');
document.write(DOWArray[time.getDay()]);
 
document.write(' ',giorno,' ');   
document.write(MOYArray[mese],' ',anno);
document.write('</FONT></B>');
}

function stampa_pagina()
{
  var IE = (navigator.appName == "Microsoft Internet Explorer"); 
	var VERSION = parseInt(navigator.appVersion); 
	if (VERSION > 3)
  { 
    if (IE)
    {
      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);  // 6,1 = Scelta Stampante
      WebBrowser1.outerHTML = "";  
    }
    else
 	  {
      self.print();
    }
  }
 else
 {
   alert("Il tuo browser non supporta la stampa automatica. Premi FILE e poi STAMPA dal menu in alto");
  }
}


/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, thePointerColor)
{
    if (typeof(theRow.style) == 'undefined' || typeof(theRow.cells) == 'undefined') {
        return false;
    }

    var row_cells_cnt           = theRow.cells.length;
    for (var c = 0; c < row_cells_cnt; c++) {
        theRow.cells[c].bgColor = thePointerColor;
    }

    return true;
} // end of the 'setPointer()' function

