var medida = 3
var parar = 0 
var a = 1

function comienzo( mauricio ){
   parar = 0
   cepilo = mauricio
   cepilo.style.left = 0
   cepilo.style.top = 0
}

function movimiento() {
   if ( (!document.all && !document.getElementById) || parar == 1 )
      return
   if ( a == 1 ) {
      cepilo.style.top = parseInt(cepilo.style.top) + medida
   } else if ( a == 2 ) {
      cepilo.style.left = parseInt( cepilo.style.left ) + medida
   } else if ( a == 3 ) {
      cepilo.style.top = parseInt( cepilo.style.top ) - medida
   } else {
      cepilo.style.left = parseInt( cepilo.style.left ) - medida
   }

   if ( a < 4 )
      a++
   else
      a = 1

setTimeout( "movimiento()", 50 )
}

function fin( mauricio ) {
   parar = 1
   mauricio.style.left = 0
   mauricio.style.top = 0
}
function encendiendo(apagador){
        objeto = apagador
        prendiendo = setInterval( "encendido(objeto)", 50 )
}

function apagando(apagador){
        clearInterval( prendiendo )
        apagador.filters.alpha.opacity = 20
}

function encendido(cepilo){
        if ( cepilo.filters.alpha.opacity < 110 )
                cepilo.filters.alpha.opacity += 5
        else if ( window.prendiendo )
                clearInterval( prendiendo )
}

function popUp1(URL) // Ventana horizontal
{
        day = new Date();
        id = day.getTime();
        eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=400,height=300,left = 369,top = 220');");
}

function popUp2(URL) // Ventana vertical
{
        day = new Date();
        id = day.getTime();
        eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=0,location=0,statusbar=0,status=0,menubar=0,resizable=0,width=300,height=400,left = 470,top = 120');");
}

function popUp3(URL) // Ventana ampliada
{
        day = new Date();
        id = day.getTime();
        eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,status=0,menubar=1,resizable=1,width=760,height=450,left = 17,top = 8');");
}