
function ira(donde) {
var strSearch=donde;
parent.location.href=("glosario.asp?search="+strSearch);
}
function Buscar(){
	document.busqueda.submit()
}
function MM_jumpMenu_bol(selObj,restore){ //v3.0
  ira=selObj.options[selObj.selectedIndex].value;
  if (restore) selObj.selectedIndex=0;
  abreWindow(ira)
}

function abreWindowBarras(jc, an, al) {
var iMyWidth;
	var iMyHeight;
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (an/2 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
	iMyHeight = (window.screen.height/2) - (al/2 + 40); //half the screen height minus half the new window height (plus title and status bars).
	var win2 = window.open(jc,"","height="+al+",width="+an+",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=yes" +  ",resizable=no");
	win2.focus();
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function abreWindow_calendario(jc, ventana, an, al, toolbar, location, status, menubar, scrollbars, resizable) {
var iMyWidth;
	var iMyHeight;
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (an + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
	iMyHeight = (window.screen.height/2) - (al + 40); //half the screen height minus half the new window height (plus title and status bars).
	var win2 = window.open(jc, ventana,"height="+al+",width="+an+",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + "toolbar=" + toolbar + "location=" + location + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + "");
	win2.focus();
}
function abreWindow(jc, an, al) {
var iMyWidth;
	var iMyHeight;
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (an/2 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
	iMyHeight = (window.screen.height/2) - (al/2 + 40); //half the screen height minus half the new window height (plus title and status bars).
	var win2 = window.open(jc,"aguaencasa","height="+al+",width="+an+",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no" +  ",resizable=no");
	win2.focus();
}
function abreWindow_n(jc, an, al) {
var iMyWidth;
	var iMyHeight;
	//gets top and left positions based on user's resolution so hint window is centered.
	iMyWidth = (window.screen.width/2) - (an/2 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
	iMyHeight = (window.screen.height/2) - (al/2 + 40); //half the screen height minus half the new window height (plus title and status bars).
	var win3 = window.open(jc,"aguaencasa_n","height="+al+",width="+an+",resizable=no,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",scrollbars=no" +  ",resizable=no");
	win3.focus();
}

function comprobar_datos()
{	
	var vacio=0;

	if (form.txtNombre.value=="")
	{
	alert("El campo Nombre no puede estar vacío");
	vacio=1;
	}else if (form.txtApellidos.value=="")
	{
	alert("El campo Apellidos no puede estar vacío");
	vacio=1;
	}else if (form.txtEdad.value=="")
	{
		alert("El campo Edad no puede estar vacío");
		vacio=1;
	}else if (form.txtEmail.value=="")
	{
		alert("El campo E-mail no puede estar vacío");
		vacio=1;
	}else if (form.login2.value=="")
	{
		alert("El campo Usuario no puede estar vacío");
		vacio=1;
	}else if (form.pass2.value=="")
	{
		alert("El campo contraseña no puede estar vacío");
		vacio=1;
	}else if (form.n_pass.value=="")
	{
		alert("El campo repite contraseña puede estar vacío");
		vacio=1;
	}
	if (form.n_pass.value!=form.pass2.value)
	{
		alert("Las contraseñas deben ser iguales");
		vacio=1;
	}
	
		
	if (vacio!=1)
	{
		form.submit();
	}	
}

function comprobar_formulario()
{	
	var vacio=0;

	if (form.cliente.value=="")
	{
		vacio=1;
	}else if (form.direccion.value=="")
	{
		vacio=1;
	}else if (form.localidad.value=="")
	{
		vacio=1;
	}else if (form.provincia.value=="")
	{
		vacio=1;
	}else if (form.codpostal.value=="")
	{
		vacio=1;
	}else if (form.telefono.value=="")
	{
		vacio=1;
	}else if (form.email.value=="")
	{
		vacio=1;
	}
		
	if (vacio!=1)
	{
		form.submit();
	}else{
		alert("Debes rellenar todos los Datos de Cliente");
	}
}


function comprobar_agua()
{	
	var vacio=0;

	if (agua_comunidad.comunidad.value=="")
	{
	alert("No hay datos para la búsqueda");
	vacio=1;
	}

	if (vacio!=1)
	{
		agua_comunidad.submit();
	}	
		
}
function comprobar_oficinas()
{	
	var vacio=0;

	if (oficinas_comerciales.oficina_comercial.value=="")
	{
	alert("No hay datos para la búsqueda");
	vacio=1;
	}

	if (vacio!=1)
	{
		oficinas_comerciales.submit();
	}	
		
}
function comprobar_usuario()
{	
	var vacio=0;

	if (usuarios_chat.usuchat.value=="")
	{
	alert("Tienes que introducir un nombre de usuario");
	vacio=1;
	}

	if (vacio!=1)
	{
		popupWin = abreWindow("../chat/default.asp?apodo="+usuarios_chat.usuchat.value,"450","350") 	
		
	}	
		
}

function comprobar_usuario()
{	
	var vacio=0;

	if (usuarios_chat.usuchat.value=="")
	{
	alert("Tienes que introducir un nombre de usuario");
	vacio=1;
	}

	if (vacio!=1)
	{
		popupWin = abreWindow("../chat/default.asp?apodo="+usuarios_chat.usuchat.value,"450","350") 	
		
	}	
		
}

