//
// Time in seconds until the ads come back
// (default 24 hours):
//
var timeout=2*60*60;
//var timeout=1;

// Do not change anything in the code below:
var showads = 1;

var screenW = 800, screenH = 600;
if (parseInt(navigator.appVersion)>3) {
 screenW = screen.width;
 screenH = screen.height;
}
else if (navigator.appName == "Netscape" 
    && parseInt(navigator.appVersion)==3
    && navigator.javaEnabled()
   ) 
{
 var jToolkit = java.awt.Toolkit.getDefaultToolkit();
 var jScreenSize = jToolkit.getScreenSize();
 screenW = jScreenSize.width;
 screenH = jScreenSize.height;
}

var largura=screenW/2;
var largura=Math.round(largura-600/2);
var altura=screenH/2;
var altura=Math.round(altura-436/1.3);




if (document.cookie == "") {
showads=1;
} else {
var the_cookie = document.cookie;
the_cookie = unescape(the_cookie);
the_cookie_split = the_cookie.split(";");
for (loop=0;loop<the_cookie_split.length;loop++) {
var part_of_split = the_cookie_split[loop];
var find_name = part_of_split.indexOf("ad");
if (find_name!=-1) {
break;
   }
}
if (find_name==-1) {
showads=1;
} else {
var ad_split = part_of_split.split("=");
var last = ad_split[1];
if (last!=0) {
showads=1;
} else {
showads=0;
         }
      }
   }

function writeCookie(show) {
var today = new Date();
var the_date = new Date();
the_date.setTime(today.getTime() + 1000 * timeout);
var the_cookie_date = the_date.toGMTString();
var the_cookie = "ad="+show;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie = the_cookie;
}

if (showads) {
writeCookie(0)
ferias(largura,altura)
}




function ferias(largura,altura){

document.write('<div id="flashBanner" style="position:absolute; left:'+largura+'px; top:'+altura+'px; width:600; height:436; z-index:1"><p align="center"><img src="anuncio.gif " alt="Férias Somodelismo" width="600" height="436" border="0" usemap="#ferias" /><map name="ferias" id="ferias"><area shape="rect" coords="520, 37, 540, 55" alt="Fechar" href="javascript:fechar()" /></map></p></div>');

//alert('olá');
}

function fechar() {
  		document.getElementById('flashBanner').style.display='none';
}
