function rollOn(obj){
	file=obj.src;
	obj.src=file.replace('_Off','_On');
}

function rollOff(obj){
	file=obj.src;
	obj.src=file.replace('_On','_Off');
}

var Key='';
function keyhandler(e) {
	if ((Key >=48 && Key <=57) || (Key >=96 && Key <=105) || Key==46 || Key==8 || Key==9 || Key==188 || (Key >=37 && Key <=40)){return true}else{return false};
}

function validarEmail(valor) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){
		return (true);
	} else {
		return (false);
	}
}

function muestraPanel(idPanel1,idPanel2){
	if(document.getElementById('panel'+idPanel1).style.display=='block'){
		document.getElementById('panel'+idPanel1).style.display='none';
		document.getElementById('panel'+idPanel2).style.display='block';
	}else{
		document.getElementById('panel'+idPanel1).style.display='block';
		document.getElementById('panel'+idPanel2).style.display='none';
	}
}

function solapas(obj){
	ok=true;
	
	if(obj.className.indexOf('Off')>=1 && ok){obj.className=obj.className.replace('Off','On');ok=false;}
	if(obj.className.indexOf('On')>=1 && ok){obj.className=obj.className.replace('On','Off');ok=false;}
}

function validarAcceso(validaciontexto1,validaciontexto2,validaciontexto3,validaciontexto4,obj){
	ok=true;
	if(obj.emailtop.value=='' && ok){alert(validaciontexto1);obj.emailtop.focus();ok=false;}
	if(!validarEmail(obj.emailtop.value) && ok){alert(validaciontexto2);obj.emailtop.focus();ok=false;}
	if(obj.passwordtop.value=='' && ok){alert(validaciontexto3);obj.passwordtop.focus();ok=false;}
	if(obj.passwordtop.value.length<=3 && ok){alert(validaciontexto4);obj.passwordtop.focus();ok=false;}
	if(ok){
		obj.submit();
	}
}

function BuscarWeb(validaciontextobuscar,validaciontextobuscador){
	ok=true;
	obj=document.busqueda;
	if(obj.buscar.value==validaciontextobuscar && ok){alert(validaciontextobuscador);obj.buscar.focus();ok=false;}
	if(ok){
		obj.submit();
	}
}

ie5 = (document.all && document.getElementById);
ns6 = (!document.all && document.getElementById);
opac = 0;

function fadeIn() {
	if(opac != 100){
	opac2 = 100;
	opac+=10;
	if(ie5) document.getElementById('fade').filters.alpha.opacity = opac;
	if(ns6) document.getElementById('fade').style.MozOpacity = opac/100;
		setTimeout('fadeIn()', 0);
	}
}