function initResLauncher() {
	// *** must be set per instance ***
	domain = "https://gc.synxis.com"
	chainId = "1003";
	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 = frm.hotelId.value;
	arrDt = arrivalDt;
	depDt = departureDt;
	adult = frm.adult.value;
	child = frm.child.value;
	promo = frm.promo.value;	
	
	//------------------------------------------------------------------------------------------------------------------------------------------
	// New Extension (needed for new res url)
	
	// Since the default destination is "kor" lets set it. if we have a hotel that
	// has another specific destination we will mark it in the condition statement.
	// all else will default to this.
	var dest = "kor";

	// Lets create a multidimensional array that will contain all the hotel that
	// requires a specific destination.
	// There is no need to add the other hotels as when the condition is performed
	// if it is not in this list it will default to a value of "kor" (or what ever
	// the default is)
	// Structure is as follows: 
	// Column[0] = Name of property or ID (Strict, must match <option> value exactly)
	// Column[1] = Destination 
	// You may ask why do you do it this way? why not just have a single dimension 
	// array and flag those all as "LA" during the condition. It would work fine
	// that way, but this way we can easly add properties that might not fall in
	// the "LA" destination.
	var array_hotel_dest = new Array(
		new Array("1919", "LA"), 	// Avalon Beverly Hills
		new Array("2317", "LA"), 	// Chamberlain West Hollywood
        new Array("1920", "LA"), 	// Maison 140
        new Array("1922", "LA") 	// Viceroy Santa Monica -LAST ENTRY SHOULD HAVE COMA
	);
	
	// lets iterate through the array and see if we can find a destination that
	// needs to be set.
	for (i = 0; i < array_hotel_dest.length; i++)
	{
		// The condition. If the hotelId == to any of the properties listed in 
		// the array above, it will set var dest with the new destination and
		// exit the iteration.
		if (array_hotel_dest[i][0] == hotelId)
		{
			dest = array_hotel_dest[i][1];
			
			// we found a match, new dest has been set lets exit the iteration
			// no need to continue through the array.
			break;
		}
	}
	
	// Build final URL
	url 
	+= "&Hotel="+hotelId	  
		+"&Arrive="+arrDt
		+"&Depart="+depDt
		+"&Adult="+adult
		+"&Child="+child 
		+"&Promo="+promo
		//+"&pResvFlag=1"
		//+"&pHotelShell=1"
		+"&Src=ip"
        +"&Dest=" + dest  //  <-- Added Dynamic values for String Variable "Dest"
		+"&Step=1"
		+"&Lang=1";
	
		if (hotelId != '') {
			var top= (screen.height - 393)/2; 
			var wid = (screen.width - 790)/2;
				if (top <0) 
					top=0;
				if (wid <0) 
					wid=0;
		}
	
	if (hotelId != '') {
		window.open(url);
	}
			
}// JavaScript Document