var dsi=16;

function popup1() {
var obj = document.getElementById('popup');
var testo = obj.innerHTML;

// CREO L'OGGETTO POPUP
var popup = window.createPopup();
var contenuto = popup.document.body;

// IMPOSTO GLI STILI CSS
contenuto.style.backgroundColor = "#EEEEEE";
contenuto.style.padding = "10";
contenuto.style.border = "Solid #CCCCCC 1px";

// SCRIVO ALL'INTERNO DEL POPUP
//contenuto.innerHTML = testo;
contenuto.document.write(testo);

// MOSTRO IL POPUP
popup.show(300, 150, 450, 500, document.body);

return false;
}

function clicker(){
	var thediv=document.getElementById('displaybox');
	var testo = thediv.innerHTML;
	if(thediv.style.display == "none"){
		thediv.style.display = "";
		thediv.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='top' width='100%' height='100%'>" + testo + "<br><br><br><br><a href='#' onclick='return clicker();'><img src='X.gif' style='vertical-align:middle' border='0'>&nbsp;CHIUDI</a><br><br><br><br><br><br></td></tr></table>";
	}else{
		thediv.style.display = "none";
		thediv.innerHTML = '';
	}
	return false;
}

function setVariables(){
	if (navigator.appName == "Netscape") {
		v=".top=";
		dS="document.";
		sD="";
		y="window.pageYOffset" }
	else {
		v=".pixelTop=";
		dS="";
		sD=".style";
		y="document.body.scrollTop"
	}
}

function checkLocation() {
	object="object1";
	yy=eval(y);
	eval(dS+object+sD+v+yy);
	setTimeout("checkLocation()",10)
}

function openWinPrt(win, w, h) {
	var le = (screen.availWidth - w) /2;
	var he = ((screen.availHeight -h) /2) + 20;
	window.open(win,null,"height="+h+",width="+w+",status=yes,toolbar=yes,scrollbars=yes,resizable=yes,menubar=yes,location=no,left="+le+", top="+he,false);
}

function openWin(win, w, h) {
	var le = (screen.availWidth - w) /2;
	var he = ((screen.availHeight -h) /2) + 20;
	window.open(win,null,"height="+h+",width="+w+",status=no,toolbar=no,scrollbars=yes,resizable=yes,menubar=no,location=no,left="+le+", top="+he,false);
}

function err(descr) {
	alert(descr);
	return false;
}

function funTime(p) {
	if (p == "grow") {
		dsi++;
} else {
	if (dsi>14)
		dsi--;
}
document.getElementById('hey').style.fontSize=dsi;
}

function evidenzia() {
	document.getElementById('indx').style.backgroundColor="#888888";
}

    var myWidth = 0, myHeight = 0;

    function doActiveTab(WWork) {

      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
    
      if(navigator.userAgent.indexOf("Firefox")!=-1){
        posx = (myWidth-WWork-20)/2;
        }

      if (navigator.appVersion.indexOf("MSIE")!=-1){
        posx = (myWidth-WWork)/2;
        }
        
        if(document.getElementById) {
        document.getElementById('Certip').style.left = posx;
        }
        else if(document.all) {
        document.all.Certip.style.left = posx;
        }
        else if(document.layers) {
        document.Certip.left = posx;
        }
	} 

    function setActiveTab(WWork) {

      if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
      } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
      } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
      }
      
      if(navigator.userAgent.indexOf("Firefox")!=-1){
        posx = (myWidth-WWork-20)/2;
        }

      if (navigator.appVersion.indexOf("MSIE")!=-1){
        posx = (myWidth-WWork)/2;
        }
        
        if(document.getElementById) {
        document.getElementById('Certip').style.left = posx;
        }
        else if(document.all) {
        document.all.Certip.style.left = posx;
        }
        else if(document.layers) {
        document.Certip.left = posx;
        }
    }

  function init(WWork) {
   window.onload = function() {
    doActiveTab(WWork);
    }
   window.onresize = function() {
    setActiveTab(WWork);
    }
  }

  function trasf(Href, tp) {
	  var myWidth = 0
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;
	  }
	  //window.location="master/index.asp?FRFX=1&Wscreen=" + myWidth;
	  if (tp == '1') {
	  	//alert(Href + "&Wscreen=" + myWidth);
	  	window.location=Href + "&Wscreen=" + myWidth;
	  } else {
	  	window.location=Href;
	  	//alert(Href);
	  }
  }
