function JY_search()
{
  if (JY_validate())
  {
    document.getElementById('JY_form1').submit();
  }
}

function JY_validate()
{
  if(document.getElementById('JY_origin').value == "" || document.getElementById('JY_destination').value == "")
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Please fill both origin and destination";
    return false;
  }
  if(document.getElementById('JY_origin').value ==  'Enter domestic city / airport')
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Please fill correct origin";
    return false;
  }
  if(document.getElementById('JY_destination').value ==  'Enter city / airport')
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Please fill correct destination";
    return false;
  }
  if(document.getElementById('JY_destination').value.indexOf('India') > 0 && document.getElementById('JY_origin').value.indexOf('India') > 0)
  {
    //document.getElementById('isInternational').value="false";
  }
  else
  {
    //document.getElementById('isInternational').value="true";
  }
  //document.getElementById('showInternational').value="true"
  var starIndex=(document.getElementById('JY_destination').value.length-4);
  var endIndex=(document.getElementById('JY_destination').value.length-1);
  var intDest=document.getElementById('JY_destination').value.substring(starIndex,endIndex);
  if(document.getElementById('JY_origin').value == document.getElementById('JY_destination').value)
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Origin and destination should be different";
    return false;
  }
  if(isNaN(document.getElementById('JY_destination').value)==false)
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Destination should not be numeric or blank";
    return false;
  }
  if(eval(document.getElementById('JY_adultCount').value) < eval(document.getElementById('JY_infantCount').value))
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Infant count should not be greater than adult count";
    return false;
  }
  if(!JY_checkDates())
  {
    return false;
  }
  return true;

}
function JY_showReturn()
{
  if(document.getElementById('JY_roundTrip').checked==true)
  {
    document.getElementById('JY_retDate').style.display="block";

  }
  else
  {
    document.getElementById('JY_retDate').style.display="none";
  }
}
function JY_checkDates()
{
  document.getElementById('JY_errMess').style.display = "none";
  var date1 = document.getElementById('JY_DepDate').value;
  var date2 = document.getElementById('JY_ReturnDate').value;
  if(date1=="DD/MM/YYYY"||date1=="")
  {
    document.getElementById('JY_errMess').style.display = "block";
    document.getElementById('JY_errMess').innerHTML = "Please select departure date";
    return false;
  }
  var depDateArray = date1.split('/');

  // checking if date1 is valid

  if(document.getElementById('JY_roundTrip').checked==true)
  {
    if(date2=="DD/MM/YYYY"||date2=="")
    {
      document.getElementById('JY_errMess').style.display = "block";
      document.getElementById('JY_errMess').innerHTML = "Please select return date";
      return false;
    }
    var retDateArray = date2.split('/');


    var depdate = new Date(depDateArray[2], depDateArray[1]-1, depDateArray[0]);
    var returndate = new Date(retDateArray[2], retDateArray[1]-1, retDateArray[0]);
    var difference = returndate.getTime() - depdate.getTime();

    if (difference < 0)
    {
      document.getElementById('JY_errMess').style.display = "block";
      document.getElementById('JY_errMess').innerHTML = "Return date should be greater than or equal to departure date" ;
      return false;
    }
  }
  return true;
}
function JY_CheckValidDate(Day,Mn,Yr)
{
  var DateVal = Mn + "/" + Day + "/" + Yr;
  var dt = new Date(DateVal);

  if(dt.getDate()!=Day)
  {
    return false;
  }
  else if(dt.getMonth()!=Mn-1)
  {
    return false;
  }
  else if(dt.getFullYear()!=Yr)
  {
    return false;
  }
  return(true);
}


function JY_FlightHotel(showDivId,hideDivId1,hideDivId2)
{

  document.getElementById(showDivId).style.display = 'block';
  document.getElementById(hideDivId1).style.display = 'none';
  document.getElementById(hideDivId2).style.display = 'none';
  if(showDivId == 'JY_FlightSearchDiv')
  {
    document.getElementById('JY_FlightTab').className = "selected_tab";
    document.getElementById('JY_HotelTab').className = "";
    document.getElementById('JY_HolidayTab').className = "";
    document.getElementById('Deals1').style.display="block";
    document.getElementById('Deals2').style.display="none";
    //  document.getElementById('Banner1').style.display="block";
    // document.getElementById('Banner2').style.display="none";
    // document.getElementById('Banner3').style.display="none";
    document.getElementById('JY_hoteldiv').style.display="none";

  }

  else if (showDivId == 'JY_HotelSearchDiv')
  {
    document.getElementById('JY_HotelTab').className = "selected_tab";
    document.getElementById('JY_FlightTab').className = "";
    document.getElementById('JY_HolidayTab').className = "";
    document.getElementById('Deals2').style.display="block";
    document.getElementById('Deals1').style.display="none";
    //document.getElementById('Banner1').style.display="none";
    //document.getElementById('Banner2').style.display="block";
    //document.getElementById('Banner3').style.display="none";
    document.getElementById('JY_hoteldiv').style.display="none";

  }
  else if(showDivId == 'JY_HolidaySearchDiv')
  {
    document.getElementById('JY_HolidayTab').className = "selected_tab";
    document.getElementById('JY_FlightTab').className = "";
    document.getElementById('JY_HotelTab').className = "";
    document.getElementById('Deals2').style.display="block";
    document.getElementById('Deals1').style.display="none";
    // document.getElementById('Banner3').style.display="block";
    //document.getElementById('Banner1').style.display="none";
    //document.getElementById('Banner2').style.display="none";
    document.getElementById('JY_hoteldiv').style.display="none";
  }
}

function trim(stringToTrim)
{
  return stringToTrim.replace(/^\s+|\s+$/g,"");
}


function JY_checkHotelDates()
{
  document.getElementById('JY_errMessHotel').style.display = "none";
  var date1 = document.getElementById('JY_checkInDate').value;
  var date2 = document.getElementById('JY_checkOutDate').value;
  if(date1=="DD/MM/YYYY"||date1=="")
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = "Please select checkIn date";
    return false;
  }
  var depDateArray = date1.split('/');

  // checking if date1 is valid
  if (!JY_CheckValidDate(depDateArray[0], depDateArray[1], depDateArray[2]))
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = " Invalid checkIn date";
    return false;
  }


  if(date2=="DD/MM/YYYY"||date2=="")
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = "Please select checkOut date";
    return false;
  }
  var retDateArray = date2.split('/');

  // checking if date2 is valid
  if (!JY_CheckValidDate(retDateArray[0], retDateArray[1], retDateArray[2]))
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = " Invalid checkOut date";
    return false;
  }
  var depdate = new Date(depDateArray[2], depDateArray[1]-1, depDateArray[0]);
  var returndate = new Date(retDateArray[2], retDateArray[1]-1, retDateArray[0]);
  var difference = returndate.getTime() - depdate.getTime();

  if (difference < 0)
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = "checkOut date should be greater than checkIn date" ;
    return false;
  }
  return true;
}


function JY_HotelSearch()
{
  if (JY_HotelValidations())
  {

    //document.getElementById('form2').action = "http://jagran.tektravels.com/HotelSearchResult.aspx";
    document.getElementById('JY_form2').submit();
  }
}

function JY_HotelValidations()
{
  //    if(document.getElementById('domesticHotel').checked == true)
  //    {
  if(document.getElementById('JY_city').value == null || trim(document.getElementById('JY_city').value).length == 0)
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = "Please Select Destination City";
    return false;
  }
  else if(document.getElementById('JY_city').value != null && document.getElementById('JY_city').value == 'Enter domestic city')
  {
    document.getElementById('JY_errMessHotel').style.display = "block";
    document.getElementById('JY_errMessHotel').innerHTML = "Please Select Destination City";
    return false;
  }
  document.getElementById('JY_destinationCity').value = document.getElementById('JY_city').value;
  document.getElementById('JY_isDomesticHotel').value = "true";


  if(!JY_checkHotelDates())
  {
    return false;
  }
  var rooms=$('JY_NoOfRooms').value;
  for(var k=1;k<=parseInt(rooms);k++)
  {
    if(document.getElementById("JY_chdRoom-"+k).value!=0)
    {
      for(var m=1;m<=parseInt(document.getElementById("JY_chdRoom-"+k).value);m++)
      {
        if(parseInt(document.getElementById("JY_ChildBlock-" + k + "-ChildAge-" + m).value)==-1)
        {
          document.getElementById('JY_errMessHotel').style.display = "block";
          document.getElementById('JY_errMessHotel').innerHTML ="Please Enter age of Child No. " + m + " of room No. " + k + ".!!";
          return false;
        }
      }
    }
  }//end for
  return true;
}



function JY_ShowRoomDetails()
{
  //var dropdown=document.getElementById("JY_NoOfRooms");
  var count = document.getElementById('JY_NoOfRooms').value;
  var prevCount = eval(document.getElementById('JY_PrevNoOfRooms').value);
  if(count > prevCount)
  {
    for(var i=(prevCount+1); i<=count;i++)
    {
      document.getElementById('JY_room-'+i).style.display = 'block';
      document.getElementById('JY_adtRoom-'+i).value = '1';
      document.getElementById('JY_chdRoom-'+i).value = '0';
      document.getElementById('JY_PrevChildCount-'+i).value = '0';
    }
  }
  else if(count < prevCount)
  {
    for(var i=prevCount; i>count;i--)
    {
      document.getElementById('JY_room-'+i).style.display = 'none';
      document.getElementById('JY_adtRoom-'+i).value = '1';
      document.getElementById('JY_chdRoom-'+i).value = '0';
      document.getElementById('JY_PrevChildCount-'+i).value = '0';
      document.getElementById('JY_ChildBlock-'+i).style.display='none';
      document.getElementById('JY_ChildBlock-'+i+'-ChildAge-1').value='-1';
      document.getElementById('JY_ChildBlock-'+i+'-ChildAge-2').value='-1';
    }
  }
  document.getElementById('JY_PrevNoOfRooms').value = count;
}


function JY_ShowChildAge(number)
{
  var childCount = eval(document.getElementById('JY_chdRoom-' + number).value);
  var PrevChildCount = eval(document.getElementById('JY_PrevChildCount-' + number).value);
  if(eval(document.getElementById('JY_chdRoom-1').value) > 0 || eval(document.getElementById('JY_chdRoom-2').value) > 0 || eval(document.getElementById('JY_chdRoom-3').value) > 0 || eval(document.getElementById('JY_chdRoom-4').value) > 0)
  {
    document.getElementById('JY_childDetails').style.display='block';
  }
  else
  {
    document.getElementById('JY_childDetails').style.display='none';
  }
  if(childCount > PrevChildCount)
  {
    document.getElementById('JY_ChildBlock-'+number).style.display='block';
    for(var i=(PrevChildCount+1); i<=childCount;i++)
    {
      document.getElementById('JY_ChildBlock-'+number+'-Child-'+i).style.display='block';
      document.getElementById('JY_ChildBlock-'+number+'-ChildAge-'+i).value='-1';
    }
  }
  else if(childCount < PrevChildCount)
  {
    if(childCount == 0)
    {
      document.getElementById('JY_ChildBlock-'+number).style.display='none';
      document.getElementById('JY_ChildBlock-'+number+'-ChildAge-1').value='-1';
      document.getElementById('JY_ChildBlock-'+number+'-ChildAge-2').value='-1';
      document.getElementById('JY_ChildBlock-'+number+'-Child-1').style.display='none';
      document.getElementById('JY_ChildBlock-'+number+'-Child-2').style.display='none';
    }
    else
    {
      for(var i=PrevChildCount; i>childCount;i--)
      {
        if(i!=0)
        {
          document.getElementById('JY_ChildBlock-'+number+'-Child-'+i).style.display='none';
          document.getElementById('JY_ChildBlock-'+number+'-ChildAge-'+i).value='-1';
        }
      }
    }
  }
  document.getElementById('JY_PrevChildCount-' + number).value = childCount;
}

function JY_NewWindow(type)
{
  var w = screen.width/2;
  var h = screen.height/2;
  LeftPosition = (screen.width) ? ((screen.width-w)/2+200) : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no';
  JY_MM_openBrWindow(settings,type);
}

function JY_MM_openBrWindow(features,type)
{
  var remote = window.open("",'cities',features);
  remote.focus();


  remote.location.href='JY_cityList.htm';

  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = "opener";
}


function JY_TypeCitySelect()
{
  if(document.getElementById('JY_domesticRadio').checked)
  {
    document.getElementById('JY_domesticSelect_div').style.display="block";
    document.getElementById('JY_internationalSelect_div').style.display="none";
  }
  else
  {
    document.getElementById('JY_internationalSelect_div').style.display="block";
    document.getElementById('JY_domesticSelect_div').style.display="none";
  }
}


function JY_SubmitHolidayHome()
{
  if(document.getElementById('JY_cityText').value != "Enter City Name")
  {
    document.getElementById('JY_cityName').value =
Trim(document.getElementById('JY_cityText').value);
    document.getElementById('JY_cityType').value = "-1";
  }
  else
  {
    if(document.getElementById('JY_domesticRadio').checked)
    {
      document.getElementById('JY_cityType').value = 0;
      document.getElementById('JY_cityName').value
=document.getElementById('JY_domesticSelect').value;
    }
    else
    {
      document.getElementById('JY_cityType').value = 1;
      document.getElementById('JY_cityName').value =
document.getElementById('JY_internationalSelect').value;
    }
  }
  document.getElementById('JY_form3').submit();
}

/*Khoj Vikalp js */


/*
 * Contain function for khoj vikalp in header
 * tab on travel solution
 */


var timeout         = 500;
var closetimer		= 0;
var ddmenuitem      = 0;

// open hidden layer

function testing(elementId) {
    //alert(element.id);
    if(ddmenuitem != 0  && ddmenuitem.id != elementId) {
        setmclose(elementId);
    } else if (ddmenuitem == 0 ) {
        setmclose(elementId);
    }
}

function setmclose (id) {
    window.setTimeout(function () {
        mopen(id);
    }, 10);
}

function mopen(id)
{
    // cancel close timer
    mcancelclosetime();

    // close old layer
    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

    // get new layer and show it
    ddmenuitem = document.getElementById(id);
    ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{

    if(ddmenuitem) {
        ddmenuitem.style.visibility = 'hidden';
    //ddmenuitem = 0;
    }

}

// go close timer
function mclosetime()
{
    closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
    if(closetimer)
    {
        window.clearTimeout(closetimer);
        closetimer = '';
    }
}

// close layer when click-out
document.onclick = mclose;

function SetValue(Setvalue)
{
    document.getElementById('txtWeek1').value = Setvalue;
    Setvalue = trim(Setvalue);

    if(Setvalue == 'मध्य') {
        document.getElementById('zoneheader').value = 30;
        var state = {
            34 : 'छत्तीसगढ़' ,
            376 : 'मध्य प्रदेश'
        }

        var html = '';
        html = " <a href='#' id='a43' onclick=\"stateValue('--- राज्य चुनें ---');return false;\">--- राज्य चुनें ---</a>";
        for ( var key in state ) {
            if(key != 'extend')
                html = html + "<a href='#' onclick=\"stateValue('" + state[key] + "');return false;\" >" + state[key] + "</a>";
        }
        //jQuery('#m2').html(html);
        document.getElementById('m2').innerHTML = html;

    } else if( trim(Setvalue) == 'उत्तर' ) {
        document.getElementById('zoneheader').value = 6;
        var state = {
            33 : 'चंडीगढ़ (UT)',
            38 : 'दिल्ली (NCR)' ,
            52 : 'हरियाणा' ,
            54 : 'हिमाचल प्रदेश',
            61 : 'जम्मू और कश्मीर',
            7 : 'पंजाब' ,
            13 : 'उत्तर प्रदेश' ,
            14 : 'उत्तराखण्ड'
        }
        var html = '';
        html = " <a href='#' id='a43' onclick=\"stateValue('--- राज्य चुनें ---');return false;\">--- राज्य चुनें ---</a>";
        for ( var key in state ) {
            if(key != 'extend')
                html = html + "<a href='#' onclick=\"stateValue('" + state[key] + "');return false;\" >" + state[key] + "</a>";
        }
        //jQuery('#m2').html(html);
        document.getElementById('m2').innerHTML = html;
    } else if ( trim(Setvalue) == 'पूर्व' ) {
        document.getElementById('zoneheader').value = 39;
        var state = {
            1442 : 'अंडमान निकोबार द्वीप समुह',
            1444 : 'अरुणाचल प्रदेश' ,
            29 : 'असम' ,
            53  : 'बिहार' ,
            1462 : 'झारखंड',
            1470 : 'मिजोरम',
            1471 : 'नगालैण्ड',
            446 : 'उड़ीसा' ,
            550 : 'सिक्किम',
            1419 : 'पश्चिम बंगाल'
        }
        var html = '';
        html = " <a href='#' id='a43' onclick=\"stateValue('--- राज्य चुनें ---');return false;\">--- राज्य चुनें ---</a>";
        for ( var key in state ) {
            if(key != 'extend')
                html = html + "<a href='#' onclick=\"stateValue('" + state[key] + "');return false;\" >" + state[key] + "</a>";
        }
        //jQuery('#m2').html(html);
        document.getElementById('m2').innerHTML = html;

    } else if (trim(Setvalue) == 'पश्चिम') {
        document.getElementById('zoneheader').value = 16;
        var state = {
            36 : 'दादरा और नगर हवेली (UT)',
            37 : 'दमन और दीव (UT)',
            47 : 'गोवा',
            50 : 'गुजरात',
            1441 : 'महाराष्ट्र' ,
            498 : 'राजस्थान'
        }

        var html = '';
        html = " <a href='#' id='a43' onclick=\"stateValue('--- राज्य चुनें ---');return false;\">--- राज्य चुनें ---</a>";
        for ( var key in state ) {
            if(key != 'extend')
                html = html + "<a href='#' onclick=\"stateValue('" + state[key] + "');return false;\" >" + state[key] + "</a>";
        }
        //jQuery('#m2').html(html);
        document.getElementById('m2').innerHTML = html;


    } else if (trim(Setvalue) == 'दक्षिण') {
        document.getElementById('zoneheader').value = 9;
        var state = {
            22 : 'आंध्र प्रदेश' ,
            64 : 'कर्नाटक',
            68 : 'केरल',
            73 : 'लक्षद्वीप (UT)' ,
            1433 : 'पांडिचेरी (UT)' ,
            10: 'तमिलनाडु'
        }

        var html = '';
        html = " <a href='#' id='a43' onclick=\"stateValue('--- राज्य चुनें ---');return false;\">--- राज्य चुनें ---</a>";
        for ( var key in state ) {
            if(key != 'extend')
                html = html + "<a href='#' onclick=\"stateValue('" + state[key] + "');return false;\" >" + state[key] + "</a>";
        }
        //jQuery('#m2').html(html);
        document.getElementById('m2').innerHTML = html;
    }
}
function stateValue(Setvalue) {
    document.getElementById('txtWeek2').value = Setvalue;
    Setvalue = trim(Setvalue);

    var state = {
        'छत्तीसगढ़' : 34,
        'मध्य प्रदेश' : 376,
        'अंडमान निकोबार द्वीप समुह' : 1442,
        'अरुणाचल प्रदेश' : 1444,
        'असम' : 29 ,
        'बिहार' : 53 ,
        'झारखंड' : 1462,
        'मणिपुर' : 1467,
        'मिजोरम' : 1470,
        'नगालैण्ड':1471,
        'उड़ीसा' : 446,
        'सिक्किम' : 550,
        'पश्चिम बंगाल' : 1419,
        'चंडीगढ़ (UT)' : 33 ,
        'दिल्ली (NCR)' : 38,
        'हरियाणा' : 52,
        'हिमाचल प्रदेश' : 54,
        'जम्मू और कश्मीर' : 61,
        'पंजाब' : 7,
        'उत्तर प्रदेश' : 13,
        'उत्तराखण्ड' : 14,
        'दादरा और नगर हवेली (UT)' : 36,
        'दमन और दीव (UT)' : 37,
        'गोवा' : 47 ,
        'गुजरात' : 50 ,
        'महाराष्ट्र' : 1441,
        'राजस्थान' : 498,
        'आंध्र प्रदेश' : 22,
        'कर्नाटक':64,
        'केरल':68,
        'लक्षद्वीप (UT)' : 73,
        'पांडिचेरी (UT)' : 1433,
        'तमिलनाडु' : 10
    }
    document.getElementById('stateheader1').value = state[Setvalue];
    var cityArray = new Array();
    cityArray[0] = new Array();
    cityArray[0][13] = {
        1710 : 'आगरा',
        20 : 'इलाहाबाद',
        2665 : 'कर्वी',
        49 : 'गोरखपुर',
        393 : 'मथुरा',
        266 : 'महोबा' ,
        15 : 'वाराणसी'
    }

    cityArray[0][14] = {
        2649 : 'उत्तरकाशी',
        71 : 'कुमाऊं',
        66 : 'केदारखंड',
        65 : 'कौसानी' ,
        2405 : 'गढ़वाल',
        48 : 'गोपेश्वर',
        31 : 'चंबा',
        32 : 'चमोली',
        2660 : 'देहरादून',
        2625 : 'नैनीताल',
        27 : 'भीमताल',
        2659 : 'मसूरी',
        51 : 'हरसिल'
    }

    cityArray[0][61] = {
        72 : 'लद्दाख',
        74 : 'लेह',
        574 : 'श्रीनगर'
    }

    cityArray[0][7] = {
        21 : 'अमृतसर',
        60 : 'जलंधर'
    }

    cityArray[0][54] = {
        188 : 'डलहौजी',
        2384 : 'पालमपुर',
        2626 : 'शिमला',
        1561 : 'सोलंग घाटी',
        1529 : 'हरिपुरधार'
    }

    cityArray[0][22] = {
        70 : 'कुचीपुड़ी',
        648 : 'विशाखापत्तनम',
        58 : 'हैदराबाद'
    }

    cityArray[0][64] = {
        2669 : 'बंगलूरू' ,
        2641 : 'बीजापुर',
        1442 : 'मैसूर'
    }

    cityArray[0][68] = {
        612 : 'तिरुवनन्तपुरम' ,
        2676 : 'पेरियार' ,
        414 : 'मुन्नार',
        1440 : 'वायपीन'
    }

    cityArray[0][10] = {
        1439 : 'ऊटी' ,
        69 : ' कोडाइकनाल',
        377 : 'महाबलीपुरम',
        56 : 'होगेनक्कल'
    }

    cityArray[0][50] = {
        561 :  'सोमनाथ'
    }

    cityArray[0][1441] = {
        1730 : ' महाबलेश्वर',
        1676 : 'शिरडी'
    }

    cityArray[0][498] =  {
        1722 : 'अजमेर',
        1576 : 'अलवर',
        632 : 'उदयपुर',
        313 : 'जयपुर' ,
        1443 :'जैसलमेर',
        318 :'जोधपुर',
        1434 : 'बीकानेर',
        407 : 'माउंट आबू'
    }

    cityArray[0][446] = {
        350 : 'कोरापुट ',
        2650 : 'पुरी',
        2651 : 'भुवनेश्वर'
    }

    cityArray[0][1419]= {
        2653 : ''
    }

    cityArray[0][53] = {
        2652 : 'नालंदा'
    }

    cityArray[0][550] = {
        1438 : 'लाचुंग'
    }

    cityArray[0][34] = {
        112 : 'बस्तर'
    }

    cityArray[0][376] = {
        635 : 'उज्जैन ',
        344 : 'खजुराहो',
        2691 :'जबलपुर',
        191 : 'दतिया ',
        458 : 'पचमढ़ी',
        118 : 'भोपाल',
        2693 : 'माण्डू',
        1686 : 'सतना',
        1435 : 'सांची'
    }
    var html = '';
    html = " <a href='#' onclick=\"placeValue('--- गन्तव्य स्थान चुनें---');return false;\">--- गन्तव्य स्थान चुनें---</a>";
    for(var key in cityArray[0][state[Setvalue]] ) {
        var city = cityArray[0][state[Setvalue]];
        if(key != 'extend') {
            html = html + "<a href='#' onclick=\"placeValue('" + city[key] + "');return false;\" >" + city[key] + "</a>";
            html = html + "<input type='hidden' name='" + city[key] + "' id='" + city[key] + "' value='" + key + "' />";
        }
    }
    //jQuery('#m13').html(html);
    document.getElementById('m13').innerHTML = html;

}


function placeValue(Setvalue)
{
    document.getElementById('txtWeek3').value = Setvalue;
    Setvalue = trim(Setvalue);
    //var value = jQuery('#'+Setvalue).val();
    var value =  document.getElementById(Setvalue).value;
    document.getElementById('town').value = value;
//  SetResult();
}
function themesValue(Setvalue)
{
    document.getElementById('txtWeek4').value = Setvalue;
    Setvalue = trim(Setvalue);
    if(Setvalue == 'रोमांचक') {
        document.getElementById('themes').value = 18;
    } else if (Setvalue ==  'द्वीपीय') {
        document.getElementById('themes').value = 26;
    } else if(Setvalue ==  'मनोरंजन') {
        document.getElementById('themes').value = 41;
    } else if (Setvalue ==  'हिल स्टेशन') {
        document.getElementById('themes').value = 53;
    } else if (Setvalue ==  'ऐतिहासिक') {
        document.getElementById('themes').value = 55;
    } else if (Setvalue ==  'धर्म-संस्कृति व त्योहार') {
        document.getElementById('themes').value = 1432;
    } else if (Setvalue == 'अन्य') {
        document.getElementById('themes').value = 1431;
    }
//   SetResult();
}
function contitentValue(Setvalue)
{
    document.getElementById('txtWeek5').value = Setvalue;
    Setvalue = trim(Setvalue);
    if(Setvalue == 'अफ्रीका') {
        document.getElementById('contheader').value = 19;
        var country = {
            67 : 'केन्या',
            40 : 'मिस्र',
            396 : 'मॉरिशस',
            2406 : 'साउथ अफ्रीका'
        }
        var html =  '';
        html = " <a href='#' id='a43' onclick=\"worldValue('--- देश चुनें ---');return false;\">--- देश चुनें ---</a>";
        for ( var key in country) {
            if(key != 'extend') {
                html = html + "<a href='#' onclick=\"worldValue('" + country[key] + "');return false;\" >" + country[key] + "</a>";
                html = html + "<input type='hidden' name='" + country[key] + "' id='" + country[key] + "' value='" + key + "' />";
            }
        }
        //jQuery('#m16').html(html);
        document.getElementById('m16').innerHTML = html;


    } else if ( Setvalue == 'एशिया' ) {
        document.getElementById('contheader').value = 24;
        var country = {
            1586 : 'कोरिया',
            35 : 'चीन',
            62 : 'जापान',
            2042 : 'ताईवान',
            603 : 'थाईलैंड',
            1461 : 'नेपाल',
            75 : 'मकाऊ',
            382 : 'मलेशिया',
            384 : 'मालदीव',
            2389 : 'यूएई',
            572 : 'श्रीलंका',
            554 : 'सिंगापुर',
            1622 : 'सीरिया',
            57 : 'हाँग काँग'
        }

        var html =  '';
        html = " <a href='#' id='a43' onclick=\"worldValue('--- देश चुनें ---');return false;\">--- देश चुनें ---</a>";
        for ( var key in country) {
            if(key != 'extend') {
                html = html + "<a href='#' onclick=\"worldValue('" + country[key] + "');return false;\" >" + country[key] + "</a>";
                html = html + "<input type='hidden' name='" + country[key] + "' id='" + country[key] + "' value='" + key + "' />";
            }
        }
        //jQuery('#m16').html(html);
        document.getElementById('m16').innerHTML = html;


    } else if ( Setvalue == 'ऑस्ट्रेलिया' ) {
        document.getElementById('contheader').value = 2544;
        var country = {
        //            432 : 'न्यूजीलैंड',
        //            43 : 'फिजी द्वीप समूह'
        }

        html = " <a href='#' id='a43' onclick=\"worldValue('--- देश चुनें ---');return false;\">--- देश चुनें ---</a>";
        for ( var key in country) {
            if(key != 'extend') {
                html = html + "<a href='#' onclick=\"worldValue('" + country[key] + "');return false;\" >" + country[key] + "</a>";
                html = html + "<input type='hidden' name='" + country[key] + "' id='" + country[key] + "' value='" + key + "' />";
            }
        }
        //jQuery('#m16').html(html);
        document.getElementById('m16').innerHTML = html;

    } else if ( Setvalue == 'यूरोप' ) {
        document.getElementById('contheader').value = 42;
        var country = {
            59 : 'इटली',
            1547 : 'ग्रेटब्रिटेन',
            46 : 'जर्मनी',
            1437 : 'डेनमार्क',
            2607 : 'तुर्की',
            1436 : 'नीदरलैण्ड',
            1537 : 'पोलैंड',
            44 : 'फिनलैंड',
            45 : 'फ्रांस',
            568 : 'स्पेन',
            1480 : 'स्विट्जरलैंड',
            1550 : 'स्वीडन'
        }

        var html = '';
        html = " <a href='#' id='a43' onclick=\"worldValue('--- देश चुनें ---');return false;\">--- देश चुनें ---</a>";
        for ( var key in country) {
            if(key != 'extend') {
                html = html + "<a href='#' onclick=\"worldValue('" + country[key] + "');return false;\" >" + country[key] + "</a>";
                html = html + "<input type='hidden' name='" + country[key] + "' id='" + country[key] + "' value='" + key + "' />";
            }
        }
        //jQuery('#m16').html(html);
        document.getElementById('m16').innerHTML = html;

    } else if ( Setvalue == 'नोर्थ अमेरिका' ) {
        document.getElementById('contheader').value = 5;
        var country = {
            12 : 'अमेरिका' ,
            29 : 'कनाडा',
            17 : 'वेस्टइंडीज'
        }
        var html = '';
        html = " <a href='#' id='a43' onclick=\"worldValue('--- देश चुनें ---');return false;\">--- देश चुनें ---</a>";
        for ( var key in country) {
            if(key != 'extend') {
                html = html + "<a href='#' onclick=\"worldValue('" + country[key] + "');return false;\" >" + country[key] + "</a>";
                html = html + "<input type='hidden' name='" + country[key] + "' id='" + country[key] + "' value='" + key + "' />";
            }
        }
        //jQuery('#m16').html(html);
        document.getElementById('m16').innerHTML = html;

    } else if ( Setvalue == 'साउथ अमेरिका' ) {
        document.getElementById('contheader').value = 8;
        var country = {
            23 : 'अर्जेंटीना',
            28 : 'ब्राज़िल'
        }
        var html = '';
        html = " <a href='#' id='a43' onclick=\"worldValue('--- देश चुनें ---');return false;\">--- देश चुनें ---</a>";
        for ( var key in country) {
            if(key != 'extend') {
                html = html + "<a href='#' onclick=\"worldValue('" + country[key] + "');return false;\" >" + country[key] + "</a>";
                html = html + "<input type='hidden' name='" + country[key] + "' id='" + country[key] + "' value='" + key + "' />";
            }
        }
        //jQuery('#m16').html(html);
        document.getElementById('m16').innerHTML = html;
    }


//SetResult();
}

function cont_response( response ) {
    //document.getElementById('txtWeek6').value = '--- देश चुनें ---';
    //jQuery('#m16').html(response);
    document.getElementById('m16').innerHTML = html;
}
function worldValue(Setvalue)
{
    document.getElementById('txtWeek6').value = Setvalue;
    Setvalue = trim(Setvalue);
    //var value = jQuery('#'+Setvalue).val();
    var value = document.getElementById(Setvalue).value;
    document.getElementById('country').value = value;
//    SetResult();
}
function wthemesValue(Setvalue) {
    document.getElementById('txtWeek7').value = Setvalue;
    Setvalue = trim(Setvalue);
    if(Setvalue == 'रोमांचक') {
        document.getElementById('worldthemes').value = 18;
    } else if (Setvalue ==  'द्वीपीय') {
        document.getElementById('worldthemes').value = 26;
    } else if(Setvalue ==  'मनोरंजन') {
        document.getElementById('worldthemes').value = 41;
    } else if (Setvalue ==  'हिल स्टेशन') {
        document.getElementById('worldthemes').value = 53;
    } else if (Setvalue ==  'ऐतिहासिक') {
        document.getElementById('worldthemes').value = 55;
    } else if (Setvalue ==  'धर्म-संस्कृति व त्योहार') {
        document.getElementById('worldthemes').value = 1432;
    } else if (Setvalue == 'अन्य') {
        document.getElementById('worldthemes').value = 1431;
    }
}

function SetResult() {

}

function zone_response(response) {
    document.getElementById('txtWeek2').value = '--- राज्य चुनें---';
    //jQuery('#m2').html(response);
    document.getElementById('m2').innerHTML = html;
}


function MM_changeProp(objId,x,theProp,theValue) { //v9.0
    var obj = null;
    with (document){
        if (getElementById)
            obj = getElementById(objId);
        }
    if (obj){
        if (theValue == true || theValue == false)
            eval("obj.style."+theProp+"="+theValue);
        else eval("obj.style."+theProp+"='"+theValue+"'");
    }
}

function clear_value(id) {
    id.value = '';
}

function fill_value(id) {
    //var val = jQuery(id).val();
    var val = id.value;
    if(val == '') {
        id.value = 'Enter text'
    }
}

function SetTxtBoxValue(id, setvalue)
{
    document.getElementById(id).value = setvalue;
}

function SetTxtHidBoxValue(txtid, txtvalue, hidid, hidvalue)
{
    document.getElementById(txtid).value = txtvalue;
    document.getElementById(hidid).value = hidvalue;
}

function SetTxtBoxValueAndSetRoomDetails(id, setvalue)
{
    SetTxtBoxValue(id, setvalue);
    JY_ShowRoomDetails();
}

function SetTxtBoxValueAndShowChildAge(id, setvalue, number)
{
    SetTxtBoxValue(id, setvalue);
    JY_ShowChildAge(number);
}


// Load the Google Transliteration API
var searchTransliterationControl;
function searchOnLoad() {
    var options = {
        sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
        destinationLanguage: google.elements.transliteration.LanguageCode.HINDI,
        transliterationEnabled: true,
        shortcutKey: 'ctrl+g'
    };

    // Create an instance on TransliterationControl with the required
    // options.
    searchTransliterationControl = new google.elements.transliteration.TransliterationControl(options);

    // Enable transliteration in the textfields with the given ids.


    var ids = [ "Username1","Username2" ];


    searchTransliterationControl.makeTransliteratable(ids);

    //Enable transliteration
    searchTransliterationControl.enableTransliteration();

    // Add the STATE_CHANGED event handler to correcly maintain the state
    // of the checkbox.
    searchTransliterationControl.addEventListener(
        google.elements.transliteration.TransliterationControl.EventType.STATE_CHANGED,
        searchTransliterateStateChangeHandler);

    // Add the SERVER_UNREACHABLE event handler to display an error message
    // if unable to reach the server.
    searchTransliterationControl.addEventListener(
        google.elements.transliteration.TransliterationControl.EventType.SERVER_UNREACHABLE,
        searchServerUnreachableHandler);

    // Add the SERVER_REACHABLE event handler to remove the error message
    // once the server becomes reachable.
    searchTransliterationControl.addEventListener(
        google.elements.transliteration.TransliterationControl.EventType.SERVER_REACHABLE,
        searchServerReachableHandler);
}

// Handler for STATE_CHANGED event which makes sure checkbox status
// reflects the transliteration enabled or disabled status.
function searchTransliterateStateChangeHandler(e) {
//document.getElementById('checkboxId').checked = e.transliterationEnabled;
}

// Handler for radio selection event.  Calls toggleTransliteration to toggle
// the transliteration state.
function searchRadioSelectHandler(obj) {
    if(obj.value!='hi') {
        if (searchTransliterationControl.isTransliterationEnabled() ) {
            searchTransliterationControl.toggleTransliteration();
        }
    } else {
        if (!searchTransliterationControl.isTransliterationEnabled() ) {
            searchTransliterationControl.toggleTransliteration();
        }
    }
}

// SERVER_UNREACHABLE event handler which displays the error message.
function searchServerUnreachableHandler(e) {
    //document.getElementById("errorDiv").innerHTML = "Transliteration server unreachable!";
    alert("Transliteration server unreachable!");
}

// SERVER_UNREACHABLE event handler which clears the error message.
function searchServerReachableHandler(e) {
//document.getElementById("errorDiv").innerHTML = "";
}

function search_set_focus() {
    document.getElementById('Username2').focus();
}
google.setOnLoadCallback(searchOnLoad);

function remove_text(id) {
    document.getElementById('JY_city').value = '';
}

function fill_city(id) {

    var val =document.getElementById('JY_city').value;
    if( val != 'Enter domestic city') {
        document.getElementById('JY_city').value = 'Enter domestic city';
    }
}

function JY_markout(textBox, txt)
{           
    if(textBox.value == "")
    {            
        textBox.value = txt;                
    }              
}
function JY_markin(textBox, txt)
{           
    if(textBox.value == txt)
    {
        textBox.value = "";              
    }
}
function JY_Focus(id)
{       
    document.getElementById(id).focus();
}
