function navegacion(idioma,seccion)
{
	var ruta = "/cnch/"  //Nivel superior ;
	/* 
	IDIOMA  0=Ingles , 1=Espaņol;
	SECCIONES 0=inicio, 1=goodfoods, 2=promociones, 3=productos, 4=ventas, 5=comunidad, 6=recetas;
	*/
	if(idioma==0)
	{
		if(seccion==0) window.location.href= ruta+"e_index.php";
		if(seccion==1) window.location.href= ruta+"empresa/e_index.php";
		if(seccion==2) window.location.href= ruta+"producto/e_productoCat.php";
		if(seccion==3) window.location.href= ruta+"promocion/e_promocion.php";
		if(seccion==4) window.location.href= ruta+"ventas/e_distribuidores.php";
		if(seccion==5) window.location.href= ruta+"comunidad/e_index.php";
		if(seccion==6) window.location.href= ruta+"reposteria/e_index.php";
		if(seccion==7) window.open("http://pedidos.chocolates.com.pe/");
		//if(seccion==8) window.open("http://mail.chocolates.com.pe/webmail/");
		if(seccion==8) window.location.href= ruta+"webmail.php";
		if(seccion==9) window.location.href= ruta+"empleo/e_empleos.php";
		if(seccion==10) window.open("http://antares1.chocolates.com.pe/ts/");
	}
	else if(idioma==1)
	{
		if(seccion==0) window.location.href= ruta+"index.php";
		if(seccion==1) window.location.href= ruta+"empresa/index.php";
		if(seccion==2) window.location.href= ruta+"producto/productoCat.php";
		if(seccion==3) window.location.href= ruta+"promocion/promocion.php";
		if(seccion==4) window.location.href= ruta+"ventas/distribuidores.php";
		if(seccion==5) window.location.href= ruta+"comunidad/index.php";
		if(seccion==6) window.location.href= ruta+"reposteria/index.php";
		if(seccion==7) window.open("http://pedidos.chocolates.com.pe/");
		//if(seccion==8) window.open("http://mail.chocolates.com.pe/webmail/");
		if(seccion==8) window.location.href= ruta+"webmail.php";
		if(seccion==9) window.location.href= ruta+"empleo/empleos.php";
		if(seccion==10) window.open("http://antares1.chocolates.com.pe/ts/");
	}
}

function selproducto(id)
{
	var ruta = "/cnch/"
	if(id=="caramelo") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=1";
	if(id=="chocopresto") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=14";
	if(id=="chocolate") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=4";
	if(id=="cobertura") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=5";
	if(id=="cocoa") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=6";
	if(id=="crema") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=7";
	if(id=="galleta") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=8";
	if(id=="gragea") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=9";
	if(id=="goma") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=10";
	if(id=="marshmallow") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=11";
	if(id=="paneton") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=12";
	if(id=="avena") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=13";
	if(id=="chicle") window.location.href= ruta+"producto/productoSubcat.php?pIDCategoria=3";
}
function e_selproducto(id)
{
	var ruta = "/cnch/"
	if(id=="caramelo") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=1";
	if(id=="chocopresto") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=14";
	if(id=="chocolate") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=4";
	if(id=="cobertura") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=5";
	if(id=="cocoa") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=6";
	if(id=="crema") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=7";
	if(id=="galleta") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=8";
	if(id=="gragea") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=9";
	if(id=="goma") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=10";
	if(id=="marshmallow") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=11";
	if(id=="paneton") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=12";
	if(id=="avena") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=13";
	if(id=="chicle") window.location.href= ruta+"producto/e_productoSubcat.php?pIDCategoria=3";
}

function td(objRef,estado)
{
	objRef.style.backgroundColor = (1 == estado) ? '#EEEEEE' : '#FFFFFF';
	return;
}

function RevisaEmail(Email)
{   var goodEmail = Email.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
	if (!goodEmail)
		return false;
	return true;
}

function funcValidaUser(Nombre)
{
	if (Nombre.length<1) return(false)
	var checkOK = "1234567890ABDCEFGHIJKLRMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@-_";
	var checkStr = Nombre.value;
	var allValid = true;
	for (i = 0;  i < Nombre.length;i++){
	ch = Nombre.charAt(i);
	for (j = 0;  j < checkOK.length;j++)
	if (ch == checkOK.charAt(j)) break;
	if (j == checkOK.length) { allValid = false;  break;}}
	if (!allValid) return (false);
	return (true);
}

function showMenu(xItem){
	var item=eval("_"+xItem);
	var imge=eval("document.i"+xItem);

	if (item.style.display!=''){
		imge.src="../images/logos/optOff.gif";
		item.style.display='';}
	else{
		imge.src="../images/logos/optOn.gif";
		item.style.display='none';}
}