/**
	$Revision: 1.1.2.1 $
	Charter and Package flights DE
*/
var hSV = new FormDef({
	formId:"form_h_SV", 	// form ID
	mddVisPattern:"%b %y",	// date pattern in dropdown
	maxMonths:11,			// max number of months
	minOffset:7,			// min offset for check in date
	checkPastOnly:true,		// do only check for past
	precalc:true
});


hSV.validate = function() {
	var msg = ''
    if (Val.isPast(hchinDD.date)) msg += Msg.err_past;
	if (msg != '') {
		alert(msg);
		return false;
	} else return true;
}
hSV.submit = function(advsearch) { // optional: advanced search on link

	var url = "http://www.hotelpronto.com/Customer/Availability/HotelSearchResults.aspx?";
	var defaults = "AffiliateId=728";
	url += defaults;
	var hdestDD = $("hdest");
	url += "&RegionId=" + ((hdestDD) ? hdestDD.options[hdestDD.selectedIndex].value : "0"); // Region
	url += "&ArrivalDay=" + hchinDD.getD("%d") + "&ArrivalMonthYear=" + hchinDD.getY("%Y") + hchinDD.getM("%m");
	url += "&Adults=" + cppxnum.getVal();
	var hdurDD = $("hdur");
	if (hdurDD) url += "&Nights=" + hdurDD.options[hdurDD.selectedIndex].value; // Number of Nights
	window.location.href = url;

}
hSV.valsub = function () {
	if (this.validate()) this.submit();
}

var hchinDD = new DMWidget({dayID:'hchind',monID:'hchinm', formDef:hSV, type:'dep'}); // departure date
var hchoutDD = new CheckoutWidget({dateID:'hadt', formDef:hSV, depDW:hchinDD, nightID:'hdur', precalc:true}); // arrival date
var cppxnum = new PXWidget({pxnumID:'cppxnum',formDef:hSV});