/*
	Proposito: Funciones JavaScript para el manejo de objetos de los formularios relacionados con el ṃdulod de echeckin	
	Autor: Milton Salazar M.
	Fecha: 28/Mayo/2007
*/
// valida los campos del control WUC_checkin
/*
function validarFormWUC_checkin(strUrl){
	var parametros="Record=" + document.getElementById("txtPNR_Record").value  + "&primerApellido=" + document.getElementById("txtPrimerApellido").value;
	var strNombreVentana="ProcesarCheckin";
	
	if (document.getElementById("txtPrimerApellido").value==""){
		alert(document.getElementById("txtMensajePrimerApellido_Vacio").value)
		document.getElementById("txtPrimerApellido").focus();
		return;
	}
	else if (document.getElementById("txtPNR_Record").value==""){
		alert(document.getElementById("txtMensajePNRRecord_Vacio").value)
		document.getElementById("txtPNR_Record").focus();
		return;
	}
	else if (document.getElementById("txtPNR_Record").value!="" && document.getElementById("txtPNR_Record").value.length != 6){
		alert('El codigo de Reserva debe contener 6 Caracteres');
		document.getElementById("txtPNR_Record").focus();
		return;
	}
	else{	 
		cargarVentana(strUrl,parametros,strNombreVentana);
	}
}

function cargarVentana(strUrl,parametros,strNombreVentana){
			var strUrl_final=strUrl;
			if (parametros!=""){
				strUrl_final= strUrl_final +  "?" + parametros  ;
			}
			window.location=strUrl_final;
			//var nuevaVentana= window.open(strUrl_final,strNombreVentana,'height=500,width=780,status=yes,toolbar=no,menubar=no,location=no, resizable=yes,top=0,left=0');
			//nuevaVentana.focus();
}

*/

function cargarVentanaNueva(strUrl,parametros,strNombreVentana){
			var strUrl_final=strUrl;
			if (parametros!=""){
				strUrl_final= strUrl_final +  "?" + parametros  ;
			}
			var nuevaVentana= window.open(strUrl_final,strNombreVentana,'height=500,width=780,status=yes,toolbar=no,menubar=no,location=no, resizable=yes,top=0,left=0');
			nuevaVentana.focus();
}

function cargarVentanaItinerario(){
	/*
	var Record= document.getElementById("txtPNR_Record").value;
	var primerApellido=document.getElementById("txtPrimerApellido").value;
	*/
	var Record= document.getElementById("Record").value;
	var primerApellido=document.getElementById("primerApellido").value;
	var strNombreVentana="ProcesarCheckin";
	var strUrl="../echeckin/MostrarItinerarioRecord.aspx?Record="+ Record + "&primerApellido=" + primerApellido;
	return strUrl;
}
function ActualizaSilla(silla) { 
	//retorna el valor al formulario llamador de checkinMostrarMapaSillas.aspx
	window.opener.document.FrmeCheckin.txtSeatMap.value=silla;
	window.close();
}
function procesarCheckin(strRecord,SecuenciaPersona,SecuenciaItinerario){
		window.location="procesarCheckin.aspx?record="+ strRecord + "&secuenciaPersona=" +  SecuenciaPersona + "&secuenciaItinerario=" +  SecuenciaItinerario ;
}
function validarFormulario(){
	boolExito=true;
		if (document.getElementById("txtSeatMap").value==""){
			alert("Debe seleccionar una silla.");
			boolExito=false;
		}
	return boolExito;
}
function CargarMapaSillas(Record,secuenciaPersona,secuenciaItinerario){
			var nuevaVentana= window.open('RedirectMapaSillas.aspx?Record='+ Record + '&secuenciaPersona=' + secuenciaPersona + '&secuenciaItinerario=' + secuenciaItinerario +'&sillaViajero=' +  document.getElementById("txtSeatMap").value  ,'SeatMap','height=500,width=780,status=yes,toolbar=no,menubar=no,location=no, resizable=yes,top=0,left=0');
			nuevaVentana.focus();
}
function MM_openBrWindow(theURL,winName,features) { 

 theURL = theURL + "?Origen="+ window.Form1.ddlOrigen.value + "&Destino=" + window.Form1.ddlDestino.value + "&Fecha=" + window.Form1.ddlFecha.value + "&PNR="+ window.Form1.tbxPNR.value;
 window.open(theURL,winName,features);
}
function CargarValue(strValor, objChecked){	
	document.getElementById("txtIdVuelo").value=strValor;
	objChecked.checked=true;
	SetRadioButtonFalse(objChecked);
}

function SetRadioButtonFalse(ObjSinchecked) {
/*
	Proposito: Pone todos los demas radio buttons de un formulario en False (checked=false) excepto el seleccionado por el usuario
	Autor: Milton Salazar M.
	Fecha: 4/Junio/2007
*/
	for (var i = 0; i < document.forms.length; i++) {
			for(var j = 0; j < document.forms[i].elements.length; j++) {
				var objActual=document.forms[i].elements[j];
				if (objActual.type=="radio"){
					//alert ("radio" + objActual.id + " , " + ObjSinchecked.id );
					if (objActual.id!= ObjSinchecked.id){
						objActual.checked = false;
					}
				}

			}

	}

}

/*
function ValidarFormularioWUC_checkin(objForm){
	if (document.getElementById("primerApellido").value==""){
		return false;
	}
	else if (document.getElementById("Record").value==""){
		return false;
	}
	objForm.action=cargarVentanaItinerario();
	alert (" blnExito ");
	//objForm.submit();
	return true;

}
*/
