var PanelOne = null; var PanelTwo = null;
if (PanelOne == null) {
    PanelOne = document.getElementById("PanelOneTBL")
}
if (PanelTwo == null) {
    PanelTwo = document.getElementById("PanelTwoTBL")
}

function focusObj(a) {
    if (a.value == a.getAttribute("defValue")) {
        a.value = "";
    }
}

function blurObj(a) {
    if (a.value == "") {
        a.value = a.getAttribute("defValue");
    }
}

function highlight_tocity() {

    if (document.getElementById("toCity").value == "Airport or City") {
        document.getElementById("toCity").style.border = "1px dotted #19ACE2";
        document.getElementById("toCity").value = ""; 
        } 
}

function highlight_fromCity() {

    if (document.getElementById("fromCity").value == "Airport or City") {
        document.getElementById("fromCity").style.border = "1px dotted #19ACE2";
        document.getElementById("fromCity").value = "";
    }
}

function chSearchType(a) {
    debugger;
    switch (a) {

        case "RoundTrip":
//            $("#newdiv").contents().remove();
            $('#newdiv').load('include/roundtrip.html');
						         if (status == "success") {
                            //                            alert("load div");
										
			document.getElementById('ajax_loading').style.display="none";
					 }
//            document.getElementById("ReturnFlightTR3").style.display = "block";
//            document.getElementById("ReturnFlightTR4").style.display = "block";
//            document.getElementById("booking_engine_center").style.background = "transparent url(images/engine_part2_bgd.png)  no-repeat ";
//            document.getElementById("booking_engine_center").style.height = "380px";
            break;
        case "OneWay":
//            $("#newdiv").contents().remove();
            $('#newdiv').load('include/roundtrip.html');     
				document.getElementById('ajax_loading').style.display="none";
            //document.getElementById("SearchTypeOneWay").checked = true;
            //$('#booking_engine_center').load('include/roundtrip.html');
//            document.getElementById("ReturnFlightTR3").style.display = "none";
//            document.getElementById("ReturnFlightTR4").style.display = "none";
//            document.getElementById("booking_engine_center").style.background = "transparent url(images/engine_part2_bgd.png)  no-repeat ";
//            document.getElementById("booking_engine_center").style.height = "380px";
//           
            break;
        case "MultiDestination":
//            $("#newdiv").contents().remove();
            $('#newdiv').load('include/multidestination.html');
//            document.getElementById("booking_engine_center").style.background = "transparent url(images/engine_part2_bgd_large.png) no-repeat ";
//            document.getElementById("booking_engine_center").style.height = "474px";

            break;
    }
}
// How many segment need to display
function newbuildPanelTwo() {
    segTotal = document.forms.AirSearchForm.segCount.value;
    for (var a = 0; a < segTotal; a++) {
        PanelTwo.rows[a].style.display = "block"
    }
}

var dtCh = "/";
var minYear = 1900;
var maxYear = 2100;

function isInteger(s) {
    var i;
    for (i = 0; i < s.length; i++) {
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag) {
    var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++) {
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary(year) {
    // February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28);
}
function DaysArray(n) {
    for (var i = 1; i <= n; i++) {
        this[i] = 31
        if (i == 4 || i == 6 || i == 9 || i == 11) { this[i] = 30 }
        if (i == 2) { this[i] = 29 }
    }
    return this
}

function isDate(dtStr) {
    dtCh = "/";
    var daysInMonth = DaysArray(12)
    var pos1 = dtStr.indexOf(dtCh)
    var pos2 = dtStr.indexOf(dtCh, pos1 + 1)
    var strMonth = dtStr.substring(0, pos1)
    var strDay = dtStr.substring(pos1 + 1, pos2)
    var strYear = dtStr.substring(pos2 + 1)
    strYr = strYear
    if (strDay.charAt(0) == "0" && strDay.length > 1) strDay = strDay.substring(1)
    if (strMonth.charAt(0) == "0" && strMonth.length > 1) strMonth = strMonth.substring(1)
    for (var i = 1; i <= 3; i++) {
        if (strYr.charAt(0) == "0" && strYr.length > 1) strYr = strYr.substring(1)
    }
    month = parseInt(strMonth)
    day = parseInt(strDay)
    year = parseInt(strYr)
    var Error = '';
    var flag = true;
    if (pos1 == -1 || pos2 == -1) {

        flag = false;
    }
    if (strMonth.length < 1 || month < 1 || month > 12) {

        flag = false;
    }
    if (strDay.length < 1 || day < 1 || day > 31 || (month == 2 && day > daysInFebruary(year)) || day > daysInMonth[month]) {

        flag = false;
    }
    if (strYear.length != 4 || year == 0 || year < minYear || year > maxYear) {

        flag = false;
    }
    if (dtStr.indexOf(dtCh, pos2 + 1) != -1 || isInteger(stripCharsInBag(dtStr, dtCh)) == false) {

        flag = false;
    }
    if (flag == true)
        return ''
    else
        return 'Enter Date as mm/dd/yyyy'
}


function ValidateFlightSearch() {
    alert_message = "";
    var flag = true;
    formObj = document.forms["AirSearchForm"];

    if (formObj.searchType[0].checked == true || formObj.searchType[1].checked == true) {
        // start check4_def_val
        if (document.forms["AirSearchForm"].toCity.value == "Airport or City") {


            alert_message += " Please enter destination airport\n";
            flag = false;

        }
        if (document.forms["AirSearchForm"].fromCity.value == "Airport or City") {
            alert_message += " Please enter arrival airport\n";
            flag = false;
        }
        if (flag == false) {
            alert(alert_message);
            return false;
        }
    }


    if (formObj.searchType[2] != null && formObj.searchType[2].checked) {
        if (document.forms.AirSearchForm.toCity_1.value == "Airport or City") {


            alert_message += " Please enter destination airport\n";
            flag = false;

        }
        if (document.forms.AirSearchForm.fromCity_1.value == "Airport or City") {
            alert_message += " Please enter arrival airport\n";
            flag = false;
        }
        if (flag == false) {
            alert(alert_message);
            return false;
        }
    }



    //End check4_def_val


    alert_message = "";

    if (formObj.searchType[0].checked == true || formObj.searchType[1].checked == true) {
        var Error = '';
        if (formObj.flyDate_from.value == "" || formObj.flyDate_from.value == formObj.flyDate_from.getAttribute("defValue"))
            alert_message += " - Departure date\n";


        else if (Error = isDate(formObj.flyDate_from.value)) {
            if (Error != '') {
                alert_message += " - Departure Date - " + Error + "\n";
            }
        }
        if (formObj.searchType[0].checked == true) {

            if (formObj.flyDate_return.value == "" || formObj.flyDate_return.value == formObj.flyDate_return.getAttribute("defValue"))
                alert_message += " - Return date\n";

            else if (formObj.flyDate_from.value != "" && formObj.flyDate_return.value != "" && formObj.flyDate_from.value != formObj.flyDate_from.getAttribute("defValue") && formObj.flyDate_return.value != formObj.flyDate_return.getAttribute("defValue")) {
                Error = '';
                if (Error = isDate(formObj.flyDate_return.value)) {

                    if (Error != '') {
                        alert_message += " - Return Date - " + Error + "\n";
                    }
                }

                if (formObj.flyDate_from.getAttribute("defValue") == "dd/mm/yyyy") {
                    var tmp = formObj.flyDate_from.value.split('/');
                    var flyDate_from;
                    var flyDate_return;

                    if (tmp.length == 3)
                        flyDate_from = tmp[1] + "/" + tmp[0] + "/" + tmp[2];

                    tmp = formObj.flyDate_return.value.split('/');

                    if (tmp.length == 3)
                        flyDate_return = tmp[1] + "/" + tmp[0] + "/" + tmp[2];

                    if (new Date(flyDate_from) > new Date(flyDate_return))
                        alert_message += " - Return date should be greater than departure date\n";


                }
                else {
                    if (new Date(formObj.flyDate_from.value) > new Date(formObj.flyDate_return.value))
                        alert_message += " - Return date should be greater than departure date\n";
                }
            }
        }
    }


    //date validation end


    if (formObj.searchType[2] != null) {

        if (formObj.searchType[2].checked) {
            var isExit = false;
            for (i = 1; i <= document.forms["AirSearchForm"].segCount.value; i++) {
                var Error = '';
                if (formObj["fromCity_" + i].value == "" || formObj["fromCity_" + i].value == "Airport or City") alert_message += " - flight #" + i + " departure city\n";
                if (formObj["toCity_" + i].value == "" || formObj["toCity_" + i].value == "Airport or City") alert_message += " - flight #" + i + " arrival city\n";
                if (formObj["flyDate_" + i].value == "" || formObj["flyDate_" + i].value == formObj["flyDate_" + i].getAttribute("defValue")) alert_message += " - flight #" + i + " departure date\n";

                if (Error = isDate(formObj["flyDate_" + i].value) && formObj["flyDate_" + i].value != "") {
                    if (Error != '') {
                        Error = isDate(formObj["flyDate_" + i].value);
                        alert_message += " - flight #" + i + " departure date - " + Error + "\n";
                    }
                }
                else {
                    if (i > 1) {
                        for (j = 1; j < i; j++) {

                            if (formObj["flyDate_" + i].getAttribute("defValue") == "dd/mm/yyyy") {
                                var tmp = formObj["flyDate_" + i].value.split('/');
                                var flyDate_from;
                                var flyDate_return;

                                if (tmp.length == 3)
                                    flyDate_from = tmp[1] + "/" + tmp[0] + "/" + tmp[2];

                                tmp = formObj["flyDate_" + j].value.split('/');

                                if (tmp.length == 3)
                                    flyDate_return = tmp[1] + "/" + tmp[0] + "/" + tmp[2];

                                if (flyDate_from < flyDate_return && formObj["flyDate_" + i].value != "" && formObj["flyDate_" + i].value != formObj["flyDate_" + i].getAttribute("defValue")) {
                                    isExit = true;
                                    alert_message += " - flight #" + i + " departure date\n";
                                    break;
                                }
                            }
                            else {
                                //alert(formObj["flyDate_" + j].value);

                                if (Date.parse(formObj["flyDate_" + i].value) < Date.parse(formObj["flyDate_" + j].value) && formObj["flyDate_" + i].value != "" && formObj["flyDate_" + i].value != formObj["flyDate_" + i].getAttribute("defValue")) {
                                    isExit = true;
                                    alert_message += " - flight #" + i + " departure date should not be less than - flight #" + j + "\n";
                                    break;
                                }
                            }
                        }
                    }
                    if (isExit) break;
                }

            }
        }
    }
    //date validation end


    if (formObj.searchType[0].checked == false && formObj.searchType[1].checked == false) {
        if (formObj.searchType[2] != null) {
            if (formObj.searchType[2].checked == false) {
                alert("Please choose trip type");
                return false;
            }
        }
        else {
            alert("Please choose trip type");
            return false;
        }
    }
    if (formObj.searchType[0].checked) {
        if (formObj.fromCity.value == "" || formObj.fromCity.value == formObj.fromCity.getAttribute("defValue")) alert_message += " - departure city\n";
        if (formObj.toCity.value == "" || formObj.toCity.value == formObj.toCity.getAttribute("defValue")) alert_message += " - arrival city\n";


    }
    else if (formObj.searchType[1].checked) {
        if (formObj.fromCity.value == "" || formObj.fromCity.value == formObj.fromCity.getAttribute("defValue")) alert_message += " - departure city\n";
        if (formObj.toCity.value == "" || formObj.toCity.value == formObj.toCity.getAttribute("defValue")) alert_message += " - arrival city\n";

    }


    passNum = parseInt(formObj.aCount.value) + parseInt(formObj.cCount.value);
    if (formObj.sCount != null) {
        passNum = passNum + parseInt(formObj.sCount.value);
    }
    if (formObj.yCount != null) {
        passNum = passNum + parseInt(formObj.yCount.value);
    }

    if (passNum == 0) {
        alert_message += " - the number of passengers travelling \n";
    }

    if (alert_message != "") {
        alert("The following information was not provided : \n" + alert_message);
        return false;
    }
	CallOpenPopupforTravelGrove();
    //OpenTravelGrovePopup();
 //Open BookingWiz PopUp
   //OpenBookingWizPopUp();

return true;
}
function CallOpenPopupforTravelGrove() {
    
    var Inputs = document.getElementsByTagName("input");
    var MerchantCodes = "";
    var MerchantNames = "";
    var flag = false;
    for (var j = 0; j < Inputs.length; j++) {
        if (Inputs[j].type == 'checkbox' && Inputs[j].id.indexOf("compSiteChk", 0) >= 0 && Inputs[j].checked) {
			debugger;
            var sName = Inputs[j].id.charAt("compSiteChk".length);
            var strMerchant = document.getElementById("hdnCompSite_" + sName).value;
			var merDetails = strMerchant.split('|');
			if(merDetails.length > 1)
			{
				MerchantCodes += merDetails[0] + ",";            
				MerchantNames += merDetails[1] + ",";
			}
        }
    }


    if (MerchantNames != "" && MerchantCodes != "") {
    
        MerchantNames = MerchantNames.substring(0, MerchantNames.length - 1);
        MerchantCodes = MerchantCodes.substring(0, MerchantCodes.length - 1);
        
        var redirectLink = "http://www.TravelDealsASAP.com/CompareFares.aspx?";
        var formObj = document.forms["AirSearchForm"];
        var trip, fromcity, tocity, fromdate, todate, searchType, process, adults, children, cabinType, str, MerchantNames;
        
        fromcity = formObj.fromCity.value;
        tocity = formObj.toCity.value;
        fromdate = formObj.flyDate_from.value;
        adults = formObj.aCount.value;
        children = formObj.cCount.value;
        cabinType = formObj.prefClass.value;
        if (cabinType == "Economy")
            cabinType = "0";
        else if (cabinType == "Business")
            cabinType = "1";
        else if (cabinType == "First")
            cabinType = "2";

        if (formObj.searchType[0].checked == true) {
            trip = 2;
            todate = formObj.flyDate_return.value;

        }
        else if (formObj.searchType[1].checked == true) {
            trip = 1;
            todate = fromdate;

        }

        str = ("flighttype=" + trip);
        str += ("&city1=" + fromcity);
        str += ("&city2=" + tocity);
        str += ("&date1=" + fromdate);
        str += ("&date2=" + todate);
        str += ("&adults=" + adults);
        str += ("&children=" + children);
        str += ("&class=" + cabinType);
        str += ("&siteNames=" + MerchantNames);
        str += ("&MerchantCodes=" + MerchantCodes);

        var newWin = window.open(redirectLink + str, '', 'height=600,width=800,left=250,scrollbars=yes');
        if (newWin != null) {
            newWin.blur();
        }
        window.focus();

    }

  

}
 function OpenTravelGrovePopup() {

    var redirectLink = "http://www.TravelDealsASAP.com/CompareFares.aspx?";
    var formObj = document.forms["AirSearchForm"];
    var trip, fromcity, tocity, fromdate, todate, searchType, process, adults, children, cabinType, str, siteNames;
    
    siteNames="";
	var Inputs = document.getElementsByTagName("input");
	if(Inputs != 'undefined'){
    for (var j = 0; j < Inputs.length; j++)
    {
        if (Inputs[j].type == 'checkbox' && Inputs[j].id.indexOf("chkCompare", 0) >= 0 && Inputs[j].checked) {
           
               var sName = Inputs[j].id.split('_');
               siteNames += sName[1] + ",";
               
           }
       }
      }
     if(siteNames != "" ) {
	  
			fromcity = formObj.fromCity.value;
			tocity = formObj.toCity.value;
			fromdate = formObj.flyDate_from.value;
			adults = formObj.aCount.value;
			children = formObj.cCount.value;
			cabinType = formObj.prefClass.value;
			
			  if (cabinType == "Economy")
				cabinType = "0";
			else if (cabinType == "Business")
				cabinType = "1";
			else if (cabinType == "First")
				cabinType = "2";
				
			
			if (formObj.searchType[0].checked == true) {
				trip = 2;
				todate = formObj.flyDate_return.value;

			}
			else if (formObj.searchType[1].checked == true) {
				trip = 1;
				todate = fromdate;

			}
    
           siteNames = siteNames.substring(0, siteNames.length - 1);
		   str = ("flighttype=" + trip);
		   str += ("&city1=" + fromcity);
		   str += ("&city2=" + tocity);
		   str += ("&date1=" + fromdate);
		   str += ("&date2=" + todate);
		   str += ("&adults=" + adults);
		   str += ("&children=" + children);
		   str += ("&class=" + cabinType);    
		  str += ("&siteNames=" + siteNames);

			var newWin = window.open(redirectLink + str, '', 'height=600,width=800,left=250,scrollbars=yes');
			if (newWin != null) {
				newWin.blur();
			}
		window.focus();
       }
    
    
    
    
}



function OpenBookingWizPopUp() {

    var trip, fromcity, tocity, fromdate, todate, searchType, process,adults, children,str,segCount;
    var formObj = document.forms["AirSearchForm"];

 //if (formObj.searchType[2].checked == true) OpenCFarePopUP();
   // else {


   // var redirectLink = "http://www.TravelDealASAP/TEmp2.aspx?";
    var redirectLink = "http://www.TravelDealsASAP.com/Deals_top1.aspx?";
    fromcity = formObj.fromCity.value;
    tocity = formObj.toCity.value;
    fromdate = formObj.flyDate_from.value;
    
    adults =formObj.aCount.value; 
    children = formObj.cCount.value;
    
    if (formObj.searchType[0].checked == true) {
        trip = 2;
	  todate = formObj.flyDate_return.value;

    }
   else if (formObj.searchType[1].checked == true) {
        trip = 1;
       todate = fromdate;
    }
	else  if (formObj.searchType[2].checked == true) {
        trip = 2;
		segCount = formObj.segCount.value;
		fromdate = formObj["flyDate_" + 1].value;
		todate = formObj["flyDate_" + segCount].value;	      
		fromcity = formObj["fromCity_" + 1].value;        
        tocity = formObj["fromCity_" + 2].value;
    }
    
    str = ("flighttype=" + trip);
    str += ("&city1=" + fromcity);
    str += ("&city2=" + tocity);
    str += ("&date1=" + fromdate);
    str += ("&date2=" + todate);
    str += ("&adults=" + adults);
    str += ("&children=" + children);

    
    var newWin = window.open(redirectLink + str, '', 'height=600,width=300,scrollbars=yes,left=0');
    newWin.blur();
    window.focus();
   

//}
}





function OpenCFarePopUP() {

    var str, searchType, site,date,segCount,fromcity,fromcities,tocity,tocities,dates;
    site = 'CF';
    searchType = 'MC';
    fromcities = '';
    dates = '';
    tocities = '';

    var formObj = document.forms["AirSearchForm"];
    segCount = formObj.segCount.value;
    
    for (var i = 1; i <= segCount; i++) {

        date = formObj["flyDate_" + i].value;
        dates += date;
        dates += '|';
        
        fromcity = formObj["fromCity_" + i].value;
        fromcities += fromcity;
        fromcities += '|';

        tocity = formObj["toCity_" + i].value;
        tocities += tocity;
        tocities += '|';
    }

    fromcities = fromcities.substring(0, fromcities.length - 1);
    tocities = tocities.substring(0, tocities.length - 1);
    dates = dates.substring(0, dates.length - 1);      
    str += ("&o1=" + fromcities);
    str += ("&hd_o1=" + fromcities);
    str += ("&d1=" + tocities);
    str += ("&hd_d1=" + tocities);
    str += ("&od1=" + dates);
    str += ("&ttype=" + searchType);
    str += ("&site=" + site);   
    
    var newWin = window.open('http://www.TravelDealsASAP.com/Compare.aspx?' + str);
    newWin.blur();
    window.focus();
    
}

	
function Booking_wiz_pop(){



//if((document.AirSearchForm.compare.checked == true)&&(document.AirSearchForm.SearchTypeRoundTrip.checked == true))

//{
	
//Booking_wiz_pop1();Booking_wiz_pop2();Booking_wiz_pop3();		

//var version = navigator.appVersion.toLowerCase();
 // var isIE = ((version.indexOf("msie") != -1) && (version.indexOf("opera") == -1));
  
 // if (isIE) {
//Booking_wiz_pop4();
  //}
//}
}
							
function Booking_wiz_pop1(){

    
        // start check4_def_val

            	var booking_wiz_str ;
		booking_wiz_str ="flighttype=2"+ "&city1=" +document.getElementById('fromCity').value+ "&city2=" +document.getElementById('toCity').value + "&date1=" +document.getElementById('flyDate_from').value+"&date2= "+ document.getElementById('flyDate_return').value+"&adults= 1&children=0";




   window.open('http://www.traveldealsasap.com/Deals_top3.aspx?'+booking_wiz_str ,'tdeal1','width=300,height=600,left=600,top=0').blur();

// Forces the current window to remain on top
window.focus();
	}

	
function Booking_wiz_pop2(){

    
        // start check4_def_val

            	var booking_wiz_str ;
		booking_wiz_str ="flighttype=2"+ "&city1=" +document.getElementById('fromCity').value+ "&city2=" +document.getElementById('toCity').value + "&date1=" +document.getElementById('flyDate_from').value+"&date2= "+ document.getElementById('flyDate_return').value+"&adults= 1&children=0";




   window.open('http://www.traveldealsasap.com/Deals_top1.aspx?'+booking_wiz_str ,'tdeal2','width=300,height=600,left=0,top=0').blur();

// Forces the current window to remain on top
window.focus();
	}

	
function Booking_wiz_pop3(){

    
        // start check4_def_val

            	var booking_wiz_str ;
		booking_wiz_str ="flighttype=2"+ "&city1=" +document.getElementById('fromCity').value+ "&city2=" +document.getElementById('toCity').value + "&date1=" +document.getElementById('flyDate_from').value+"&date2= "+ document.getElementById('flyDate_return').value+"&adults= 1&children=0";




   window.open('http://www.traveldealsasap.com/Deals_top2.aspx?'+booking_wiz_str ,'tdeal3','width=300,height=600,left=300,top=0').blur();

// Forces the current window to remain on top
window.focus();
	}

function Booking_wiz_pop4(){

    	 	  var tmp;
	   	  var  varflyDate_from = document.getElementById('flyDate_from').value;
	   	  tmp=varflyDate_from.split("/");
	  
 var flyDay_from= tmp[1] ;
 var flyYear_from= tmp[2] ;
	  tmp = varflyDate_from.split("/");
	  	 var month1= tmp[0];
	  if (month1=='01') {
	  month1='JAN';
	  }

	  if (month1=='02') {
	  month1='FEB';
	  }

	  if (month1=='03') {
	  month1='MAR';
	  }

	  if (month1=='04') {
	  month1='APR';
	  }

	  if (month1=='05') {
	  month1='MAY';
	  }

	  if (month1=='06') {
	  month1='JUN';
	  }

	  if (month1=='07') {
	  month1='JUL';
	  }

	  if (month1=='08') {
	  month1='AUG';
	  }

	  if (month1=='09') {
	  month1='SEP';
	  }

	  if (month1=='10') {
	  month1='OCT';
	  }

	  if (month1=='11') {
	  month1='NOV';
	  }

	  if (month1=='12') {
	  month1='DEC';
	  }





	  var varflyDate_return = document.getElementById('flyDate_return').value;

	   	  tmp=varflyDate_return .split("/");
	  
 var flyDay_return= tmp[1] ;
 var flyYear_return= tmp[2] ;
  tmp = varflyDate_return.split("/");

	  	 var month2= tmp[0];

	  if (month2=='01') {
	  month2='JAN';
	  }

	  if (month2=='02') {
	  month2='FEB';
	  }

	  if (month2=='03') {
	  month2='MAR';
	  }

	  if (month2=='04') {
	  month2='APR';
	  }

	  if (month2=='05') {
	  month2='MAY';
	  }

	  if (month2=='06') {
	  month2='JUN';
	  }

	  if (month2=='07') {
	  month2='JUL';
	  }

	  if (month2=='08') {
	  month2='AUG';
	  }

	  if (month2=='09') {
	  month2='SEP';
	  }

	  if (month2=='10') {
	  month2='OCT';
	  }

	  if (month2=='11') {
	  month2='NOV';
	  }

	  if (month2=='12') {
	  month2='DEC';
	  }

        // start check4_def_val
flyDay_from= flyDay_from+month1+flyYear_from;
 flyDay_return= flyDay_return+month2+flyYear_return;
 
var getaway_str ;
getaway_str="http://book.getawayasap.com/web/air/default.aspx?siid=7&AirSegCount=2&aCount=1&sCount=0&cCount=0&yCount=0&iSCount=0&iLCount=0&Airline=&Class=Economy&DirectFlight=&Refundable=&AirSeg_1="+  document.getElementById('fromCity').value+ "|" +document.getElementById('toCity').value + "|"  +flyDay_from+"&AirSeg_2=" +document.getElementById('toCity').value + "|" +document.getElementById('fromCity').value+ "|" +flyDay_return;
		

  window.open(getaway_str ,'tdeal4','width=300,height=600,left=0,top=0').blur();

 indow.focus();

 
	}

