
// JavaScript Document
function foto_izq(cual){
if (document.all){
 document.all['izq'].src='../img/fotos_izq/'+cual+'.jpg';
 }
if ((!document.all)&&(document.getElementById)){
 document.getElementById('izq').src='../img/fotos_izq/'+cual+'.jpg';
}
}

function cambia_estilo(quien,color_letra,color_fondo){
if (document.all){
document.all[quien].style.color=color_letra;
document.all[quien].style.backgroundColor=color_fondo;
}
if ((!document.all)&&(document.getElementById)){
document.getElementById(quien).style.color=color_letra;
document.getElementById(quien).style.backgroundColor=color_fondo;
}
}

function valida(usuario,passvoid,pag){
/*
if (((!document.all)&&(document.getElementById))||(!document.barra_inf.movie)){
alert('Necesita Internet Explorer para acceder');
location.assign('index.htm');
}
if ((document.all)&&(document.barra_inf.movie)){
*/
if ((usuario=='')||(passvoid=='')){
 alert('indique un Cliente y una Contraseña ...');
  if (usuario==''){
    if (document.all){
     document.all['usuario'].focus();
	}
	if ((!document.all)&&(document.getElementById)){
	 document.getElementById('usuario').focus();
	}
  }
  else{
   if (document.all){
    document.all['contra'].focus();
   }
   if ((!document.all)&&(document.getElementById)){
	document.getElementById('contra').focus();
   }
  }
}

else{
    
		 patron= /\W/ 
		 if ((patron.test(usuario)==true)||(patron.test(passvoid)==true)){
		   alert('introduzca valores válidos para Cliente y Contraseña ...');
		   if (document.all){
		    document.all['usuario'].value ='';
		    document.all['contra'].value = '';
		    document.all['usuario'].focus();
		   }
		   if ((!document.all)&&(document.getElementById)){
		    document.getElementById('usuario').value ='';
		    document.getElementById('contra').value = '';
		    document.getElementById('usuario').focus();
		   }
		   return false;
		 }
		 else{
		   if (document.all){
		    document.all['cliente'].value=usuario;
		    document.all['cliente_con'].value=passvoid;
            document.all['formo'].action='http://www.mintra.es/sala/valida.asp';
			//document.all['formo'].action='http://carlos/mintra/sala/valida.asp';
			document.all['formo'].submit();
           }
		   if ((!document.all)&&(document.getElementById)){
		    document.getElementById('cliente').value=usuario;
		    document.getElementById('cliente_con').value=passvoid;
            //document.getElementById('formo').action='http://www.mintra.es/sala/valida.asp';
			//document.getElementById('formo').action='http://carlos/mintra/sala/valida.asp';
			//document.getElementById('formo').submit();
			alert('Es necesario el Internet Explorer ...\n');
           }
        
		 }			



//alert('Servicio deshabilitado temporalmente\n por el traslado del dominio ...\n\n');
}

}

function enter(){
if(event.keyCode==13){
if (document.all){
 if(document.all['usuario'].value!=''){
  valida(document.all['usuario'].value,document.all['contra'].value);
 }
}
if ((!document.all)&&(document.getElementById)){
 if(document.getElementById('usuario').value!=''){
  valida(document.getElementById('usuario').value,document.getElementById('contra').value);
 }
}
}
}