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 >=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 changeImg(idImg, pstrImg,texto){
	document.getElementById(idImg).src = pstrImg;
}

function changeHomeImg(idImg, pstrImg, texto, id, total){
	document.getElementById(idImg).src = pstrImg;
	if(texto!='false'){
		document.getElementById('textosobreimagen').innerHTML = texto;
		if(texto==''){
			document.getElementById('textosobreimagen').style.display = 'none';
		}else{
			document.getElementById('textosobreimagen').style.display = 'block';
		}
	}
	for(k=1;k<total;k++){
		document.getElementById('item'+k).className='paginadorImg';
	}
	document.getElementById('item'+id).className='paginadorImgOn';
}

function ShowHideCategories(pstrOption, pIdCategory){
	if(document.getElementById(pstrOption+'subcategoria'+pIdCategory).style.display == "none" || document.getElementById(pstrOption+'subcategoria'+pIdCategory).style.display == ""){
		document.getElementById(pstrOption+'categoria'+pIdCategory).style.background = "#305397";
		document.getElementById(pstrOption+'subcategoria'+pIdCategory).style.display = "block";
		document.getElementById(pstrOption+'imgMM'+pIdCategory).src = "../sitefiles/img/imMenos.gif";
	}
	else{
		document.getElementById(pstrOption+'categoria'+pIdCategory).style.background = "#505050";
		document.getElementById(pstrOption+'subcategoria'+pIdCategory).style.display = "none";
		document.getElementById(pstrOption+'imgMM'+pIdCategory).src = "../sitefiles/img/imMas.gif";
	}
}

var autotime;
function changeImgAuto(){
	counter++;
	if(counter>=imgauto.length){counter=1;}
	changeHomeImg('imgCentral',imgauto[counter],textoauto[counter],counter,imgauto.length);
	autotime=setTimeout("changeImgAuto();",3000);
}

function stopImgAuto(){
	clearTimeout(autotime);
}

