        	var successPath = 'http://www.starwoodhotels.com/luxury/search/ratelist.html';

        
        var aLoginFormArgs = new Array();
        aLoginFormArgs[0] = new Array("FormName","login");
        aLoginFormArgs[1] = new Array("FormAction","http://www.starwoodhotels.com/luxury/account/verify_login.html");
        aLoginFormArgs[2] = new Array("returnURL",window.location.href);
        function LoginForm_Submit()
        {
            location.href = ISS_FS_ReturnFormGet(aLoginFormArgs);
            //alert(ISS_FS_ReturnFormGet(aLoginFormArgs));
        }
					function ISS_FS_ReturnFormGet(aFormArgs, siteLoc)
					{
						//alert('here->' + aFormArgs.length); 
						var sArgs = '';
						for (var aNum = 2; aNum < aFormArgs.length; aNum++)
						{   
						    var sThisArgName = aFormArgs[aNum][0];
						    var sThisArgValue = aFormArgs[aNum][1];
							sArgs = sArgs + sThisArgName + "=" + sThisArgValue + "&";
							//alert(sArgs);
						}
						sArgs = sArgs + "flashContent=nonflash&" + siteLoc;
						return aFormArgs[1][1] + "?" + sArgs;
					}
					 function openBrWindow(theURL,winName,features) {
			        window.open(theURL,winName,features);
		        }
function formValidate(){
	var username = document.getElementById("login");
	var pass = document.getElementById("password");
	var userErr = document.getElementById("loginErr");
	var passErr = document.getElementById("passErr");
	var errorMsg = document.getElementById("errorMsg");
	var flag = true;
	
	if(!username.value || username.value == "Enter Numbers Only" || username.value.match(/\D/)!=null){
			errorMsg.style.display = 'block';
			userErr.className = 'view';
			flag =false;
		}
	if(!pass.value ){
			errorMsg.style.display = 'block';
			passErr.className = 'view';
			flag = false;
		}
		
		return flag;
	}
function resetForm(){
		var userErr = document.getElementById("loginErr");
		var passErr = document.getElementById("passErr");
		var errorMsg = document.getElementById("errorMsg");
		
		errorMsg.style.display = "none";
		passErr.className = "";
		userErr.className = "";
	}
/**/

var dateFormatString = dateFormatString || 'MM/DD/YYYY';
    var moCurrentCal = null;
    var mvCurrentIndex = null;
    var moLanguageObj = {};
    moLeftArrow = new Image();
    moLeftArrow.src = "/luxury/images/icons/lc_calendar_leftarrow.gif";
    moRightArrow = new Image();
    moRightArrow.src = "/luxury/images/icons/lc_calendar_rightarrow.gif";
    moCloseX = new Image();
    moCloseX.src = "/luxury/images/icons/lc_calendar_closeX.gif";
    moLanguageObj.calendarMonthNameArray    = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
    moLanguageObj.calendarShortMonthArray   = new Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");
    moLanguageObj.calendarDayNameArray      = new Array("Su","M","Tu","W","Th","F","Sa");

    moLanguageObj.calendarErrorArray        = new Array();
    moLanguageObj.calendarErrorArray[0]     = "For stays longer than 31 nights, please call 866-539-3446."
    moLanguageObj.calendarErrorArray[1]     = "You can only book up to 550 days in advance.";
    moLanguageObj.calendarErrorArray[2]     = "Arrival date cannot be earlier than today.";
    moLanguageObj.calendarErrorArray[3]     = "Departure date cannot be earlier than arrival date.";
    moLanguageObj.calendarErrorArray[4]     = "Arrival and departure date cannot be on the same day.";
    moLanguageObj.calendarErrorArray[5]     = "Please select a check-in and checkout date.";
    moLanguageObj.calendarErrorArray[6]     = "Please select a checkout date.";

    moLanguageObj.menuNotSelected           = "Not Selected";
    moLanguageObj.menuNoLOS                 = "--";
    moLanguageObj.menuTravelDatesTo         = "to";
    moLanguageObj.menuLOSUnit               = "nights";
    moLanguageObj.calendarClose             = "Close";
    moLanguageObj.calendarInstructionLabel  = '';
    moLanguageObj.calendarInstructionText   = "Click your check-in date, and then click on your check-out date.";
    moLanguageObj.calendarClear             = "Clear Calendar";
    moLanguageObj.calendarPrev              = "Previous";
    moLanguageObj.calendarNext              = "Next";
    moLanguageObj.menuTravelDates           = "Travel Dates:";
    moLanguageObj.menuLengthOfStay          = "Length of Stay:";
    moLanguageObj.calendarContinue          = "Continue";

    // Function to toggle the calendar display and create the calendar object the 1st time
    function fnInitializeCalendar(pCurrentIndex, pCalendarId, pCIDate, pCODate, pReturnFunction, e){
        mvCurrentIndex = pCurrentIndex;
        var loTempCal;
        var lsConvertedCIDate = function(){
            return setDateFromString("en", (pCIDate.value != dateFormatString) ? pCIDate.value : "");
        }
        var lsConvertedCODate = function(){
            return setDateFromString("en", (pCODate.value != dateFormatString) ? pCODate.value : "");
        }

        loTempCal = new multiDisplayCalendar(pCalendarId, lsConvertedCIDate, lsConvertedCODate, pReturnFunction);
        moCurrentCal = loTempCal;
        return true;
    }
    // method called from the calendar continue buton.  validate the form and submit
    function fnSetInfoToFields(pCIDate, pCODate, pFromContinue){
        var loForm = document['bookOffer_' + mvCurrentIndex];
        if(pCIDate != null && pCODate != null){
            writeDateToField(loForm['ciDate_' + mvCurrentIndex], pCIDate, dateFormatString);
            writeDateToField(loForm['coDate_' + mvCurrentIndex], pCODate, dateFormatString);
        }
        else{
            loForm['ciDate_' + mvCurrentIndex].value = dateFormatString;
            loForm['coDate_' + mvCurrentIndex].value = dateFormatString;
        }
        if(pFromContinue){
            document.getElementById('optionalFlag_' + mvCurrentIndex).style.display = 'none';
            document.getElementById('selectDatesLink_' + mvCurrentIndex).innerHTML = fnGetDisplayDate(pCIDate) + ' to ' + fnGetDisplayDate(pCODate);
            loSubForm = document.bookOffer;
            loSubForm.reset();
            loSubForm.arrivalDate.value = fnFormatDateExport(pCIDate);
            loSubForm.departureDate.value = fnFormatDateExport(pCODate);
            loSubForm.lengthOfStay.value = padZero(fnGetDateDifference(pCIDate, pCODate));
            loSubForm.ratePlanName.value = loForm['ratePlanName_' + mvCurrentIndex].value;
            loSubForm.promoCode.value = loForm['promoCode_' + mvCurrentIndex].value;
            loSubForm.submit();
        }
        else{
            if(pCIDate == null && pCODate == null){
                document.getElementById('optionalFlag_' + mvCurrentIndex).style.display = 'inline';
                document.getElementById('selectDatesLink_' + mvCurrentIndex).innerHTML = "Select Dates";
            }
        }
    }

    function fnFormatDateExport(pDateToFormat){
        var lsDateString = '';
        if(pDateToFormat){
            var loFormatDate = new Date(pDateToFormat);
            lsDateString = loFormatDate.getFullYear() + '-' + padZero(loFormatDate.getMonth() +1) + '-' + padZero(loFormatDate.getDate());
        }
        return lsDateString;
    }

    // close the calendar if the document is clicked
    if(document.getElementById("siteContainer")){
        document.getElementById("siteContainer").onclick = fnHideCurrentCal;
    }

    function fnHideCurrentCal(){
        if(moCurrentCal){
            if(moCurrentCal.display == "block"){
                moCurrentCal.toggleDisplay();
                moCurrentCal = null;
            }
        }
    }
    function toggleCalendar(e,button,calendarId,offerCode) {
        mvCurrentIndex = offerCode;
      calendar = moCalendarManagerCiCo.calArray[calendarId];
      calendar.show(button,'bottomLeft');
      var lvEvent = e || window.event;
      lvEvent.cancelBubble = true;
      if (lvEvent.stopPropagation) lvEvent.stopPropagation();
      return;
    }

	function brandNavClose()	{
	document.getElementById("brandNavBrandList").style.visibility = "hidden";
	document.getElementById("brandNavIframeShim").style.display = "none";
}

function brandNavOpen()	{
	document.getElementById("brandNavBrandList").style.visibility = "visible";
	document.getElementById("brandNavIframeShim").style.display = "block";
}

function popUp(URL,popWidth,popHeight, scrollbars) {
	var useScrollBars = scrollbars || "0";
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars="+useScrollBars+",location=0,statusbar=0,menubar=0,resizable=0,width="+popWidth+",height="+popHeight+",left=242,top=114');");
}



