Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/05/2004, 13:18
excitex
 
Fecha de Ingreso: mayo-2004
Mensajes: 22
Antigüedad: 20 años, 6 meses
Puntos: 0
Saludos nuevamente

Es el primer foro que visito ( y no son pocos ) que las respuestas son casi más rapidas que las preguntas.

A ver he modificado algunas cosas y ahora cuando cierro la ventada a traves del (X) del navegador no me carga de nuevo el " gif" y tendría que cargarlo.

Aquí va el script con el cual estoy haciendo las pruebas :

// expireDate = new Date
// expireDate.setMonth(expireDate.getMonth()+6)

cookieName = ""
if (document.cookie != "") {
cookieName = document.cookie.split("=")[1]
}

function setCookie() {
cookieName = "prueba"
document.cookie = "cookieName="+cookieName+""; // expires=" + expireDate.toGMTString()
}


function deletecookie(){
if (document.cookie != "") {
thisCookie = document.cookie.split("; ")
// expireDate = new Date
// expireDate.setDate(expireDate.getDate()-1)
for (i=0; i<thisCookie.length; i++) {
cookieName = thisCookie[i].split("=")[1]
document.cookie = "cookieName="+cookieName + ""; //expires=" + expireDate.toGMTString()


}
}
}

if (document.cookie != "" ){
document.write("¡Ya tengo la cookie!");
}
else {
if (!HVhpjs)
{
var HVhpjs = 1;
ads_hv_FactorX=20;

isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;

function ads_hv_cerrar(){
if(isNS4){
document.excitex.visibility="hidden";
}
else if (isNS6){
document.getElementById("excitex").style.visibilit y ="hidden";
}
else{
document.all.excitex.style.visibility = "hidden";
}
}
function ads_hv_setVals() {
// Con NS el innerHeigth esta definido
if (isIE4 || isIE5){
if (document.body){
innerWidth = document.body.clientWidth;
innerHeight = document.body.clientHeight;
} else{
innerWidth = 1004;
innerHeight= 578;
}
}
ads_hv_posX = 776;
ads_hv_posY = 0;
ads_hv_yanterior = 20;
ads_hv_mover();
}
function ads_hv_mover(){
var ads_hv_scrollPos = ads_hv_navDOM?self.pageYOffset:document.body.scrol lTop;
var ads_hv_posLeft = -ads_hv_posX +innerWidth + (ads_hv_navDOM?self.pageXOffset:document.body.scro llLeft);

if (Math.abs(ads_hv_scrollPos-ads_hv_yanterior) > ads_hv_FactorX){
var ads_hv_dist = 2 * parseInt( Math.abs(ads_hv_scrollPos-ads_hv_yanterior) / ads_hv_FactorX );
} else {
var ads_hv_dist = 1;
}

if(ads_hv_yanterior < (ads_hv_scrollPos+ads_hv_posY)){
ads_hv_yanterior+=ads_hv_dist;
ads_hv_moverElemento(ads_hv_yanterior,ads_hv_posLe ft);
} else if (ads_hv_yanterior > (ads_hv_scrollPos+ads_hv_posY)){
ads_hv_yanterior-=ads_hv_dist;
ads_hv_moverElemento(ads_hv_yanterior,ads_hv_posLe ft);
} else if (ads_hv_yanterior == (ads_hv_scrollPos+ads_hv_posY)){
ads_hv_moverElemento(ads_hv_yanterior,ads_hv_posLe ft);
}

setTimeout ("ads_hv_mover()",10);
}
function ads_hv_moverElemento(ads_hv_valTop,ads_hv_valLeft) {
if (isIE4){
document.all["excitex"].style.left = ads_hv_valLeft;
document.all["excitex"].style.top = ads_hv_valTop;
}
else if(isIE5){
document.getElementById("excitex").style.left = ads_hv_valLeft;
document.getElementById("excitex").style.top = ads_hv_valTop;
}
else if(isNS4){
document.excitex.left = ads_hv_valLeft;
document.excitex.top = ads_hv_valTop;
}
else if(isNS6){
document.getElementById("excitex").style.left = ads_hv_valLeft;
document.getElementById("excitex").style.top = ads_hv_valTop;
}
}
function ads_hv_markMe() {
if (screen.width >= 640 ){
window.onresize=ads_hv_setVals;
ads_hv_setVals();
}
}
if (isIE4 || isIE5){
if (document.body){
ads_hv_altura=document.body.clientHeight;
ads_hv_anchura=document.body.clientWidth;
}else{
if (frames.length==0){
ads_hv_altura=301;
ads_hv_anchura=451;
}else{
ads_hv_altura=0;
ads_hv_anchura=0;
}
}
}

if (isNS4 || isNS6){
ads_hv_altura=window.innerHeight;
ads_hv_anchura=window.innerWidth;
}

ads_hv_fecha = new Date();
ads_hv_bust = ads_hv_fecha.getTime();

if (ads_hv_altura>300 && ads_hv_anchura>450){
if (isNS4){
document.write('<POPUT name="excitex" POSITION=ABSOLUTE z-index=1000>');
document.write('<img name="layer.gif" border=0 usemap="#_HvMap_">');
document.write('<map name=\"_HvMap_\"><area shape=\"rect\" coords="279,302,364,318" href=\"#\" onMouseOver=\"{javascript:ads_hv_cerrar();javaScri pt:setCookie()}\" alt="Soy mayor de edad"><area shape=\"rect\" coords=\"389,302,477,318\" href=\"http://www.google.com" onMouseDown=\"javaScript:deletecookie()\" alt=\"Soy menor de edad\"></map>');
document.write('</POPUT>');
}
else{
document.write('<DIV id="excitex" name="excitex" style="position:absolute;visibility: visible" z-index=1000 >');
document.write('<img name="ads_hv_publi" src="prueba/layer.gif" border=0 usemap="#_HvMap_">');
document.write('<map name=\"_HvMap_\"><area shape=\"rect\" coords="279,302,364,318" href=\"#\" onMouseDown=\"{javaScript:ads_hv_cerrar();javaScri pt:setCookie()}\" alt="Soy mayor de edad"><area shape=\"rect\" coords=\"389,302,477,318\" href=\"http://www.google.com\" onMouseDown=\"javaScript:deletecookie()\" alt=\"Soy menor de edad\" ></map>');
document.write('</DIV>');
}
ads_hv_navDOM = isNS4 || isNS6;

var ads_hv_vr = navigator.userAgent.replace(/mac/gi,"");
if (navigator.userAgent != ads_hv_vr)
{window.onload=ads_hv_markMe;} // safety for Mac IE4.5
ads_hv_markMe();
}
}

}

Reitero mis felicitaciones y mi agracimiento a vuestra ayuda .