ns4 = (document.layers) ? true : false
ie4 = (document.all) ? true : false
var y = 88
var actual = 1

var running = false
var endTime = null
var timerID = null


function movery(y,nuevoact) {
	if (actual != nuevoact) {
		selec.ypos = y
		selec.top = selec.ypos
		mostrarObj(selec)
	}
}


function actualizarAct(y,nuevoact) {
	if (actual != nuevoact) {
		ocultarObj(selec)
		activo.ypos = y
		activo.top = activo.ypos	
		actual = y
	} else return false
}


function mostrarObj(obj) {
 if (ns4) obj.visibility = "show"
 else if (ie4) obj.visibility = "visible"
}

function ocultarObj(obj) {
 if (ns4) obj.visibility = "hide"
 else if (ie4) obj.visibility = "hidden"
}

function inicio () {
 if (ns4) {
 selec = document.selecDiv;
 activo = document.activoDiv;
 }
 if (ie4) {
 selec = selecDiv.style
 activo = activoDiv.style
 }
 selec.ypos = parseInt(selec.top);
 activo.ypos = parseInt(activo.top);
}



var browser="";
if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)==2) { browser="n2"; }
if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)==3) { browser="n3"; }
if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4) { browser="n4"; }
if(navigator.appVersion.indexOf("MSIE 3.0") != -1) { browser="ie3"; }
if(navigator.appVersion.indexOf("MSIE 4.0") != -1) { browser="ie4"; }

// se utiliza para posicionar  window for Netscape 4
var w=0;
var h=0;
if ( browser=="n4" )
   {
   var screen_height=parent.screen.height;
   var screen_width=parent.screen.width;
   var main_height=parent.window.innerHeight;
   h=(screen_height-main_height);
   w=(screen_width/2)-275;
   }

// 
function openWindow()   

   {
   var newWind=window.open("publicidad.html","display","width=350,height=275,screenX="+w+",screenY="+h);
   if (newWind.opener == null)

      {newWind.opener = window;}

   else

      { 

      if ( browser=="n3"  ||  browser=="n4"  ||  browser=="ie4" )

         newWind.focus();

      }   
   }



function startTimer() {
        running = true
        now = new Date()
        now = now.getTime()
        endTime = now + (1000 * 60 * 3)
        showCountDown()
}

function showCountDown() {
        var now = new Date()
        now = now.getTime()
        if (endTime - now <= 0) {
                stopTimer()
                var result = unescape(window.location.href)
                        window.location=result
        } else {
                var delta = new Date(endTime - now)
                var theMin = delta.getMinutes()
                var theSec = delta.getSeconds()
                var theTime = theMin
                theTime += ((theSec < 10) ? ":0" : ":") + theSec
                document.forms[0].timerDisplay.value = theTime
                if (running) {
                        timerID = setTimeout("showCountDown()",1000)
                }
        }
}

function stopTimer() {
        clearTimeout(timerID)
        running = false
        document.forms[0].timerDisplay.value = "0:00"
}



