var revisa_tama = 1000;
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.webservicio.visibility="hidden";
        }
        else if (isNS6){
            document.getElementById("webservicio").style.visibility ="hidden";
        }
        else{
                   document.all.webservicio.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 = 120+5;
        ads_hv_posY = 5;
        ads_hv_yanterior = 5;
        ads_hv_mover();
    }
    function ads_hv_mover(){
        var ads_hv_scrollPos = ads_hv_navDOM?self.pageYOffset:document.body.scrollTop;
        var ads_hv_posLeft = -ads_hv_posX +innerWidth + (ads_hv_navDOM?self.pageXOffset:document.body.scrollLeft);
        
        if (Math.abs(ads_hv_scrollPos-ads_hv_yanterior) > ads_hv_FactorX){
<!-- 20 es e valor de la velocidad -->
            var ads_hv_dist = 8 * 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_posLeft);
        } 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_posLeft);
        } else if (ads_hv_yanterior == (ads_hv_scrollPos+ads_hv_posY)){
            ads_hv_moverElemento(ads_hv_yanterior,ads_hv_posLeft);
        }        
        
        setTimeout ("ads_hv_mover()",10);
    }
    function ads_hv_moverElemento(ads_hv_valTop,ads_hv_valLeft){
        if (isIE4){
            document.all["webservicio"].style.left = ads_hv_valLeft;
            document.all["webservicio"].style.top = ads_hv_valTop;
        }
        else if(isIE5){
            document.getElementById("webservicio").style.left = ads_hv_valLeft;
            document.getElementById("webservicio").style.top = ads_hv_valTop;
        }
        else if(isNS4){
            document.webservicio.left = ads_hv_valLeft;
            document.webservicio.top = ads_hv_valTop;
        }
        else if(isNS6){
            document.getElementById("webservicio").style.left = ads_hv_valLeft;
            document.getElementById("webservicio").style.top = ads_hv_valTop;
        }
    }
    function ads_hv_markMe() {
        if (screen.width >= 640 ){
        	window.onresize=ads_hv_setVals;
        	ads_hv_setVals();    	
        } 
    }
    
    
      function dar(){
        if(ads_hv_puesto==1){
            return;    
        }
        ads_hv_puesto = 1;
        ads_hv_tam_x = 11;//La X de cerrar es de 11x11
        
        if (isIE4){
            ads_hv_w = window.document.all["webservicio"].document.all["ads_hv_publi"].width;
            ads_hv_h = window.document.all["webservicio"].document.all["ads_hv_publi"].height;
            
            ads_hv_p1 = ads_hv_w-ads_hv_tam_x+1;
            
            window.document.all["webservicio"].document.all["ads_hv_area_hv"].coords="0,0,"+ads_hv_p1+","+(ads_hv_tam_x-1);
            window.document.all["webservicio"].document.all["ads_hv_area_cerrar"].coords=(ads_hv_p1+1)+",0,"+ads_hv_w+","+(ads_hv_tam_x-1);
            window.document.all["webservicio"].document.all["ads_hv_area_img"].coords="0,"+ads_hv_tam_x+","+ads_hv_w+","+ads_hv_h;    
        }
        else if(isIE5){
            ads_hv_w = window.document.getElementById("webservicio").document.getElementById("ads_hv_publi").width;
            ads_hv_h = window.document.getElementById("webservicio").document.getElementById("ads_hv_publi").height;
            
            ads_hv_p1 = ads_hv_w-ads_hv_tam_x+1;
                                  
            window.document.getElementById("webservicio").document.getElementById("ads_hv_area_hv").coords="0,0,"+ads_hv_p1+","+(ads_hv_tam_x-1);
            window.document.getElementById("webservicio").document.getElementById("ads_hv_area_cerrar").coords=(ads_hv_p1+1)+",0,"+ads_hv_w+","+(ads_hv_tam_x-1);
            window.document.getElementById("webservicio").document.getElementById("ads_hv_area_img").coords="0,"+ads_hv_tam_x+","+ads_hv_w+","+ads_hv_h;
        }
    }
    
    function tam(){    
        if (isIE4){
            ads_hv_posX = window.document.all["webservicio"].document.all["ads_hv_publi"].width+5;
        }
        else if(isIE5){
            ads_hv_posX = window.document.getElementById("webservicio").document.getElementById("ads_hv_publi").width+5;
        }
        dar();
    }
    
   
    
  function runPopup(){
  
    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();
    
    ads_hv_puesto = 0;
    
  
   
    
    if (ads_hv_altura>300 && ads_hv_anchura>450){
if (isNS6){
document.getElementById("webservicio").style.visibility ="hidden";
    	  
      } 
        if (isNS4){
    	            document.webservicio.visibility="hidden";
			
    	}
    	else{
            document.write('<DIV id="webservicio" name="webservicio" style="position:absolute;visibility: visible" z-index=1000 onMouseOver="dar()">');
        document.write('<map name="_HvMap_"><area id="ads_hv_area_cerrar" Shape="rect" coords="111,0,120,9" href="javascript:void(0);" onMouseDown="javaScript:ads_hv_cerrar();"  alt="Cerrar Publicidad" target="_self"><area id="ads_hv_area_hv" shape="rect" coords="0,0,110,9" href="http://www.emaildiario.com" alt="&gt;&gt;Ir a Emaildiario.com" target="_blank"><area id="ads_hv_area_img" shape="rect" coords="0,11,120,101" href="http://www.webservicio.com" target="_blank"></map>');
            document.write('<img name="ads_hv_publi" src="http://www.publiservicio.com/publi_activa/barrasuperior.gif" border=1 usemap="#_HvMap_" onLoad="tam()"><br>');
document.write('<iframe src="http://www.publiservicio.com/publi_activa/300x300.phtml?tipo=iframe&rotacion=general&n=rand&pagina=general&refresh=300" width="300" height="300" marginwidth="0" marginheight="0" hspace="0" vspace="0" align="middle" scrolling="no" frameborder="0" framespacing="0" onLoad="tam()"></iframe>');
            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();        
    }
    
  }//fin runpopup
}//fin if

//para ejecutarlo
runPopup();
//window.onresize = new Function("window.location.reload()");
setInterval("tam();", 1000)
//setTimeout ("alert('hola');",revisa_tama);

