	
$(document).ready(function() {
	// Added for ECO Redesign June Rel-4.7 
	
	var gotMPno = null;
	rememberME = getCookie("rememberME");
	
	if (rememberME!= undefined && rememberME=="E") {
		gotMPno = getCookie("rememberEMAIL");
	}
	if (rememberME!= undefined && rememberME=="M") {
		gotMPno = getCookie("getMP");
	}
	
	if (gotMPno != null) {
		$('input:text[class="ecohpCheckin_MpNumber"]').attr('value', gotMPno);	
		$('#remMP').attr('checked', 'checked');
		$('input:password[class="ecohpCheckin_Password"]').attr('value', '');
		$('input:text[class="ecohpCheckin_MpNumber"]').css('color', 'black');
		$('input:password[class="ecohpCheckin_Password"]').css('color', 'black');
	} else {
		$('input:text[class="ecohpCheckin_MpNumber"]').attr('value', '# de Mileage Plus o dirección de correo electrónico');
		$('input:password[class="ecohpCheckin_Password"]').attr('value', 'Password');
		$('input:text[class="ecohpCheckin_MpNumber"]').css('color', 'gray');
		$('input:password[class="ecohpCheckin_Password"]').css('color', 'gray');
	}
	
	// script for displaying check-in text when check-in type is selected
	
	// On Focus Events
	$('#ci_searchValueId').focus(function(){
		if($(this).val() == 'Código de confirmación o # de E-Ticket'){
			$(this).attr({ value: ''});
			$(this).css({color:'black'});
			$('input:text[id="ci_searchValueId"]').css('border-color', '#AABDCE');
		} else if($(this).val() == '# de tarjeta de crédito'){
			$(this).attr({ value: ''});
			$(this).css({color:'black'});
			$('input:text[id="ci_searchValueId"]').css('border-color', '#AABDCE');
		} 
	});
	$('.ecohpCheckin_ccpnrLastName').focus(function(){
		if($(this).val() == 'Apellido'){
			$(this).attr({ value: ''});
			$(this).css({color:'black'});
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').css('border-color', '#AABDCE');
		}
	});

	$('.ecohpCheckin_MpNumber').focus(function(){
		if($(this).val() == '# de Mileage Plus o dirección de correo electrónico'){
			$(this).attr({ value: ''});
			$(this).css({color:'black'});
			$('input:text[class="ecohpCheckin_MpNumber"]').css('border-color', '#AABDCE');
		}
	});
	$('.ecohpCheckin_Password').focus(function(){
		if($(this).val() == 'Password' || $(this).val() == ''){
			$(this).attr({ value: ''});
			$(this).css({color:'black'});
			$('input:password[class="ecohpCheckin_Password"]').css('border-color', '#AABDCE');
		}
	});
	
	// On Blur Events
	$('#ci_searchValueId').blur(function(){
		if($(this).val() == ''){			
			if(document.getElementById("Checkin_type").selectedIndex == 2 ){
				$(this).attr({ value: '# de tarjeta de crédito'});
				$(this).css({color:'gray'});
				$('input:text[id="ci_searchValueId"]').css('border-color', '#AABDCE');
			} else{
				$(this).attr({ value: 'Código de confirmación o # de E-Ticket'});
				$(this).css({color:'gray'});
				$('input:text[id="ci_searchValueId"]').css('border-color', '#AABDCE');
			}
		} 
	});
	
	$('.ecohpCheckin_ccpnrLastName').blur(function(){
		if($(this).val() == ''){
			$(this).attr({ value: 'Apellido'});
			$(this).css({color:'gray'});
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').css('border-color', '#AABDCE');
		}
	});

	$('.ecohpCheckin_MpNumber').blur(function(){
		if($(this).val() == ''){
			$(this).attr({ value: '# de Mileage Plus o dirección de correo electrónico'});
			$(this).css({color:'gray'});
			$('input:text[class="ecohpCheckin_MpNumber"]').css('border-color', '#AABDCE');
		}
	});
	
	$('.ecohpCheckin_Password').blur(function(){
		if($(this).val() == ''){
			$(this).attr({ value: 'Password'});
			$(this).css({color:'gray'});
			$('input:password[class="ecohpCheckin_Password"]').css('border-color', '#AABDCE');
		}
	});
	
	if(document.getElementById('help')){document.getElementById('help').style.display="block";}
	if(document.getElementById('help_cc')){document.getElementById('help_cc').style.display="none";}
});
	
function checkin_type(check_ID, Check_Val){

	var gotMPno = null;
	rememberME = getCookie("rememberME");
	
	if (rememberME!= undefined && rememberME=="E") {
		gotMPno = getCookie("rememberEMAIL");
	}
	if (rememberME!= undefined && rememberME=="M") {
		gotMPno = getCookie("getMP");
	}
	
	if(check_ID == 'Checkin_type'){
		if(Check_Val == 'Checkin_1'){
			//document.getElementById('Checkin_type').selectedIndex  = 0;
			document.getElementById('Confirm_CrdCard').style.display  = "none";
			/* document.getElementById('Creditcard').style.display  = "block"; */
			document.getElementById('MileagePlus_email').style.display  = "block";
			
			if (gotMPno != null) {
				document.getElementById('ecoText1').value=gotMPno;			
				document.getElementById('remMP').checked=true;
				$('input:text[class="ecohpCheckin_MpNumber"]').css('border-color', '#AABDCE');
				$('input:password[class="ecohpCheckin_Password"]').css('border-color', '#AABDCE');
				$('input:password[class="ecohpCheckin_Password"]').attr('value', '');
				$('input:text[class="ecohpCheckin_MpNumber"]').css('color', 'black');
				$('input:password[class="ecohpCheckin_Password"]').css('color', 'black');
			} else {
				$('input:text[class="ecohpCheckin_MpNumber"]').css('border-color', '#AABDCE');
				$('input:password[class="ecohpCheckin_Password"]').css('border-color', '#AABDCE');
				$('input:text[class="ecohpCheckin_MpNumber"]').attr('value', '# de Mileage Plus o dirección de correo electrónico');
				$('input:password[class="ecohpCheckin_Password"]').attr('value', 'Password');
				$('input:text[class="ecohpCheckin_MpNumber"]').css('color', 'gray');
				$('input:password[class="ecohpCheckin_Password"]').css('color', 'gray');
			}
		}
		else if(Check_Val == 'Checkin_2'){
			document.getElementById('MileagePlus_email').style.display  = "none";
			//document.getElementById('Checkin_type').selectedIndex  = 1;
			document.getElementById('Confirm_CrdCard').style.display  = "block";
			
			$('input:text[id="ci_searchValueId"]').css('border-color', '#AABDCE');
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').css('border-color', '#AABDCE');
			$('input:text[id="ci_searchValueId"]').attr('value', 'Código de confirmación o # de E-Ticket');
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').attr('value', 'Apellido');
			$('input:text[id="ci_searchValueId"]').css('color', 'gray');
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').css('color', 'gray');
			$('input:hidden[id="ci_cc"]').attr('value', 'pnr');
			$('input:hidden[id="ci_cc"]').attr('id', 'ci_pnr');
			if(document.getElementById('help')){document.getElementById('help').style.display="block";}
			if(document.getElementById('help_cc')){document.getElementById('help_cc').style.display="none";}
			}
		else if(Check_Val == 'Checkin_3'){
			document.getElementById('MileagePlus_email').style.display  = "none";
			//document.getElementById('Checkin_type').selectedIndex  = 2;
			document.getElementById('Confirm_CrdCard').style.display  = "block";
						
			$('input:text[id="ci_searchValueId"]').css('border-color', '#AABDCE');
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').css('border-color', '#AABDCE');
			$('input:text[id="ci_searchValueId"]').attr('value', '# de tarjeta de crédito');
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').attr('value', 'Apellido');
			$('input:text[id="ci_searchValueId"]').css('color', 'gray');
			$('input:text[class="ecohpCheckin_ccpnrLastName"]').css('color', 'gray');
			$('input:hidden[id="ci_pnr"]').attr('value', 'cc');
			$('input:hidden[id="ci_pnr"]').attr('id', 'ci_cc');
			if(document.getElementById('help')){document.getElementById('help').style.display="none";}
			if(document.getElementById('help_cc')){document.getElementById('help_cc').style.display="block";}
		}
		
	}
}