function playSound() {
  document.all.sound.src = "sounds/click.wav"
}

function playSound2() {
  document.all.sound.src = "sounds/motor.mp3"
}

function boton1(){
if (document.getElementById('b1').style.backgroundImage=='url(images/b1on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1act.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t1.gif)';
	document.getElementById('a1').style.display='block';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='none';
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
	playSound();
}
}

function boton2(){
if (document.getElementById('b2').style.backgroundImage=='url(images/b2on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2act.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t2.gif)';
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='block';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='none';		
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
	playSound();
}
}

function boton3(){
if (document.getElementById('b3').style.backgroundImage=='url(images/b3on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3act.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t3.gif)';
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='block';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='none';	
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
	playSound();
}
}

function boton4(){
if (document.getElementById('b4').style.backgroundImage=='url(images/b4on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4act.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t4.gif)';	
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='block';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='none';	
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
	playSound();
}
}

function boton5(){
if (document.getElementById('b5').style.backgroundImage=='url(images/b5on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5act.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t5.gif)';	
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='block';	
	document.getElementById('a6').style.display='none';	
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
	playSound();
}
}

function boton5b(){
if (document.getElementById('b5').style.backgroundImage=='url(images/b5des.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5act.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t5.gif)';	
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='block';	
	document.getElementById('a6').style.display='none';	
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
}
}

function boton6(){
if (document.getElementById('b6').style.backgroundImage=='url(images/b6on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6act.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t6.gif)';	
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='block';	
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='none';		
	playSound();
}
}

function boton7(){
if (document.getElementById('b7').style.backgroundImage=='url(images/b7on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7act.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t7.gif)';	
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='none';		
	document.getElementById('a7').style.display='block';
	document.getElementById('a8').style.display='none';	
	playSound();
}
}

function boton8(){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
	document.getElementById('txt').style.backgroundImage='url(images/t8.gif)';	
	document.getElementById('a1').style.display='none';
	document.getElementById('a2').style.display='none';	
	document.getElementById('a3').style.display='none';	
	document.getElementById('a4').style.display='none';	
	document.getElementById('a5').style.display='none';	
	document.getElementById('a6').style.display='none';		
	document.getElementById('a7').style.display='none';
	document.getElementById('a8').style.display='block';	
}

function b1on(){
if (document.getElementById('b1').style.backgroundImage=='url(images/b1des.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1on.gif)';
}}
function b1off(){
if (document.getElementById('b1').style.backgroundImage=='url(images/b1on.gif)'){
	document.getElementById('b1').style.backgroundImage='url(images/b1des.gif)';
}}

function b2on(){
if (document.getElementById('b2').style.backgroundImage=='url(images/b2des.gif)'){
	document.getElementById('b2').style.backgroundImage='url(images/b2on.gif)';
}}
function b2off(){
if (document.getElementById('b2').style.backgroundImage=='url(images/b2on.gif)'){
	document.getElementById('b2').style.backgroundImage='url(images/b2des.gif)';
}}

function b3on(){
if (document.getElementById('b3').style.backgroundImage=='url(images/b3des.gif)'){
	document.getElementById('b3').style.backgroundImage='url(images/b3on.gif)';
}}
function b3off(){
if (document.getElementById('b3').style.backgroundImage=='url(images/b3on.gif)'){
	document.getElementById('b3').style.backgroundImage='url(images/b3des.gif)';
}}

function b4on(){
if (document.getElementById('b4').style.backgroundImage=='url(images/b4des.gif)'){
	document.getElementById('b4').style.backgroundImage='url(images/b4on.gif)';
}}
function b4off(){
if (document.getElementById('b4').style.backgroundImage=='url(images/b4on.gif)'){
	document.getElementById('b4').style.backgroundImage='url(images/b4des.gif)';
}}

function b5on(){
if (document.getElementById('b5').style.backgroundImage=='url(images/b5des.gif)'){
	document.getElementById('b5').style.backgroundImage='url(images/b5on.gif)';
}}
function b5off(){
if (document.getElementById('b5').style.backgroundImage=='url(images/b5on.gif)'){
	document.getElementById('b5').style.backgroundImage='url(images/b5des.gif)';
}}

function b6on(){
if (document.getElementById('b6').style.backgroundImage=='url(images/b6des.gif)'){
	document.getElementById('b6').style.backgroundImage='url(images/b6on.gif)';
}}
function b6off(){
if (document.getElementById('b6').style.backgroundImage=='url(images/b6on.gif)'){
	document.getElementById('b6').style.backgroundImage='url(images/b6des.gif)';
}}

function b7on(){
if (document.getElementById('b7').style.backgroundImage=='url(images/b7des.gif)'){
	document.getElementById('b7').style.backgroundImage='url(images/b7on.gif)';
}}
function b7off(){
if (document.getElementById('b7').style.backgroundImage=='url(images/b7on.gif)'){
	document.getElementById('b7').style.backgroundImage='url(images/b7des.gif)';
}}

function reloj(){ 
    ahora = new Date();
    horas = ahora.getHours();
    minutos = ahora.getMinutes();
    segundos = ahora.getSeconds();
    dias = ahora.getDay();
    meses = ahora.getMonth()+1;
	if (meses<10) meses="0"+meses;
    anyos = ahora.getYear();
	diam=ahora.getDate();
	if (diam<10) diam="0"+diam;

	str_segundo = new String (segundos) 
    if (str_segundo.length == 1) 
       segundos = "0" + segundos 

    str_minuto = new String (minutos) 
    if (str_minuto.length == 1) 
       minutos = "0" + minutos 

    str_hora = new String (horas) 
    if (str_hora.length == 1) 
       horas = "0" + horas 
	   
   

    lahora = horas + ":" + minutos + ":" + segundos + " - " + diam + "/" + meses + "/" + anyos;

    document.relhora.reloj.value = lahora;

    setTimeout("reloj()",1000);
} 


