function setupCalendars()
{
   var dpin=$('#dpin').datePicker({createButton:false,startDate: startCal,endDate: endCal,showYearNavigation:false});

    dpin.bind('click',function(){
			$(this).dpDisplay();
			return false;
		});

    dpin.bind('dateSelected', function(e, selectedDate, $td, state){
      $('#dayin').val(selectedDate.getDate());
      ($('#monin')[0]).selectedIndex=selectedDate.getMonth();
		});

		var dpout=$('#dpout').datePicker({createButton:false,startDate:startCal,endDate:endCal,showYearNavigation:false});

    dpout.bind('click',function(){
      $(this).dpDisplay();
      return false;
		});

    dpout.bind('dateSelected', function(e, selectedDate, $td, state){
      $('#dayout').val(selectedDate.getDate());
      ($('#monout')[0]).selectedIndex=selectedDate.getMonth();
    });
}


/*function setupHotels()
{
   $('.hotdata a').click(function(event){
      var hid = $(event.target).attr('name');
      var href='/data/get.php?hotel='+hid+'&lang='+lang;
      $(event.target).attr('href',href);
   });
}

function ajaxReviews()
{
  var idlist='';
  hotdivs=$('.hotel').each( function(){
    idlist=idlist+$(this).attr('id')+',';
  });
  idlist=idlist.substr(0,idlist.length-1);

  $.getJSON('/ajax/review.php',{idlist:idlist},processReviews);
  //$('#debug').load('/ajax/review.php',{ idlist:idlist});
}

function processReviews(data)
{
  for (var i=0;i < data.length;i++){

    var hid=data[i].hid;
    var review_nr=data[i].review_nr;
    var review_score=data[i].review_score;
    var cont=$('#'+hid+' .hotrev');
    $('<div class="rscore">'+LP_score+' <a href="#" name="'+hid+'">'+ review_nr+' '+LP_reviews+'</a></div>').appendTo(cont);
    $('<p><img class="scorebar" width="111" height="7" src="/images/scorebar.png"/>'+review_score+'</p>').appendTo(cont);
    var bg=Math.floor(11.1*review_score);
    $('#'+hid+' .scorebar').css('background-position',bg+'px 0pt');
  }

  $('.rscore a').click(function(event){
     var hid = $(event.target).attr('name');
     var href='/data/get.php?hotel='+hid+'&review=1&lang='+lang;
     $(event.target).attr('href',href);
  });
}*/

//data/get.php?hotel='+hid+'&review=1

$(document).ready(function(){

   setupCalendars();
  // if (utype == 0) setupHotels();
  // ajaxReviews();
});

