function xsnav(divId)
{
 var i;
 var obj;
 var nobj;
 for(i=1;i<=8;i++)
 {
  obj=document.getElementById("xssnav"+i);
  nobj=document.getElementById("ssnav"+i);
  if(i==divId){
   obj.style.display="block";
   nobj.className="nav_o";
  }else{
   obj.style.display="none";
   nobj.className="nav_n";
  }
 }
}
function indln(divId)
{
 var i;
 var obj;
 var nobj;
 for(i=1;i<=3;i++)
 {
  obj=document.getElementById("indlnr"+i);
  nobj=document.getElementById("indln"+i);
  if(i==divId){
   nobj.className="icena_cl_ao";
   obj.style.display="block";
  }else{
   nobj.className="icena_cl_aout";
   obj.style.display="none";
  }
 }
}
function checkform(){
	if (document.book.title.value.length==0){
		alert("Wrong, the theme can not be empty!");
		document.book.title.focus();
		return false;
	}
	if (document.book.name.value.length==0){
		alert("Wrong, the user name can not be empty!");
		document.book.name.focus();
		return false;
	}
	if (document.book.name.value.length<2||document.book.name.value.length>35){
		alert("Wrong, you fill out the user name does not meet the requirements!");
		document.book.name.focus();
		return false;
	}
	if (document.book.phone.value.length==0){
		alert("Wrong, you do not fill out the contact phone!");
		document.book.phone.focus();
		return false;
	}
	if (document.book.email.value.length==0){
		alert("Wrong, you do not fill your mailbox!");
		document.book.email.focus();
		return false;
	}
	if (document.book.content.value.length==0){
		alert("Wrong, you do not complete the message content!");
		document.book.content.focus();
		return false;
	}
	if (document.book.content.value.length>225)
	{
		alert("Wrong, your message is too long. !");
		document.book.content.focus();
		return false;
	}
	return true;
}
function checkotform(){
	if (document.book.title.value.length==0){
		alert("Mal, el tema no puede estar vacío!");
		document.book.title.focus();
		return false;
	}
	if (document.book.name.value.length==0){
		alert("Mal, el nombre de usuario no puede estar vacío!");
		document.book.name.focus();
		return false;
	}
	if (document.book.name.value.length<2||document.book.name.value.length>35){
		alert("Mal, a llenar el nombre de usuario no cumple con los requisitos!");
		document.book.name.focus();
		return false;
	}
	if (document.book.phone.value.length==0){
		alert("Mal, no llene el teléfono de contacto!");
		document.book.phone.focus();
		return false;
	}
	if (document.book.email.value.length==0){
		alert("Mal, que no llenan su buzón de correo!");
		document.book.email.focus();
		return false;
	}
	if (document.book.content.value.length==0){
		alert("Mal, usted no completa el contenido del mensaje!");
		document.book.content.focus();
		return false;
	}
	if (document.book.content.value.length>225)
	{
		alert("Mal, su mensaje es demasiado largo. !");
		document.book.content.focus();
		return false;
	}
	return true;
}	


function checksec(){
	if (document.formsec.sec.value.length==0){
		alert("Wrong, you do not complete the search!");
		document.formsec.sec.focus();
		return false;
	}
	return true;
}	
function o_checksec(){
	if (document.formsec.sec.value.length==0){
		alert("búsqueda incorrecta, el contenido no puede estar vacío!");
		document.formsec.sec.focus();
		return false;
	}
	return true;
}	

function killerrors() { 
return true; 
} 
window.onerror = killerrors; 


function checkind(){
	if (document.ind.tit.value.length==0){
		alert("Wrong, the title can not be empty!");
		document.ind.tit.focus();
		return false;
	}
	if (document.ind.cname.value.length==0){
		alert("Wrong, the Company name can not be empty!");
		document.ind.cname.focus();
		return false;
	}
	if (document.ind.cname.value.length<2||document.ind.cname.value.length>65){
		alert("Wrong, you fill out the Company name does not meet the requirements!");
		document.ind.cname.focus();
		return false;
	}
	if (document.ind.email.value.length==0){
		alert("Wrong, you do not fill your mailbox!");
		document.ind.email.focus();
		return false;
	}
	if (document.ind.phone.value.length==0){
		alert("Wrong, you do not fill out the contact phone!");
		document.ind.phone.focus();
		return false;
	}
	if (document.ind.person.value.length==0){
		alert("Wrong, you do not fill your Contact person!");
		document.ind.person.focus();
		return false;
	}
	if (document.ind.prob.value.length==0){
		alert("Wrong, you do not complete the Problem!");
		document.ind.prob.focus();
		return false;
	}
	if (document.ind.prob.value.length>225)
	{
		alert("Wrong, your Problem is too long. !");
		document.ind.prob.focus();
		return false;
	}
	return true;
}
function checkotind(){
	if (document.ind.tit.value.length==0){
		alert("Mal, el título no puede estar vacío!");
		document.ind.tit.focus();
		return false;
	}
	if (document.ind.cname.value.length==0){
		alert("Mal, el Nombre de la empresa no puede estar vacío!");
		document.ind.cname.focus();
		return false;
	}
	if (document.ind.cname.value.length<2||document.ind.cname.value.length>65){
		alert("Mal, a llenar el Nombre de la empresa no cumple con los requisitos!");
		document.ind.cname.focus();
		return false;
	}
	if (document.ind.email.value.length==0){
		alert("Mal, que no llenan su buzón de correo!");
		document.ind.email.focus();
		return false;
	}
	if (document.ind.phone.value.length==0){
		alert("Mal, no llene el teléfono de contacto!");
		document.ind.phone.focus();
		return false;
	}
	if (document.ind.person.value.length==0){
		alert("Mal, no llene el teléfono de Persona de contacto!");
		document.ind.person.focus();
		return false;
	}
	if (document.ind.prob.value.length==0){
		alert("Problema de contenido no puede estar vacío!");
		document.ind.prob.focus();
		return false;
	}
	if (document.ind.prob.value.length>225)
	{
		alert("Mal, El problema es demasiado larg!");
		document.ind.prob.focus();
		return false;
	}
	return true;
}	

function ot_checkpro(){
	var s = document.getElementsByName("proid[]"); 
	var s2 = ""; 
	for( var i = 0; i < s.length; i++ ) { 
	   if ( s[i].checked ){ 
	   s2 += s[i].value+','; 
	   } 
	} 
	s2 = s2.substr(0,s2.length-1);
//	alert(s2);
//	return false;
//	if (s2.indexOf(',')<0){
//		alert("Mal, se selecciona al menos dos productos!");
	if (s2.length<1){
		alert("Mal, por lo menos elegir un producto!");
		return false;
	}
	return true;
}	

function checkpro(){
	var s = document.getElementsByName("proid[]"); 
	var s2 = ""; 
	for( var i = 0; i < s.length; i++ ) { 
	   if ( s[i].checked ){ 
	   s2 += s[i].value+','; 
	   } 
	} 
	s2 = s2.substr(0,s2.length-1);
	if (s2.length<1){
		alert("Wrong, at least choose a product!");
		return false;
	}
	return true;
}	
