function changeColorOver(id){
   var table = document.getElementById(id);
   //table.setAttribute("background","images/optbk.gif");
   table.setAttribute("class","txtSubMenuHover");
}

function changeColorOut(id){
   var table = document.getElementById(id);
   table.setAttribute("class","txtSubMenuUnSelected");
//	   table.setAttribute("background","");
}

function changeColorOver2(id){
   var table = document.getElementById(id);
   table.setAttribute("class","txtSubMenuHover");
}

function changeColorOut2(id){
   var table = document.getElementById(id);
   table.setAttribute("class","txtSubMenuUnSelected");
}


function changeColorOverSub(id){
   var table = document.getElementById(id);
   table.setAttribute("class","txtSubSubMenuHover");
}

function changeColorOutSub(id){
   var table = document.getElementById(id);
   table.setAttribute("class","txtSubSubMenuUnSelected");
}

function validarformulario(formulario){
	if(formulario.vf_nombre.value==""){
		alert("Aviso: Debes introducir el Nombre");
		formulario.vf_nombre.focus();
		return false;
	}
	if(formulario.vf_email.value==""){
		alert("Aviso: Debes introducir el E-mail");
		formulario.vf_email.focus();
		return false;
	}	
	if(formulario.vf_mensaje.value==""){
		alert("Aviso: Debes introducir el Mensaje");
		formulario.vf_mensaje.focus();
		return false;
	}			
}
function abrir(url){
	window.open(url,'_self','',true);	
}
function getrootUrl(){
	return 'page=1&page1=#&page2=telecomunicaciones/telecomunicaciones.html&page3=seguridad/seguridad.html&page4=telemetria/telemetria.html&page5=hogar/hogar.html';
}
function getUrl(num){
	return 'page='+num+'&page1=../index.html&page2=../telecomunicaciones/telecomunicaciones.html&page3=../seguridad/seguridad.html&page4=../telemetria/telemetria.html&page5=../hogar/hogar.html';
}

function validarCampos(form){
r=1;
if (((form.emp.value=="")||(form.emp.value=="Empresa:"))&&(r==1)){r=0;alert("Por favor, ingresa tu Empresa!");form.emp.focus};
if (((form.nom.value=="")||(form.nom.value=="Nombre Completo:"))&&(r==1)){r=0;alert("Por favor, ingresa tu Nombre Completo!");form.nom.focus};
//if ((form.dir.value=="")||(form.dir.value=="Dirección:")){r=0;alert("Por favor, ingresa tu Dirección!");form.dir.focus};
if ((form.mail.value.indexOf('@',0)==-1)&&(r==1)) {r=0;alert("Por favor, ingresa tu correo electrónico");form.mail.focus};

if (((form.men.value=="")||(form.men.value=="Mensaje:"))&&(r==1)){r=0;alert("Por favor, ingresa tu mensaje");form.men.focus};

  // RETORNAR AL ENVÍO
  // Si ha hay campos sin cubrir, interrumpimos el envío -return false-
if (r==0) { return false; }
  // Si todo está bien, te dispones a enviar el contenido del formulario al script php, -return true-
  // Además, alertas al usuario para que no pulse mas veces, aún así, la gente, no se cansa.
else {// alert ("con una vez es bastante gracias. Su mensaje se está procesando");
return true; }
	
}
