// JavaScript Document
function searchPrice(id, inD, outD, hotelid, msg, datasoucre) {
	odjerror = $("#error");
	odjerror.html('');
	odj = $("#"+id);
	var inday = $("#"+inD).val();
	var outday = $("#"+outD).val();
	/*var indate = parseInt(inday.substring(4,0),10);
	var inmonth = parseInt(inday.substring(7,5),10);
	var inyear = parseInt(inday.substring(10,8),10);
	var outdate = parseInt(outday.substring(4,0),10);
	var outmonth = parseInt(outday.substring(7,5),10);
	var outyear = parseInt(outday.substring(10,8),10);
	var inday_day = new Date(indate,inmonth,inyear);
	var outday_day = new Date(outdate,outmonth,outyear);
	var temp_day = (outday_day-inday_day)/86400000;*/
	
	if (inday.length < 14 || outday.length < 14)
	  odjerror.html(msg);
	/*else if (temp_day < 1 || temp_day > 21)
	  odjerror.html(msg2);*/
	else
	{
		odj.html('');
		$("#loadingWh")
		  .ajaxStart(function(){
			$(this).show();
		  })
		  .ajaxComplete(function(){
			$(this).hide();
          });
  		$.ajax({
          type: "POST",
          url: datasoucre,
          data: {hotel_id:hotelid,in_day:inday,out_day:outday},
          success: function(msg){
            odj.html(msg);
          }
    	});
	}
}
