function ValidarCookie(rutaFlash, ancho, alto){
	var activa = leerCookie('mostrarinter');
	if (activa != "si"){
		caducidad = 1;
		var expireDate = new Date(); //coge la fecha actual
		expireDate.setDate(expireDate.getDate()+caducidad);
		document.cookie="mostrado = si; expires=" + expireDate.toGMTString();
		CargarInterestitial(rutaFlash, ancho, alto);
	}
}
function leerCookie(nombre) {
   a = document.cookie.substring(document.cookie.indexOf(nombre + '=') + nombre.length + 1,document.cookie.length);
   if(a.indexOf(';') != -1)a = a.substring(0,a.indexOf(';'))	
   	return a; 
} 
  
function cerrarInterestitial(){
	document.getElementById('Inter').style.display = "none";
}


function CargarInterestitial(objeto, ancho, alto){
	
	var codigoHTML =  '<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="middle"><table width="'+ancho+'" border="0" cellspacing="0" cellpadding="0">      <tr><td height="20" align="right" valign="middle"><a href="javascript:void(0)" onClick="javascript:cerrarInterestitial()"><img src="closeit.gif" border=0></a></td></tr><tr><td><a href=vaya_promos_htc.html><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="'+ancho+'" height="'+alto+'"> <param name=movie value="'+objeto+'"> <param name=quality value=high> <embed src="'+objeto+'" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ancho+'" height="'+alto+'"></embed></object></a> </td></tr></table></td></tr></table>';
	var newdiv = document.createElement('div');
   	newdiv.setAttribute('id', 'Inter');
    newdiv.style.background = "#f39c19";
	newdiv.style.width = "100%";
    newdiv.style.height = "100%";
	newdiv.style.zIndex = "105";
	newdiv.style.position = "absolute";
    newdiv.style.left = "0";
    newdiv.style.top = "0";
	newdiv.style.filter = "alpha(opacity=99)";
    newdiv.innerHTML = codigoHTML;
   document.body.appendChild(newdiv);
	setTimeout("cerrarInterestitial()",5000);
	
	
	/*var newdiv = document.createElement('div');
   	newdiv.setAttribute('id', 'Inter');
    newdiv.style.width = "100%";
    newdiv.style.height = "100%";
    newdiv.style.left = "0";
    newdiv.style.top = "0";
    newdiv.style.background = "#FFF";
    newdiv.style.filter = "alpha(opacity=60)";
    newdiv.innerHTML = codigoHTML;
   document.body.appendChild(newdiv);
	setTimeout("cerrarInterestitial()",5000); */
}




