// xx xxxxxxxxxxxxx xx
// xx ABRIR POP UPS
// xx xxxxxxxxxxxxx xx

function jsOpenhWnd(u)
{
	p="toolbar=no,height=660,width=380,directories=no,status=no,scrollbars=auto,resizable=no,menubar=no";
	hWnd=window.open(u,"Hwnd",p);
	hWnd.focus();
}

function jsOpenhWndBar(u)
{	//version para barra de desplazamiento
	p="toolbar=no,height=400,width=600,directories=no,status=no,scrollbars=yes,resizable=no,menubar=no";
	hWnd=window.open(u,"Hwnd",p);
	hWnd.focus();
}


// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
// xx MUESTRA/OCULTA LAS ETIQUETAS 'DIV' DE LA CLASE 'hideMe' Y 'showMe' xx
// xx Y CAMBIA EL ATRIBUTO SRC DEL TAG 'img' REFERENCIADO 				 xx
// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx

// Funcion para cambiar la clase de un tag dado (cambia de classa a classb o al reves)
 function classoggle(tag, classa, classb) {
     if (tag.className==classa){
         tag.className=classb;
     } else {
         tag.className=classa;
     }
 }
 
 function visoggle(divID, img) {
     var d = document.getElementById(divID);
     classoggle(d, 'hideMe', 'showMe');
     if (img!=undefined && img != 'null') {
         if (img.src == closePicture){
             img.src = openPicture; 
         } else {
             img.src = closePicture;
         }
     }
 }
 
// Mi invento para las competiciones y alternar con las que tienen noticias
function keepclassoggle(tag1,tag2,classa,classb) {
	
	if (tag1.className==classa){
         tag1.className=classb;
    	 } else {
         tag1.className=classa;
     	}
	tag2.className=classb;	
 }

function keepoggle(divID1,divID2) {
     var d1 = document.getElementById(divID1);
	 var d2 = document.getElementById(divID2);
//	 alert(d1);
//	 alert(d2);
     keepclassoggle(d1,d2,'hideMe','showMe');
}
 
 
// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
// xx VALIDACION DE FORMULARIOS laCala&You xx
// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
 function comprobar_cyou_eng(formulario){
	llegada		=	formulario.arrival.value;
	ida			=	formulario.departure.value;

	if (llegada == ""){
   	alert("Please, insert date of arrival");
   	formulario.arrival.focus();
   	return false;
  	}
 	if (ida == ""){
   	alert("Please, insert date of departure");
   	formulario.departure.focus();
   	return false;
  	}
  return true;
}


// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
// xx VALIDACION GENERAL DE FORMULARIOS nombre, apellido y email xx
// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx

function comprobacion_eng(formulario){
 	elnombre 	= 	formulario.Nombre.value;
	elapellido	=	formulario.Apellido.value;
	elemail		=	formulario.Email.value;

if (elnombre == ""){
	  	alert("Please, insert your name");
   		formulario.Nombre.focus();
   		return false;
  	}
  	if (elapellido == ""){
  	alert("Please, insert your surname");
   	formulario.Apellido.focus();
   	return false;
  	}
 	if (elemail == ""){
   	alert("Please, insert your E-mail");
   	formulario.Email.focus();
   	return false;
  	}

  return true;
}

function comprobacion_esp(formulario){
 	elnombre 	= 	formulario.Nombre.value;
	elapellido	=	formulario.Apellido.value;
	elemail		=	formulario.Email.value;

if (elnombre == ""){
	alert("Introduzca su nombre");
	formulario.Nombre.focus();
	return false;
  	}
  	if (elapellido == ""){
  	alert("Introduzca su apellido");
   	formulario.Apellido.focus();
   	return false;
  	}
 	if (elemail == ""){
   	alert("Introduzca su e-mail");
   	formulario.Email.focus();
   	return false;
  	}

  return true;
}



// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
// xx 		VALIDACION DE FORMULARIOS RESERVAS GOLF  	 xx
// xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
function comprobar_gb_eng(formulario){
  	elnombre 	= 	formulario.Nombre.value;
	elapellido	=	formulario.Apellido.value;
	elemail		=	formulario.Email.value;
	eljugadores = 	formulario.Jugadores.value;
	elhandicap	=	formulario.Handicap.value;
	elfecha		=	formulario.Fecha.value;
	eltelefono	=	formulario.Telefono.value;

	if (elnombre == ""){
	  	alert("Please, insert your name");
   		formulario.Nombre.focus();
   		return false;
  	}
 	if (elapellido == ""){
		alert("Please, insert your surname");
		formulario.Apellido.focus();
		return false;
  	}
  	if (eltelefono == ""){
		alert("Please, insert your telephone number");
		formulario.Telefono.focus();
   		return false;
  	}
	if (elemail == ""){
		alert("Please, insert your E-mail");
		formulario.Email.focus();
  	 	return false;
  	}
	if (eljugadores == ""){
   	alert("Please, insert number of players");
   	formulario.Jugadores.focus();
	   	return false;
  	}
 	if (elhandicap == ""){
   	alert("Please, insert maximum handicap");
   	formulario.Handicap.focus();
	   	return false;
  	}
 	if (elfecha == ""){
   	alert("Please, insert the desired date");
   	formulario.Fecha.focus();
	   	return false;
  	}

//////////////
	var mi_aux=newsInputs;

	jugadores	= new Array();
	handicap	= new Array();
	fecha		= new Array();
	
	for (cont=1 ; cont<(mi_aux+1) ; cont++){
		
		jugadores[cont]		= 	formulario['Jugadores'+cont].value;
		handicap[cont]		=	formulario['Handicap'+cont].value;
		fecha[cont]			=	formulario['Fecha'+cont].value;

						
		if (jugadores[cont] == ""){
						alert("Please, insert number of players for additional tee time");
						formulario['Jugadores'+cont].focus();
						return false;
					}
		if (handicap[cont] == ""){
						alert("Please, insert max. handicap for additional tee time");
						formulario['Handicap'+cont].focus();
						return false;
					}
		if (fecha[cont] == ""){
						alert("Please, insert the desired date for additional tee time");
						formulario['Fecha'+cont].focus();
						return false;
					}
	}
///////////////

return true;
}

function comprobar_gb_esp(formulario){
  	elnombre 	= 	formulario.Nombre.value;
	elapellido	=	formulario.Apellido.value;
	elemail		=	formulario.Email.value;
	eljugadores = 	formulario.Jugadores.value;
	elhandicap	=	formulario.Handicap.value;
	elfecha		=	formulario.Fecha.value;
	eltelefono	=	formulario.Telefono.value;

	if (elnombre == ""){
	  	alert("Introduzca su nombre");
   		formulario.Nombre.focus();
   		return false;
  	}
 	if (elapellido == ""){
		alert("Introduzca su apellido");
		formulario.Apellido.focus();
		return false;
  	}
  	if (eltelefono == ""){
		alert("Introduzca su número de teléfono");
		formulario.Telefono.focus();
   		return false;
  	}
	if (elemail == ""){
		alert("Introduzca su e-mail");
		formulario.Email.focus();
  	 	return false;
  	}
	if (eljugadores == ""){
   	alert("Introduzca el número de jugadores");
   	formulario.Jugadores.focus();
	   	return false;
  	}
 	if (elhandicap == ""){
   	alert("Introduzca el handicap máximo");
   	formulario.Handicap.focus();
	   	return false;
  	}
 	if (elfecha == ""){
   	alert("Introduzca la fecha deseada");
   	formulario.Fecha.focus();
	   	return false;
  	}

//////////////
	var mi_aux=newsInputs;

	jugadores	= new Array();
	handicap	= new Array();
	fecha		= new Array();
	
	for (cont=1 ; cont<(mi_aux+1) ; cont++){
		
		jugadores[cont]		= 	formulario['Jugadores'+cont].value;
		handicap[cont]		=	formulario['Handicap'+cont].value;
		fecha[cont]			=	formulario['Fecha'+cont].value;

						
		if (jugadores[cont] == ""){
						alert("Introduzca el número de jugadores de los tee times adicionales");
						formulario['Jugadores'+cont].focus();
						return false;
					}
		if (handicap[cont] == ""){
						alert("Introduzca el máx. handicap de los tee times adicionales");
						formulario['Handicap'+cont].focus();
						return false;
					}
		if (fecha[cont] == ""){
						alert("Introduzca la fecha de los tee times adicionales");
						formulario['Fecha'+cont].focus();
						return false;
					}
	}
///////////////

return true;
}

function comprobar_gb_deu(formulario){
  	elnombre 	= 	formulario.Nombre.value;
	elapellido	=	formulario.Apellido.value;
	elemail		=	formulario.Email.value;
	eljugadores = 	formulario.Jugadores.value;
	elhandicap	=	formulario.Handicap.value;
	elfecha		=	formulario.Fecha.value;
	eltelefono	=	formulario.Telefono.value;

	if (elnombre == ""){
	  	alert("Please, insert your name");
   		formulario.Nombre.focus();
   		return false;
  	}
 	if (elapellido == ""){
		alert("Please, insert your surname");
		formulario.Apellido.focus();
		return false;
  	}
  	if (eltelefono == ""){
		alert("Please, insert your telephone number");
		formulario.Telefono.focus();
   		return false;
  	}
	if (elemail == ""){
		alert("Please, insert your E-mail");
		formulario.Email.focus();
  	 	return false;
  	}
	if (eljugadores == ""){
   	alert("Please, insert number of players");
   	formulario.Jugadores.focus();
	   	return false;
  	}
 	if (elhandicap == ""){
   	alert("Please, insert maximum handicap");
   	formulario.Handicap.focus();
	   	return false;
  	}
 	if (elfecha == ""){
   	alert("Please, insert the desired date");
   	formulario.Fecha.focus();
	   	return false;
  	}

//////////////
	var mi_aux=newsInputs;

	jugadores	= new Array();
	handicap	= new Array();
	fecha		= new Array();
	
	for (cont=1 ; cont<(mi_aux+1) ; cont++){
		
		jugadores[cont]		= 	formulario['Jugadores'+cont].value;
		handicap[cont]		=	formulario['Handicap'+cont].value;
		fecha[cont]			=	formulario['Fecha'+cont].value;

						
		if (jugadores[cont] == ""){
						alert("Please, insert number of players for additional tee time");
						formulario['Jugadores'+cont].focus();
						return false;
					}
		if (handicap[cont] == ""){
						alert("Please, insert max. handicap for additional tee time");
						formulario['Handicap'+cont].focus();
						return false;
					}
		if (fecha[cont] == ""){
						alert("Please, insert the desired date for additional tee time");
						formulario['Fecha'+cont].focus();
						return false;
					}
	}
///////////////

return true;
}


