function initResLauncher() {
	// *** must be set per instance ***
	domain = "https://reservations.SynXis.com"
	chainId = "6158";
	frm = document.resLauncher;
	// ********************************
	
	//
	// Begine creation of Month/Year <select>
	//
	var mnths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
	
	currDt   = new Date();
	currMnth = currDt.getMonth();
	currYear = currDt.getFullYear();
	currDay  = currDt.getDate();
	
	var mt,yr,dy,mnthYr,len;
	
	// Iterate
	for (var mnthIdx=currMnth;mnthIdx<=currMnth+12;mnthIdx++) {
		yr = currYear;
		mt = mnthIdx;
		if (mt>11) {
			mt -= 12;
			yr += 1;
		}
		len  = frm.arrMnthYr.options.length;
		sel  = (yr==currYear && mt==currMnth) ? true : false;
		tmpDay = (yr==currYear && mt==currMnth) ? currDay : 1;
		tmpDt = new Date(yr,mt,tmpDay);
		
		// Create <option>
		frm.arrMnthYr.options[len] = new Option(mnths[mt] + " " + yr,tmpDt,sel,sel);
	}
	
	// Call Other Methods
	setDays(currDt);
	setDates();
}

// 
// Build the days of the CURRENT month (in the corresponding year)
// dt is sent as a JavaScript new Date() object
//
function setDays(dt) {
	var days,yr,mt,day,tm,len,sel,tmpDt;
	yr = dt.getFullYear();
	mt = dt.getMonth();
	day = (mt==currMnth && yr==currYear) ? dt.getDate() : 1;

	var tmpMt = mt+1;
	var tmpYr = yr;
	if (tmpMt>11) {
		var tmpMt = mt-11;
		var tmpYr = yr+1;
	}
	tmpDt = new Date(tmpYr,tmpMt);
	tm = tmpDt.getTime();
	tmpDt.setTime(tm-86400000);
	dayCnt = tmpDt.getDate();

	//
	// Begine creation of date <select>
	//
	
	// Remove all <select> data
	frm.arrDay.options.length = 0;
	// Iterate
	for (var i=day;i<=dayCnt;i++) {
		len   = frm.arrDay.options.length;
		tmpDt = new Date(yr,mt,i);
		sel   = (tmpDt == currDt) ? true : false;
		
		// Create <option>
		frm.arrDay.options[len] = new Option(i,tmpDt,sel,sel);
	}
}

function setDates(updateDays) {
	
	// When Changing Months we need to reset the
	// days to allow for for selection of any day
	if (updateDays) setDays(new Date(frm.arrMnthYr.options[frm.arrMnthYr.selectedIndex].value));
	
}

//
// Submit!
//
function launchBE( ) {
	//
	// Retrieve form variables
	//
	
	// Nights
	var nights = frm.nights.options[frm.nights.selectedIndex].value;
	// Month/Year
	var mnthYr   = new Date(frm.arrMnthYr.options[frm.arrMnthYr.selectedIndex].value);
	var thisMnth = mnthYr.getMonth();
	var thisYear = mnthYr.getFullYear();
	// Day
	var dt		= new Date(frm.arrDay.options[frm.arrDay.selectedIndex].value);
	var thisDay = dt.getDate();
	
	//
	// Create Arrival Date & Calculate Departure Date values
	//
	
	// Arrival Date
	arrivalDt = (thisMnth+1)+"/"+thisDay+"/"+thisYear;
	// Calculate
	tmpDt = new Date(thisYear,thisMnth,thisDay);
	tm    = tmpDt.getTime();
	tmpDt.setTime(tm+(86400000*nights));
	//Departure Date
	departureDt = (tmpDt.getMonth()+1)+"/"+tmpDt.getDate()+"/"+tmpDt.getFullYear();
	
	//
	// Create the URL String
	//

	var features = frm.hsi.checked ? "width=790,height=590,scrollbars=yes,resizable" : "width=900,height=590,scrollbars=yes,resizable=no";
	
	var url = domain;
	url += frm.hsi.checked ? "/opbe/rez.aspx" : "/xbe/rez.aspx";
	url += "?Chain="+chainId;
	
	var hotelId,arrDt,depDt,adult,child,promo;
	
	
	hotelId = "17254";
	arrDt = arrivalDt;
	depDt = departureDt;
	adult = frm.adult.value;
	child = frm.child.value;
	promo = frm.promo.value;	

	
	// Build final URL
	url 
	+= "&Hotel="+hotelId	  
		+"&Arrive="+arrDt
		+"&Depart="+depDt
		+"&Adult="+adult
		+"&Child="+child
		+"&Promo="+promo
		+"&start=1"	
		//+"&pResvFlag=1"
		//+"&pHotelShell=1"
		+"&Src=ip"
        //+"&Dest=" + dest  //  <-- Added Dynamic values for String Variable "Dest"
		+"&Step=1";
	
		if (hotelId != '')
			if (frm.hsi.checked == true)

			var top= (screen.height - 500)/2; 
				if (top <0) 
					top=0;
				if (wid <0) 
					wid=0; 
		else 
			var top= (screen.height - 393)/2; 
			var wid = (screen.width - 790)/2;
				if (top <0) 
					top=0;
				if (wid <0) 
					wid=0;
	
	if (hotelId != '') 
		if (frm.hsi.checked == true)
			window.open(url);
		else 
			window.open(url);	
			
}// JavaScript Document

function resDetails( ){
	
	
	document.write('<td>');
	document.write('<select name="nights" value="" onChange="setDates(false);" class="resefields">');
	document.write('<option value="1">1</option>');
	document.write('<option value="2">2</option>');
	document.write('<option value="3">3</option>');
	document.write('<option value="4">4</option>');
	document.write('<option value="5">5</option>');
	document.write('<option value="6">6</option>');
	document.write('<option value="7">7</option>');
	document.write('<option value="8">8</option>');
	document.write('<option value="9">9</option>');
	document.write('<option value="10">10</option>');
	document.write('<option value="11">11</option>');
	document.write('<option value="12">12</option>');
	document.write('<option value="13">13</option>');
	document.write('<option value="14">14</option>');
	document.write('</select>');
	document.write('</td>');
	document.write('<td><select name="adult" class="resefields">');
	document.write('<option value="1">1</option>');
	document.write('<option value="2">2</option>');
	document.write('<option value="3">3</option>');
	document.write('<option value="4">4</option>');
	document.write('</select></td>');
	document.write('<td><select name="child" class="resefields">');
	document.write('<option value="0">0</option>');
	document.write('<option value="1">1</option>');
	document.write('<option value="2">2</option>');
	document.write('<option value="3">3</option>');
	document.write('<option value="4">4</option>');
	document.write('</select></td>');

}