/******************************************
* DHTML Ad Box (By Matt Gabbert at http://www.nolag.com)
* Visit http://www.dynamicdrive.com/ for full script
* This notice must stay intact for use
******************************************/

chanceAd=1; // ad will be shown 1 in X times (put 1 for everytime)

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
var adDiv;

function initAd(nomeDiv){
  closeAdTutto(this.adDiv);
	if(!ns && !ie && !w3) return;
	if(ie){
	   adDiv=eval('document.all.'+nomeDiv+'.style');
  }else if(ns){
    adDiv=eval('document.layers["'+nomeDiv+'"]');
  }else if(w3){
    adDiv=eval('document.getElementById("'+nomeDiv+'").style');
  }

  if (ie||w3){
    adDiv.visibility="visible";
    adDiv.display="";
  }else{
    adDiv.visibility ="show";
  }
  showAd();
}
function showAd(numero){
	if (ie){
	 //  documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
	 //  documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;
	}else if (ns){
	   //documentWidth=window.innerWidth/2+window.pageXOffset-20;
	   //documentHeight=window.innerHeight/2+window.pageYOffset-20;
	}else if (w3){
	   //documentWidth=self.innerWidth/2+window.pageXOffset-20;
	   //documentHeight=self.innerHeight/2+window.pageYOffset-20;
	}
	adDiv.left=(screen.width/2)-165 +calunit;
	adDiv.top =100+calunit;
}
function closeAd(){
 if (ie||w3){
  adDiv.display="none";
  //adDiv.visibility="none";
 }else{
  adDiv.visibility ="hide";
 }
}
function closeAdTutto(adDiv){
  if (adDiv == undefined){
  }else{
    closeAd();
  }
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

//End-->