// JavaScript Document
function printpage()
{
	window.print();
}
function valida_contacto(x)
{
if (x==1){var cod="wez34"}
if (x==2){var cod="I5wn2"}
if (x==3){var cod="xxar2"}
if (x==4){var cod="qdFvP"}
if (x==5){var cod="rry38"}
if ((document.form1.txt_nombre.value=="")|(document.form1.txt_apellido.value=="")|(document.form1.txt_telefono.value=="")|(document.form1.txt_email.value=="")|(document.form1.txt_comentarios.value==""))
	{
		alert("Todos los datos son obligatorios.")
	}
else
	{	
		q=document.form1.txt_email.value;
		var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/ 
		if(b.test(q)==false)
		{
			alert ("La dirección de e-mail es incorrecta.")
			document.form1.txt_email.focus();
		}
		else
		{
		if(cod!=document.form1.txt_codigo.value)
			{
			alert("Debe ingresar correctamente el codigo de seguridad.")
			}
		else
			{
			document.form1.action="contacto_cmd.php";
			document.form1.submit();
			}
		}
	}
}
function valida_recomendar(x)
{
if (x==1){var cod="wez34"}
if (x==2){var cod="I5wn2"}
if (x==3){var cod="xxar2"}
if (x==4){var cod="qdFvP"}
if (x==5){var cod="rry38"}
if ((document.form1.txt_nombre.value=="")|(document.form1.txt_email.value=="")|(document.form1.txt_comentarios.value=="")|(document.form1.txt_nombre2.value==""))
	{
		alert("Todos los datos son obligatorios.")
	}
else
	{	
		q=document.form1.txt_email.value;
		var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/ 
		if(b.test(q)==false)
		{
			alert ("La dirección de e-mail es incorrecta.")
			document.form1.txt_email.focus();
		}
		else
		{
		if(cod!=document.form1.txt_codigo.value)
			{
			alert("Debe ingresar correctamente el codigo de seguridad.")
			}
		else
			{
			document.form1.action="recomendar_cmd.php";
			document.form1.submit();
			}
		}
	}
}

function over(tipo,control,cant)
{
	if(!cant)
	{
	if(tipo==1)
		{
		document.getElementById(control).src="img/"+control+"_o.gif";
		}
	else
		{
		document.getElementById(control).src="img/"+control+".gif";	
		}
	}
else
	{
		if(tipo==1)
		{
		document.getElementById(control+cant).src="img/"+control+"_o.gif";
		}
	else
		{
		document.getElementById(control+cant).src="img/"+control+".gif";	
		}
	}

}
// JavaScript Document
var modulos='';
var URL = unescape(location.href);
var xstart = URL.lastIndexOf("/") + 1;
var xend = URL.length;
var hereName = URL.substring(xstart,xend);
var url2=unescape(hereName);	
var xend2 = url2.lastIndexOf("?");
if (xend2>-1)
	{
	var final=hereName.substring(0,xend2);
	var nom_pagina=final.replace(/.php/,"");
	}
else
	{
	var nom_pagina=hereName.replace(/.php/,"");
	}
function mensajes()
{
var query = window.location.search.substring(1);
if (query=="we345hidq"){alert("Los datos ingresados son incorectos.");}
if (query=="endsessions"){alert("Por favor, Identifíquese.");}
}
function mensajes_front(x)
{

	if(x==1){alert("Tu comentario fué agregado con éxito.");}
	if(x==2){alert("El registro concluyó con éxito."+"\n"+"Se te ha enviado un email indicando los"+"\n"+"datos de acceso.");}
	if(x==3){alert("Tu consulta fué procesada con éxito. Gracias!");}
	if(x==4){alert("El email ingresado ya existe.");}
	if(x==5){alert("Los datos indicados son incorrectos.");}
	if(x==6){alert("Se te envió un email con los datos de tu cuenta.");}
	if(x==7){alert("El contacto fué agregado con éxito en tu agenda.");}
	if(x==8){alert("El ticket fué procesado con éxito.");}
	if(x==9){alert("Los datos han sido enviado con éxito.");}
}
function tamano()
{
	if(document.form1.lst_tipos.value=="I")
	{
	document.getElementById('tam').style.display="";
	}
	else
	{
	document.getElementById('tam').style.display="none";
	}
	if(document.form1.lst_tipos.value=="A")
		{
		document.getElementById('descrimedia').style.display="none";
		document.getElementById('linkmedia').style.display="none";
		}
	else
		{
		document.getElementById('descrimedia').style.display="";
		document.getElementById('linkmedia').style.display="";
		}
}

function valida_parametros()
{
if ((document.form1.txt_valor.value==""))
	{
	alert("Debe ingresar elvalor del parámetro.");
	document.form1.txt_descripcion.focus();
	}
else	
	{
	if (document.form1.txt_id.value!="")
		{
		accion="updt";
		id=document.form1.txt_id.value;
		busca_duplicado(accion,'parametros',document.form1.txt_nombre.value,id);
		}
	else
		{
		accion="add";
		id=document.form1.txt_id.value;
		busca_duplicado(accion,'parametros',document.form1.txt_nombre.value,id);
		}
	}
}
function updt_parametros(foco,valores)
{
mue_form(foco);
arr=valores.split("|");
document.form1.txt_id.value=arr[0];
document.form1.txt_nombre.value=arr[1];
document.form1.txt_valor.value=arr[2];
}
function valida_secciones()
{
/*var archivo=document.form1.txt_imagen.value;
extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
if ((extension != "") & ((extension != ".jpg")) & ((extension != ".gif")))
	{
	alert("La imagen debe ser un archivo .jpg o .gif");
	}
else
	{*/
	accion="updt";
	id=document.form1.txt_id.value;
	busca_duplicado(accion,'secciones',1,id);
	//}
}
function valida_ofertas()
{
if((document.form1.txt_nombre.value=="")|(document.form1.txt_fecha.value==""))
	{
	alert("Todos los campos (*) son obligatorios.");
	}
else
	{
	var archivo=document.form1.txt_imagen.value;
	extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
	if ((extension != "") & ((extension != ".jpg")) & ((extension != ".gif")))
		{
		alert("La imagen debe ser un archivo .jpg o .gif");
		}
	else
		{
		if (document.form1.txt_id.value!="")
			{
			accion="updt";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'ofertas',document.form1.txt_nombre.value,id);
			}
		else
			{
			accion="add";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'ofertas',document.form1.txt_nombre.value,id);
			}
		}
	}
}
function valida_productos()
{
if((document.form1.txt_nombre.value=="")|(document.form1.lst_familia.value==0)|(document.form1.txt_precio.value==""))
	{
	alert("Todos los campos (*) son obligatorios.");
	}
else
	{
	var archivo=document.form1.txt_imagen.value;
	extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
	if ((extension != "") & ((extension != ".jpg")) & ((extension != ".gif")))
		{
		alert("La imagen debe ser un archivo .jpg o .gif");
		}
	else
		{
		if (document.form1.txt_id.value!="")
			{
			accion="updt";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'productos',document.form1.txt_nombre.value,id);
			}
		else
			{
			accion="add";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'productos',document.form1.txt_nombre.value,id);
			}
		}
	}
}
function valida_marcas()
{

if ((document.form1.txt_nombre.value==""))
	{
	alert("Debe especificar el nombre de la Familia.");
	}
else
	{
	var archivo=document.form1.txt_imagen.value;
	extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
	if ((extension != "") & ((extension != ".jpg")) & ((extension != ".gif")))
		{
			alert("La imagen debe ser un archivo .jpg o .gif");
		}
	else
		{
		if (document.form1.txt_id.value!="")
			{
			accion="updt";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'familias',document.form1.txt_nombre.value,id);
			}
		else
			{
			accion="add";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'familias',document.form1.txt_nombre.value,id);
			}
		}
	}
}
function valida_descargas(id)
{
var err=0;
if(id==1)
	{
	if(document.form1.txt_guardado.value==""){document.form1.txt_guardado.value=document.form1.txt_archivo.value}
	if ((document.form1.txt_guardado.value=="")|(document.form1.txt_nombre.value==""))
		{
		err=1
		}
	else
		{
		err=0
		}
	}
else
	{
	if ((document.form1.txt_link.value=="")|(document.form1.txt_nombre.value==""))
		{
		err=1
		}
	else
		{
		err=0
		}	
	}
if (err==1)
	{
	alert("Los campos marcados (*) son obligatorios.");
	}
else
	{
	var archivo=document.form1.txt_imagen.value;
	extension = (archivo.substring(archivo.lastIndexOf("."))).toLowerCase(); 
	if ((extension != "") & ((extension != ".jpg")) & ((extension != ".gif")))
		{
		alert("La imagen debe ser un archivo .jpg o .gif");
		}
	else
		{
		if (document.form1.txt_id.value!="")
			{
			accion="updt";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'descargas',document.form1.txt_nombre.value,id);
			}
		else
			{
			accion="add";
			id=document.form1.txt_id.value;
			busca_duplicado(accion,'descargas',document.form1.txt_nombre.value,id);
			}
		}
	}
}
function updt_descargas(foco,valores,tipo)
{
mue_form(foco);
valores=valores.replace(/ª/g,"'");
valores=valores.replace(/ç/g,'"');
arr=valores.split("|");
document.form1.txt_id.value=arr[0];
document.form1.txt_nombre.value=arr[1];
if(tipo==1)
	{
	document.form1.txt_guardado.value=arr[2];
	}
else
	{
	document.form1.txt_link.value=arr[3];
	}
}
function updt_productos(foco,valores,idioma)
{
mue_form(foco);
valores=valores.replace(/ª/g,"'");
valores=valores.replace(/ç/g,'"');
arr=valores.split("|");
document.form1.txt_id.value=arr[0];
document.form1.txt_nombre.value=arr[1];
var can = (document.getElementById('lst_familia').length);
opt='';
if (can>0)
	{
	for (var g=0; g < can;g++)
		 {
		 var tex=document.form1.lst_familia[g].value;
		  if (arr[5]==tex)
		 	{opt=g;}
		 }
	}
if (opt)
	{
	var selObj = document.getElementById('lst_familia');
	selObj.options[opt].selected =opt;
	}
document.form1.txt_precio.value=arr[2];
document.form1.txt_comentario.value=arr[6].replace(/<br>/g,"\r");
document.form1.txt_titulo.value=arr[7];
document.form1.txt_link.value=arr[4];
}
function updt_secciones(foco,valores,idioma)
{
mue_form(foco);
valores=valores.replace(/ª/g,"'");
valores=valores.replace(/ç/g,'"');
arr=valores.split("|");
document.form1.txt_id.value=arr[0];
document.form1.txt_nombre.value=arr[1];
var oEditor = FCKeditorAPI.GetInstance('txt_descripcion');
oEditor.SetHTML (arr[2], true);
document.form1.txt_metatag.value=arr[3];
document.form1.txt_pagtitle.value=arr[4];
//document.form1.txt_imgtitle.value=arr[5];
document.form1.txt_metatag2.value=arr[6];
}
function updt_ofertas(foco,valores,idioma)
{
mue_form(foco);
valores=valores.replace(/ª/g,"'");
valores=valores.replace(/ç/g,'"');
arr=valores.split("|");
document.form1.txt_id.value=arr[0];
document.form1.txt_nombre.value=arr[1];
document.form1.txt_precio.value=arr[2];
document.form1.txt_fecha.value=arr[3];
document.form1.txt_link.value=arr[5];
document.form1.txt_comentario.value=arr[7].replace(/<br>/g,"\r");
document.form1.txt_titulo.value=arr[8];
}
function updt_marcas(foco,valores,idioma)
{
mue_form(foco);
valores=valores.replace(/ª/g,"'");
valores=valores.replace(/ç/g,'"');
arr=valores.split("|");
document.form1.txt_id.value=arr[0];
document.form1.txt_nombre.value=arr[1];
}
function ocu_form()
{
document.getElementById('alta_modi').style.display="none";
document.getElementById('marco').style.display="none";
}
function mue_form(foco)
{
document.getElementById('alta_modi').style.display="block";
document.getElementById(foco).focus();
document.getElementById('marco').style.display="none";
var foto=document.getElementById('tdimg');
if (foto){document.getElementById('tdimg').innerHTML="";}
if (nom_pagina=="media"){document.getElementById('tam').style.display="none";}
if (nom_pagina=='novedades')
	{
	var oEditor = FCKeditorAPI.GetInstance('txt_detalle');
	oEditor.SetHTML ('', true);
	document.forms[0].reset();
	}
	else
	{
	if (nom_pagina=='eventos')
		{
		var oEditor = FCKeditorAPI.GetInstance('txt_descripcion');
		oEditor.SetHTML ('', true);
		}
	else
		{
		if (nom_pagina=='legislacion')
			{
			var oEditor = FCKeditorAPI.GetInstance('txt_descripcion');
		oEditor.SetHTML ('', true);	
			}
		else
			{
			if (nom_pagina=='institutos')
				{
				tinyMCE.getInstanceById('txt_descripcion').setHTML("");
				document.form1.txt_nombre.value="";	
				}
			else
				{
				document.forms[0].reset();
				}
			}
		
		}
	}
}
function mue_form2(tipo)
{
window.open("newsletters.php?id=0&tipo="+tipo, "_parent");
}
function alta_news(val)
{
if (val>-1)
	{
	mue_form('txt_asunto');
	if(val>0){document.form1.txt_id.value=val;}
	}
}
function asignaclase()
{
//if (nom_pagina=='novedades') {document.getElementById('novedades').className = 'current'}
}
function validausu()
{
if ((document.form_usuario.usuario.value=="" )|(document.form_usuario.clave.value==""))
	{
	alert("Debes ingresar el Usuario y la Clave.");
	document.form_usuario.usuario.focus();
	}
else
	{
	document.form_usuario.submit();
	}
}
function intro() 
{
	var x=event.keyCode;
	if (x==13)  
	{
	validausu();
	return true;
	}
}
function intro_forms() 
{
	var x=event.keyCode;
	if (x==13)  
	{
	if (nom_pagina=="clientes"){valida_clientes();}
	if (nom_pagina=="directores"){valida_clientes();}
	if (nom_pagina=="peliculas"){valida_peliculas();}
	if (nom_pagina=="media"){valida_media();}
	if (nom_pagina=="novedades"){valida_novedades();}
	return true;
	}
}
function intro_busca(pagina) 
{
	var x=event.keyCode;
	if (x==13)  
	{
	buscar(pagina);
	return true;
	}
}
function eliminar(cod,tabla,campo,archivo)
{
var eli = confirm("¿Deseas eliminar el Registro?");
if (eli== true)
{
var URL = unescape(location.href);
var xstart = URL.lastIndexOf("/") + 1;
var xend = URL.length;
var pagina = URL.substring(xstart,xend);
pag=pagina.replace(/&/gi,"|");
sql="delete from "+tabla+" where "+campo+"="+cod;
nav=pag.lastIndexOf("totalRows_"+nom_pagina+"=");
caracteres=nom_pagina.length;
if (nav>-1)
	{
	numero=pag.substring(nav+11+caracteres,nav+10+caracteres+3);
	final=parseInt(numero)-1;
	va="totalRows_"+nom_pagina+"="+numero;
	pag=pag.replace(va,"totalRows_"+nom_pagina+"="+final);
	}
window.open('comandos.php?accion=delete&sql='+sql+'&file='+archivo+'&pag='+pag+'&cod='+cod , '_parent');
}
}
function buscar(pagina)
{
if(document.getElementById('txt_busca').value=="")
{
alert("Tienes que ingresar el dato a buscar.");
document.getElementById('txt_busca').focus();
}
else
{
window.open(pagina+'?valor='+document.getElementById('txt_busca').value , '_parent');
}
}
function oculta_submen()
{
document.getElementById('marco').style.display="none";
}
function muestra_submen()
{
document.getElementById('marco').style.display="";
}
function orden(op,campo)
{
obj = document.getElementById(op);
var top=obj.offsetTop;
var left=obj.offsetParent.offsetLeft; 
var query = window.location.search.substring(1);
var esta=document.getElementById('alta_modi').style.display;
tt=document.getElementById('tbl').offsetTop;
ll=document.getElementById('tbl').offsetLeft;
var navegador = navigator.appName; 
if (navegador == "Microsoft Internet Explorer") 
{
document.getElementById('marco').style.left=left+255+ll+'px';
document.getElementById('marco').style.top=tt+200+'px';
}
else 
{
document.getElementById('marco').style.left=left+ll+'px';
document.getElementById('marco').style.top=tt+30+'px';
}
muestra_submen()
col="<div><div id=item><ul><li><a href=javascript:ira('asc','"+campo+"') onclick=oculta_submen()>Ascending Order</a></li></ul></div><div id=item2><ul><li><a href=javascript:ira('desc','"+campo+"')  onclick=oculta_submen()>Descending Order</a></li></ul></div>";
document.getElementById('interior').innerHTML=col;
}
function ira(orden,campo)
{
var URL = unescape(location.href);	
var xstart = URL.lastIndexOf("/") + 1;
var xend = URL.length;
var pagina = URL.substring(xstart,xend);
var query1=pagina.lastIndexOf("?");	
if (query1<0)
	{pag=pagina+"?ord="+orden+"&campo="+campo;}
else
	{
	var inicio=pagina.lastIndexOf("?ord=");	
	if (inicio>0)
		{
			if (orden=='asc') {pag=pagina.replace(/ord=desc/, "ord=asc");}
	    	if (orden=='desc') {pag=pagina.replace(/ord=asc/, "ord=desc");}
		}
	else
		{
		var inicio=pagina.lastIndexOf("&ord=");	
			if (inicio>0)
			{
				if (orden=='asc') {pag=pagina.replace(/ord=desc/, "ord=asc");}
	    		if (orden=='desc') {pag=pagina.replace(/ord=asc/, "ord=desc");}
			}
			else
			{		
			pag=pagina+"&ord="+orden+"&campo="+campo;
			}
		}
	}
var inicio=pag.lastIndexOf("campo=");	
if (inicio>0){pag=pag.substring(0,inicio-1)+"&campo="+campo;}
window.open(pag, '_parent');
}
function control_errores(x,valores)
{
if (x>0){document.getElementById('alta_modi').style.display="";}	
if (x==1)
	{
	val=valores.split("|");
	document.form1.txt_descripcion.value=val[1];
	document.form1.txt_id.value=val[0];
	alert("La imagen no debe superar los "+val[2]+".");
	}
if (x==2)
	{
	alert("El email fué enviado con éxito.");
	}
}
function duplicado_cmd() { 
	if (http.readyState == 4) { 
       if (http.status == 200) { 
          if (http.responseText.indexOf('invalid') == -1) {
			 var a=http.responseText;
			 if (a<1)
			 {
				var URL = unescape(location.href);
				var xstart = URL.lastIndexOf("/") + 1;
				var xend = URL.length;
				var pagina = URL.substring(xstart,xend);
				pag=pagina.replace(/updt=1/, "updt=0");
				pag=pagina.replace(/add=1/, "add=0");
				accion1=pag.lastIndexOf("add");
				accion2=pag.lastIndexOf("updt");
				if (accion1>-1){accion="add"};
				if (accion2>-1){accion="updt"};
				pag=pag.replace(/&/gi,"|");
				nav=pag.lastIndexOf("totalRows_"+nom_pagina+"=");
				caracteres=nom_pagina.length;
				if ((nav>-1) && (document.form1.txt_id.value==""))
					{
						numero=pag.substring(nav+11+caracteres,nav+10+caracteres+3);
						final=parseInt(numero)+1;
						va="totalRows_"+nom_pagina+"="+numero;
						pag=pag.replace(va,"totalRows_"+nom_pagina+"="+final);
					}
					if (document.form1.txt_id.value!="")
						{
						accion="updt_"+nom_pagina+"&id="+document.form1.txt_id.value;
						}
						else
						{
						accion="add_"+nom_pagina;
						}
					document.form1.action="comandos.php?accion="+accion+"&pag="+pag+"&modulos="+modulos;
					document.form1.submit();
			 }
			 else
			 {
				alert("Ya existe un registro similar.");
			 }
			 enProceso = false;
			}
		}
    }
}
function busca_duplicado(comando,modulo,valor,id)
{
if (!enProceso && http) 
	{
   	   var url = "includes/duplicado.php?comando="+comando+"&modulo="+modulo+"&valor="+valor+"&id="+id;
	   http.open("GET", url, true);
	   http.onreadystatechange = duplicado_cmd;
       enProceso = true;
       http.send(null);
    }
}
/***ajax*///
function getHTTPObject()
{
 var xmlhttp = null;
 //Internet Explorer
 try
 {
  xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
 }
 catch (e)
 {
  try
  {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  }
  catch (e)
  {
   xmlhttp = null;
  }
 }

 //Mozilla y Safari

 if ((xmlhttp == null) && (typeof XMLHttpRequest != 'undefined'))
 {
  try
  {
   xmlhttp = new XMLHttpRequest();
  }
  catch (e)
  {
   xmlhttp = null;
  }
 }
 return xmlhttp;
}
var enProceso = false; // lo usamos para ver si hay un proceso activo
var http =  getHTTPObject(); // Creamos el objeto XMLHttpRequest
var nav4 = window.Event ? true : false;
function solonumeros(evt){
// Backspace = 8, Enter = 13, ‘0' = 48, ‘9' = 57, ‘.’ = 46
var key = nav4 ? evt.which : evt.keyCode;
return (key <= 13 || (key >= 48 && key <= 57) || key == 44);
}
function formateo(control)
{
var val=document.getElementById(control).value;
var val=val.replace(".","");
var val=val.replace(".","");
var val=val.replace(".","");
var cant=val.length ;
var esta=val.search(",");
if (esta<0){ 
if (cant==0) document.getElementById(control).value=''; 
if (cant==4) document.getElementById(control).value=val.substr(0,1) + "." + val.substr(1,15); 
if (cant==5) document.getElementById(control).value=val.substr(0,2) + "." + val.substr(2,15);
if (cant==6) document.getElementById(control).value=val.substr(0,3) + "." + val.substr(3,15); 
if (cant==7) document.getElementById(control).value=val.substr(0,1) + "." + val.substr(1,3) + "." + val.substr(4,15); 
if (cant==8) document.getElementById(control).value=val.substr(0,2) + "." + val.substr(2,3) + "." + val.substr(5,15) 
}
}
function save_cancel(x)
{
	if (x==1)
	{
	document.getElementById('save').style.display="";
	document.getElementById('cancel').style.display="";
	document.getElementById('edit').style.display="none";
	document.getElementById('edit1').style.display="none";
	document.getElementById('edit2').style.display="";
	}
	else
	{
	document.getElementById('save').style.display="none";
	document.getElementById('cancel').style.display="none";
	document.getElementById('edit').style.display="";
	document.getElementById('edit1').style.display="";
	document.getElementById('edit2').style.display="none";
	}
}
function musubmen(x)
{
var objeto='submen_'+x;
var img='f_'+x;
if(document.getElementById(objeto).style.display=='none')
	{
	document.getElementById(objeto).style.display="block";
	document.getElementById(img).src='img/f22.gif';
	}
else
	{
	document.getElementById(objeto).style.display="none";
	document.getElementById(img).src='img/f11.gif';
	}
}
function valida_login(pag)
{
if ((document.login.txt_email2.value=="")|(document.login.txt_clave2.value==""))
	{
	alert("Todos los datos  son obligatorios.");
	}
else
	{
	q=document.login.txt_email2.value;
	var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/ ;
	if(b.test(q)==false)
		{
		alert ("La dirección de email es incorrecta");
		}
	else
		{
		document.login.action="cmd.php?comando=login&pag="+pag;
		document.login.submit();
		}
	}
}
function olvide(pag)
{
q=document.login.txt_email22.value;
var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/ ;
if(b.test(q)==false)
	{
	alert ("La dirección de email es incorrecta");
	}
else
	{
	document.login.action="cmd.php?comando=olvide&pag="+pag;
	document.login.submit();
	}
}
