﻿// JScript File

 $(document).ready(function(){
     
     
     
    ////////////////////START CODE FOR AUTOCOMPLETE////////////////// 
    $("#FromSector2").autocomplete('CityAutoComplete.aspx');
    $("#ToSector2").autocomplete('CityAutoComplete.aspx');
     $("#FromSector").autocomplete('CityAutoComplete.aspx');
      $("#ToSector").autocomplete('CityAutoComplete.aspx');
      $("#Prefair1").autocomplete('FlightAutoComplete.aspx');
      $("#Prefair2").autocomplete('FlightAutoComplete.aspx');
      $("#Prefair3").autocomplete('FlightAutoComplete.aspx');
      $("#City").autocomplete('IntlGetCity.aspx');
      
//      $("#pinid1").autocomplete('rechargepin.aspx');
     
      
    ////////////////////END CODE FOR AUTOCOMPLETE////////////////// 
    
     
 ////////////////////START CODE FOR Clear Text////////////////// 
   $('#FromSector2').click(function(){
   $('#FromSector2').val("");
   });
   
   $('#ToSector2').click(function(){
   $('#ToSector2').val("");
   });
   $('#Prefair1').click(function(){
   $('#Prefair1').val("");
   });
   $('#Prefair2').click(function(){
   $('#Prefair2').val("");
   });
   $('#Prefair3').click(function(){
   $('#Prefair3').val("");
   });
    $('#DepartDate').click(function(){
   $('#DepartDate').val("");
   });
    $('#DepartDate').click(function(){
   $('#DepartDate').val("");
   });
    $('#City').click(function(){
   $('#City').val("");
   });
    $('#pinid1').click(function(){
   $('#pinid1').val("");
   });
   
    
//     $('#DepartDate').clear();
      $("#DepartDate").val('');
      $("#ReturnDate").val('');
      $("#buscal").val('');
       $("#showtabpin").hide();
         $("#showtabvalue").hide();
         $("#showtabbill ").hide();
         $("#Depart2").val('');
         $("#Back2").val('');
         
         

     //////////////////// filling values into dropdown ////////
     
 document.getElementById("Adults1").options.length=0;
   var numbers=new Array(1,2,3,4,5,6,7,8,9);
   
//     $('#Rooms').append('<option>select</option>');   
   $.each(numbers, function(val,text){       
     $('#Adults1').append('<option value='+text+'>'+text+'</option>');       
    });
    
    document.getElementById("Children1").options.length=0;
   var numbers=new Array(0,1,2,3,4);
   
   $.each(numbers, function(val,text){       
     $('#Children1').append('<option value='+text+'>'+text+'</option>');       
    });
    document.getElementById("Infant1").options.length=0;
   var numbers=new Array(0,1,2,3,4);
   
   $.each(numbers, function(val,text){       
     $('#Infant1').append('<option value='+text+'>'+text+'</option>');       
    });
    document.getElementById("Adults2").options.length=0;
   var numbers=new Array(1,2,3,4,5,6,7,8,9);
   
//     $('#Rooms').append('<option>select</option>');   
   $.each(numbers, function(val,text){       
     $('#Adults2').append('<option value='+text+'>'+text+'</option>');       
    });
    
    document.getElementById("Children2").options.length=0;
   var numbers=new Array(0,1,2,3,4);
   
   $.each(numbers, function(val,text){       
     $('#Children2').append('<option value='+text+'>'+text+'</option>');       
    });
    document.getElementById("Infant2").options.length=0;
   var numbers=new Array(0,1,2,3,4);
   
   $.each(numbers, function(val,text){       
     $('#Infant2').append('<option value='+text+'>'+text+'</option>');       
    });
  
  
    $('#FromSectorhtm').append('<option value="">' + "............" + '</option>');
      $('#ToSectorhtm1').append('<option value="">' + "............" + '</option>');
    var numbers=new Array("Bangalore~Bangalore-BLR","Mumbai~Mumbai-BOM", "Kolkata~Kolkata-CCU","Delhi~Delhi-DEL","Goa~Goa-GOI","Hyderabad~Hyderabad-HYD","Chennai~Chennai-MAA","Pune~Pune-PNQ","-------------------- ~ ");
   
     
   $.each(numbers, function(val,text){
// for ( i=0; i<=  numbers.length ; i++)
// {
   var val1= text.split('~');
  var myval1= val1[0];
  var myval2= val1[1];
  
      $('#FromSectorhtm').append('<option value='+ myval2 +'>' + myval1 + '</option>');
      $('#ToSectorhtm1').append('<option value='+ myval2 +'>' + myval1 + '</option>');
       
//       }    
   });
    $.get("domesticdata.aspx", function(data){
    var mycity= data.split('~');
//    var mycity1 = mycity.split('');

//    alert(mycity);
     $.each(mycity, function(val,text){
     var mydata= text.split('*');
     var city= mydata[0];
     var code = mydata[1];
 $('#FromSectorhtm').append('<option value='+code+'>'+city+'</option>');
 $('#ToSectorhtm1').append('<option value='+code+'>'+city+'</option>');
   
});
   
//    
//    $("#FromSectorhtm").click(function(){
//    $.get("domesticdata.aspx", function(data){
//    alert(data);
//    
//    });
//     )};
   
      
//   if($('#Oneway1').attr('checked'))
//   {
//      
//   $('#ret1').hide();
// $('#Back1').hide();
//   
//   } 
   ////////////////////End CODE FOR Clear Text////////////////// 
   
   
    
     ////////////////////START CODE FOR CALANDER////////////////// 
   
    $('#Depart2').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var start = $(this).datepicker('getDate');
		$('#Back2').datepicker('option', 'minDate', new Date(start.getTime()) );
    	    }
     });

    $('#Back2').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var end = $(this).datepicker('getDate');
		$('#Depart2').datepicker('option', 'maxDate', new Date(end.getTime()) );
	    }
    });
     $('#Depart1').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var start = $(this).datepicker('getDate');
		$('#Back1').datepicker('option', 'minDate', new Date(start.getTime()) );
    	    }
     });

    $('#Back1').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var end = $(this).datepicker('getDate');
		$('#Depart1').datepicker('option', 'maxDate', new Date(end.getTime()) );
	    }
    });
    $('#Depart').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var start = $(this).datepicker('getDate');
		$('#Back').datepicker('option', 'minDate', new Date(start.getTime()) );
    	    }
     });

    $('#Back').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var end = $(this).datepicker('getDate');
		$('#Depart').datepicker('option', 'maxDate', new Date(end.getTime()) );
	    }
    });
//        var $j =jQuery.noConflict();  
    $('#DepartDate').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var start = $(this).datepicker('getDate');
		
		$('#ReturnDate').datepicker('option', 'minDate', new Date(start.getTime()) );
    	    }
     });

    $('#ReturnDate').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var end = $(this).datepicker('getDate');
		var date2 = $("#DepartDate").datepicker('getDate');
		 var dayDiff = Math.ceil((end - date2) / (1000 * 60 * 60 * 24));
		 $("#noNight").val(dayDiff);
         
		$('#DepartDate').datepicker('option', 'maxDate', new Date(end.getTime()) );
	    }
    });
     $('#DateEnrolled').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var start = $(this).datepicker('getDate');
		$('#DateEnrolled2').datepicker('option', 'minDate', new Date(start.getTime()) );
    	    }
     });

    $('#DateEnrolled2').datepicker({minDate:0,dateFormat:'dd/mm/yy',numberOfMonths: 3,
			showButtonPanel: true,
	onSelect: function (selectedDateTime){
		var end = $(this).datepicker('getDate');
		$('#DateEnrolled').datepicker('option', 'maxDate', new Date(end.getTime()) );
	    }
    });
    
    
     $('#buscal').datepicker({minDate:0,numberOfMonths: 3,
			showButtonPanel: true,dateFormat:'dd/mm/yy'});
    
   ////////////////////END CODE FOR CALANDER////////////////// 
  

   //////////////////////Toggle FOR NarrowSearch1////////////////////////
    $('#NarrowSearch').hide();
    
    $('#Narrow').click(function(){
         $('#NarrowSearch').toggle();
   });
   
   $('#NarrowSearch1').hide();
   
    $('#Narrow1').click(function(){
        $('#NarrowSearch1').toggle();
   });
  
   $('#tabs-5').hide();
   $('#rechargeM').hide();
   
   
    $('#Oneway1').click(function(){
    
        $('#ret1').toggle();
   });
   $('#ret1').show();
   
    $('#Oneway2').click(function(){
        $('#ret2').toggle();
   });
   
   
//    $('#lccroundfares').click(function(){
//          $('#ret1').show();
//   });
   

//   $("#lccroundfares").click(function () {
//   
//   $("#lccroundfares").attr("checked", true);
//$("#Oneway1").removeAttr("checked", false);
//$('#ret1').show();
// $('#Back1').show();
// 

//         
//});
  $("#Oneway1").click(function () {
  
//  alert($('#Oneway1').attr('checked'));
   if($('#Oneway1').attr('checked'))
   {
     
//   alert("yes");
    $("#lccroundfares").attr("checked", false);
    $('#ret1').hide();
    //$('#Back1').hide();
   }
   else
   {
//   alert("No");
   //$("#Oneway1").attr("checked", true);
    //$("#lccroundfares").removeAttr("checked", false);
    $('#ret1').show();
    //$("#lccroundfares").removeAttr("checked", false);
//    $("#lccroundfares").attr("checked", true);
    //$('#Back1').hide();
    }


  // alert($('input:checkbox:checked').val());
//  var buttonsChecked = $('Oneway1:checked');
//            if (buttonsChecked.length) {
//                $('#Oneway1').removeAttr('enabled');
//                  $('#Oneway2').hide();
//                } 
//            else {
//                $('#Oneway1').attr('enabled', 'enabled');
//                }
//            $('#ret1').show();
  });
 $("#lccroundfares").click(function () {
   if($('#lccroundfares').attr('checked'))
     {
          
//  $("#lccroundfares").attr("checked", false);
  $("#Oneway1").attr("checked", false);
    $('#ret1').show();
    
   }
   else 
   {
      
//   $("#lccroundfares").attr("checked", true);
  
    $("#Oneway1").attr("checked", true);
    $('#ret1').hide();
   }
      
});


     

$('#fromsec').click(function(){
var selectitem=document.getElementById('fromsec');
                $.get("CityAutoComplete.aspx",function(data) {   
				//alert(data);
				var arrdata=data.split(',')
				
				
	                selectitem.options.length = 0;
	                for (var count = 0; count < arrdata.length; count++)
	                { 
                         //alert(arrdata[count]);
	                     //alert(arrdata[count+1]);
                	     textValue = arrdata[count+1];
   		                 textValue1 =arrdata[count]
   		                 count++;
   		                optionItem = new Option (textValue, textValue1,  false, false);
		                selectitem.options[selectitem.length] = optionItem;
   		            }

			
        });
        });
          
   
   
   //////////////////////Toggle////////////////////////
   //////////////////////hiding <tr>////////////////////////
   $('.trhideclass1').show();
   $('.trhideclass2').hide();
   $('.trhideclass3').hide();
   $('.trhideclass4').hide();
   //////////////////////showing  <tr> on dropdown value change////////////////////////
   
    $("#Rooms").click(function(){
    
    var ddlSelectedvalue = $('#Rooms').get(0).selectedIndex;       
           
            switch (ddlSelectedvalue) {
            
                case 0:
                     
                    $('.trhideclass1').show();
                    $('.trhideclass2').hide();
                    $('.trhideclass3').hide();
                    $('.trhideclass4').hide();
                    
                    break;
                case 1:
                  
                    $('.trhideclass1').show();
                    $('.trhideclass2').show();
                    $('.trhideclass3').hide();
                    $('.trhideclass4').hide();
                    break;
                    case 2:
                 
                    $('.trhideclass1').show();
                    $('.trhideclass2').show();
                    $('.trhideclass3').show();
                    $('.trhideclass4').hide();
                    break;
                     case 3:
                   
                    $('.trhideclass1').show();
                    $('.trhideclass2').show();
                    $('.trhideclass3').show();
                    $('.trhideclass4').show();
                    break;
                    
                    default :
                    $('.trhideclass1').show();
                    $('.trhideclass2').hide();
                    $('.trhideclass3').hide();
                    $('.trhideclass4').hide();
                    
                    break;
                    
            }
    
    });
      
         
   ///////////////// Adding values in dropdown on changing values in one dropdown//////////////
   
   
    $("#Child1").click(function(){

    var ddlSelectedvalue = $('#Child1').get(0).selectedIndex; 
          
            switch (ddlSelectedvalue) {
         
                case 1:
                     
                    $('#Child1Age1').show();
                    $('#Child1Age2').hide();
                    $('#Child1Age3').hide();
                    
                    break;
                case 2:
                    
                     $('#Child1Age1').show();
                    $('#Child1Age2').show();
                    $('#Child1Age3').hide();
                    
                    break;
                    case 3:
                   
                     $('#Child1Age1').show();
                    $('#Child1Age2').show();
                    $('#Child1Age3').show();
                    
                    break;
                     default:
                   
                     $('#Child1Age1').hide();
                    $('#Child1Age2').hide();
                    $('#Child1Age3').hide();
                    
                    break;                 
                    
                    
            
    
    }
      
   }); 
    
   $("#Child2").click(function(){

    var ddlSelectedvalue = $('#Child2').get(0).selectedIndex; 
          
            switch (ddlSelectedvalue) {
         
                case 1:
                     
                    $('#Child2Age1').show();
                    $('#Child2Age2').hide();
                    $('#Child2Age3').hide();
                    
                    break;
                case 2:
                    
                     $('#Child2Age1').show();
                    $('#Child2Age2').show();
                    $('#Child2Age3').hide();
                    
                    break;
                    case 3:
                   
                     $('#Child2Age1').show();
                    $('#Child2Age2').show();
                    $('#Child2Age3').show();
                    
                    break;
                     default:
                   
                     $('#Child2Age1').hide();
                    $('#Child2Age2').hide();
                    $('#Child2Age3').hide();
                    
                    break;                 
                    
                    
            
    
    }
      
   }); 
    $("#Child3").click(function(){

    var ddlSelectedvalue = $('#Child3').get(0).selectedIndex; 
          
            switch (ddlSelectedvalue) {
         
                case 1:
                     
                    $('#Child3Age1').show();
                    $('#Child3Age2').hide();
                    $('#Child3Age3').hide();
                    
                    break;
                case 2:
                    
                     $('#Child3Age1').show();
                    $('#Child3Age2').show();
                    $('#Child3Age3').hide();
                    
                    break;
                    case 3:
                   
                     $('#Child3Age1').show();
                    $('#Child3Age2').show();
                    $('#Child3Age3').show();
                    
                    break;
                     default:
                   
                     $('#Child3Age1').hide();
                    $('#Child3Age2').hide();
                    $('#Child3Age3').hide();
                    
                    break;                 
                                   
            
    
    }
      
   }); 
     
    $("#Child4").click(function(){

    var ddlSelectedvalue = $('#Child4').get(0).selectedIndex; 
          
            switch (ddlSelectedvalue) {
         
                case 1:
                     
                    $('#Child4Age1').show();
                    $('#Child4Age2').hide();
                    $('#Child4Age3').hide();
                    
                    break;
                case 2:
                    
                     $('#Child4Age1').show();
                    $('#Child4Age2').show();
                    $('#Child4Age3').hide();
                    
                    break;
                    case 3:
                   
                     $('#Child4Age1').show();
                    $('#Child4Age2').show();
                    $('#Child4Age3').show();
                    
                    break;
                     default:
                   
                     $('#Child4Age1').hide();
                    $('#Child4Age2').hide();
                    $('#Child4Age3').hide();
                    
                    break;                 
          
    
    }
      
   });   
     
    
 
     });
     
   
   
 ///////////////Hotel Load///////////////////
       
      $(document).ready(function(){
   
     //$("#HotelLoad").click(function(){

      
   var numbers=new Array(1,2,3,4);
   
//     $('#Rooms').append('<option>select</option>');   
   $.each(numbers, function(val,text){       
     $('#Rooms').append('<option value='+text+'>'+text+'</option>');       
    });
    
     
          
  var numbers=new Array(1,2,3,4,5);
   
     $('#StarRating').append('<option value="0">All</option>');   
   $.each(numbers, function(val,text){       
     $('#StarRating').append('<option value='+text+'>'+text+'</option>');       
    });
   
     $('#Child1Age1').hide();
   $('#Child1Age2').hide();
   $('#Child1Age3').hide();
    $('#Child2Age1').hide();
   $('#Child2Age2').hide();
   $('#Child2Age3').hide();
    $('#Child3Age1').hide();
   $('#Child3Age2').hide();
   $('#Child3Age3').hide();
    $('#Child4Age1').hide();
   $('#Child4Age2').hide();
   $('#Child4Age3').hide();
        
   
  }); 
   var numbers=new Array("Single (Sleeps 1)-SB","Double (Sleeps 2)-DB","Triple Bed (Sleeps 3)-TR","Quad (Sleeps 4)-QD","Twin (Sleeps 2)-TB","Twin for sole use (Sleeps 1)-TS","Double + Child (Over 2 Yrs)-DBC","Twin + Child (Over 2 Yrs)-TBC");
 
//     $('#Room_Type1').append('<option>select</option>');
//      $('#Room_Type2').append('<option>select</option>'); 
//       $('#Room_Type3').append('<option>select</option>'); 
//        $('#Room_Type4').append('<option>select</option>');    
   $.each(numbers, function(val,text){
         
         var val=text.split('-');
         var val1=val[0];
         var val2=val[1];
     $('#Room_Type1').append('<option value='+val2+'>'+val1+'</option>');
     $('#Room_Type2').append('<option value='+val2+'>'+val1+'</option>');
     $('#Room_Type3').append('<option value='+val2+'>'+val1+'</option>');
     $('#Room_Type4').append('<option value='+val2+'>'+val1+'</option>');       
    });
    
     var numbers=new Array(2,3,4);
   var i=0;
     $('#Adult1').append('<option value="1">1</option>'); 
     $('#Adult2').append('<option value="1">1</option>'); 
     $('#Adult3').append('<option value="1">1</option>'); 
     $('#Adult4').append('<option value="1">1</option>');   
   $.each(numbers, function(val,text){       
     $('#Adult1').append('<option value='+text+'>'+text+'</option>');
     $('#Adult2').append('<option value='+text+'>'+text+'</option>');
     $('#Adult3').append('<option value='+text+'>'+text+'</option>');
     $('#Adult4').append('<option value='+text+'>'+text+'</option>');       
    });
    
     var numbers=new Array(1,2,3);

     $('#Child1').append('<option value="0">0</option>'); 
     $('#Child2').append('<option value="0">0</option>'); 
     $('#Child3').append('<option value="0">0</option>'); 
     $('#Child4').append('<option value="0">0</option>');   
   $.each(numbers, function(val,text){       
     $('#Child1').append('<option value='+text+'>'+text+'</option>');
     $('#Child2').append('<option value='+text+'>'+text+'</option>');
     $('#Child3').append('<option value='+text+'>'+text+'</option>');
     $('#Child4').append('<option value='+text+'>'+text+'</option>');       
    });
    ///////////// code for filling child age///////////////////////
     var numbers=new Array(2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18);

           $.each(numbers, function(val,text){
         $('#Child1Age1').append('<option value='+text+'>'+text+'</option>');
          $('#Child1Age2').append('<option value='+text+'>'+text+'</option>');
           $('#Child1Age3').append('<option value='+text+'>'+text+'</option>');
           $('#Child2Age1').append('<option value='+text+'>'+text+'</option>');
           $('#Child2Age2').append('<option value='+text+'>'+text+'</option>');
           $('#Child2Age3').append('<option value='+text+'>'+text+'</option>');
           $('#Child3Age1').append('<option value='+text+'>'+text+'</option>');
            $('#Child3Age2').append('<option value='+text+'>'+text+'</option>');
             $('#Child3Age3').append('<option value='+text+'>'+text+'</option>');
              $('#Child4Age1').append('<option value='+text+'>'+text+'</option>');
              $('#Child4Age2').append('<option value='+text+'>'+text+'</option>');
               $('#Child4Age3').append('<option value='+text+'>'+text+'</option>');
             
             
//    });
         
});
   
    ///////////////Hotel Load END///////////////////
 
     /////////////////////filling values in dropdown using database/////////////////////
     
//$(document).ready(function(){
////var url: "BusSearchForm.aspx" 
//$("#FromSectorhtm").click(function(){
//    $.get("domesticdata.aspx", function(data){
//    var mycity= data.split('~');
////    var mycity1 = mycity.split('');

////    alert(mycity);
//     $.each(mycity, function(val,text){
//     var mydata= text.split('*');
//     var city= mydata[0];
//     var code = mydata[1];
// $('#FromSectorhtm').append('<option value='+code+'>'+city+'</option>');
// $('#ToSectorhtm1').append('<option value='+code+'>'+city+'</option>');
//   
//});
//    
//    });
//   });
//$("#BusLoad").click(function(){
$.get("busdata.aspx", function(data){
$('#busfromsec').append('<option>Select</option>'); 
$('#bustosec').append('<option>Select</option>'); 
var mydata = data.split('~'); 

$.each(mydata, function(val,text){
 
 $('#busfromsec').append('<option value='+text+'>'+text+'</option>');
 $('#bustosec').append('<option value='+text+'>'+text+'</option>');
   
});
//});
});

//$.get("busdata.aspx", function(data){

//var mydata = data.split('~'); 

//$.each(mydata, function(val,text){
// 
// 
//   
//});
//});

$("#busfromsec").change(function(){
document.getElementById("bustosec").options.length=0;
  //$('#bustosec').options.length=0;
 
var str= $('#busfromsec').val();

 $.get("busdata.aspx?mydata1='" + str + "'", function(data){
 
 var mydata = data.split('*');
 
 $.each(mydata, function(val,text){
 
 $('#bustosec').append('<option value='+text+'>'+text+'</option>');
   
});

 
});

});

   
  
$("#mypin").click(function(){
 
 $("#showtabpin").show();
  $("#showtabvalue").hide();
  $("#showtabbill").hide();
 });
 
 $("#mybill").click(function(){
 
 $("#showtabvalue").show();
 $("#showtabbill").hide();
 $("#showtabpin").hide();
 });
  $("#myrecharge").click(function(){
 
 $("#showtabbill").show();
 $("#showtabpin").hide();
 $("#showtabvalue").hide();
 });
 
 $('#pinid1').keyup(function() {
 var value = $(this).val();

 $.get("rechargepin.aspx?q="+value , function(data){
 //alert(data);
 var mydata = data.split('*');
 var stateList = document.getElementById("pinselect");
	
	stateList.options.length = 0;
	
	//var stateNodes = countryNode.split("()");
	
	var textValue; 
	var textValue1; 
	var optionItem;
	for (var count = 0; count < mydata.length - 1; count+=1)
	{
	    var arrmydata=mydata[count].split("$");
	 textValue1 = arrmydata[0];
   		textValue= arrmydata[1];
   		
   		optionItem = new Option (textValue1, textValue,  false, false);
		stateList.options[stateList.length] = optionItem;
//		document.getElementById('pinid1')=pinselect.selectedvalue;
   		
	}
	
 });
    
 });
 
 $("#Narrow").click(function(){
 
    if($('#Narrow').attr('checked'))
    
    {
   
       $('#Prefairline1').show();
     $('#Prefairline2').show();
     $('#Prefairline3').show();
      $.get("domesticinfo.aspx", function(data){
       document.getElementById("Prefairline1").options.length=0;
       document.getElementById("Prefairline2").options.length=0;
       document.getElementById("Prefairline3").options.length=0;
      var mydata = data.split('*');
      $.each(mydata, function(val,text){
     var mydata= text.split('-');
     var city= mydata[0];
     var code = mydata[1];
     
 $('#Prefairline1').append('<option value='+code+'>'+city+'</option>');
  $('#Prefairline2').append('<option value='+code+'>'+city+'</option>');
   $('#Prefairline3').append('<option value='+code+'>'+city+'</option>');
 
});
      
      });
     
    }
    
 });
 $('#Narrow1').click(function(){
 
    if($('#Narrow1').attr('checked'))
    
    {
    $('#Prefair1').show();
     $('#Prefair2').show();
     $('#Prefair3').show();
     }
     });
//     $("#Adults1").click(function(){
//     document.getElementById("Adults1").options.length=0;
//   var numbers=new Array(1,2,3,4);
//   
////     $('#Rooms').append('<option>select</option>');   
//   $.each(numbers, function(val,text){       
//     $('#Adults1').append('<option>'+text+'</option>');       
//    });
//    });
 
 $("#pinselect").click(function(){
 
// alert("hello");
 var myindex  = document.frmProduct.pinselect.selectedIndex;
 
 document.getElementById('pinid1').value = document.frmProduct.pinselect.options[myindex].text;
 document.getElementById('pinselect').style.display='none';
  
// if (document.layers) document.layers['autocompletecity'].visibility="hide";
//    else document.getElementById('autocompletecity').style.visibility="hidden";
//}
// alert(myindex);
//document.getElementById('pinv').value=document.frmProduct.AutoCompleteBox.options[myindex].text;
var c=document.frmProduct.pinselect.options[myindex].value;

var stateList = document.getElementById("pinamount");
	var amountdata = c.split(",");
	alert(amountdata)

	stateList.options.length = 0;
	var textValue; 
	var textValue1; 
	var optionItem;
	
	for (var count = 0; count < amountdata.length; count+=1)
	{
//	    var arrmydata=mydata[count].split("$");
	  textValue1 = amountdata[count];
   	  textValue= amountdata[count];  	  	
  		optionItem = new Option (textValue1, textValue,  false, false);          
		stateList.options[stateList.length] = optionItem;
//		document.getElementById('pinid1')=pinselect.selectedvalue;
   		
	}
 
 
 });
});
///////////////////////////
//Global XMLHTTP Request object
var XmlHttp;

//Creating and setting the instance of appropriate XMLHTTP Request object to a “XmlHttp” variable  
function CreateXmlHttp()
{
	//Creating object of XMLHTTP in IE
	try
	{
		XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} 
		catch(oc)
		{
			XmlHttp = null;
		}
	}
	//Creating object of XMLHTTP in Mozilla and Safari 
	if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
	{
		XmlHttp = new XMLHttpRequest();
	}
}

function Getroominfo(count,supplier,hotelid,sessionreq,seesionval,param) 
{
    var finalstr = count + ',' + supplier + ',' + hotelid ;
    var requestUrl = "GetRoomdetail.aspx" + "?Selectedhotel=" + finalstr + "&Session=" + sessionreq + "&sessionval=" + seesionval + "&paramval=" + param;
	//alert(requestUrl);
	CreateXmlHttp();
	XmlHttp.open("GET", requestUrl,  true);
	if(XmlHttp)
	{
		XmlHttp.onreadystatechange=function()
		{
		    if(XmlHttp.readyState == 4)
	        {
		        var response = XmlHttp.responseText;
                document.getElementById("roomtypeinfo"+count+"").innerHTML=response;
	        }
		}
		
	    XmlHttp.send(null);		
	}
}

///////////////////////////
 


         





