
      

// START reservationutils.js

var lf = {};

lf["-ARL"]  = "ARLINGVA" ;   //   Arlington - ALL:
lf["-AXV"]  = "ALEXANDRIA" ;   //   Alexandria - ALL:
lf["-ASE"]  = "ASPEN" ;   //    Aspen - ALL:
lf["-ATL"]  = "ATLANTA" ;   //   Atlanta - ALL:
lf["-BLT"]  = "BALTIMORE" ;   //    Baltimore - ALL:
lf["-BOS"]  = "BOSCAM" ;   //    Boston - ALL:
lf["-CAM"]  = "BOSCAM" ;   //    Cambridge - ALL:
lf["-CHI"]  = "CHICAGO" ;   //    Chicago - ALL:
lf["-CUP"]  = "SILICON" ;   //    Silicon Valley - ALL:
lf["-DAL"]  = "DALLAS" ;   //    Dallas - ALL:
lf["-DEN"]  = "DENVER" ;   //    Denver - ALL:
lf["-FSW"]  = "SFFISHER" ;   //    SF Fish. Wharf - ALL:
lf["-LOS"]  = "LOSANG" ;   //   Los Angeles - ALL:
lf["-MIA"]  = "MIAMI" ;   //    Miami - ALL:   
lf["-NYC"]  = "NEWYORK" ;   //    New York - ALL:                  
//lf["-MSY"]  = "129" ;   //    New Orleans - ALL:
lf["-PDX"]  = "PORTLAND" ;   //    Portland - ALL:
lf["-PHL"]  = "PHILLY" ;   //   Philadelphia - ALL:
lf["-SAN"]  = "SANDIEGO" ;   //    San Diego - ALL:
lf["-PHX"]  = "SCOTTS" ;   //    Scottsdale - ALL:
lf["-SEA"]  = "SEATTLE" ;   //    Seattle - ALL:
lf["-SFO"]  = "SANFRAN" ;   //    San Francisco - ALL:
lf["-SLC"]  = "SALTLAKE" ;   //    Salt Lake City - ALL:
lf["-VER"]  = "VEROB" ;   //    Vero Beach, FL - ALL:
lf["-DCA"]  = "DCVA" ;   //    Washington D.C. - ALL:
//lf["-WHIS"] = "169" ;   //    BC Whistler - ALL:
lf["-YVR"]  = "160" ;   //    BC Vancouver - ALL:
lf["ALG"]   = "26719" ;   //   - Hotel Allegro
lf["ALM"]   = "26720" ;   //   - Hotel Monaco Alexandria
lf["ALX"]   = "26721" ;   //   - Hotel Alexis
lf["ARG"]   = "26722" ;   //   - Argonaut Hotel
lf["ARP"]   = "26723" ;   //   - Hotel Palomar Arlington
lf["ASP"]   = "26724" ;   //   - Sky Hotel
lf["ATP"]   = "26725" ;   //  - Hotel Palomar Atlanta
lf["BUR"]   = "26726" ;   //   - Hotel Burnham
lf["CLO"]   = "26728" ;   //   - FireSky Resort & Spa
lf["CHP"]   = "26727" ;   //   - Hotel Palomar Chicago
lf["CMN"]   = "26729" ;   //   - Hotel Monaco Chicago
lf["CYP"]   = "26730" ;   //   - Cypress Hotel
lf["DCM"]   = "26731" ;   //   - Hotel Monaco DC
lf["DCP"]   = "26732" ;   //   - Hotel Palomar Washington DC
lf["DLP"]   = "26733" ;   //   - Hotel Palomar Dallas
lf["DMN"]   = "26734" ;   //   - Hotel Monaco Denver
lf["EPC"]   = "26735" ;   //   - EPIC Hotel
lf["EVE"]   = "26736" ;   //   - Eventi Hotel
lf["FAS"]   = "26737" ;   //   - Hotel Monaco Portland
lf["GRG"]   = "26738" ;   //   - Hotel George
lf["HCT"]   = "26739" ;   //   - Harbor Court Hotel
lf["HEL"]   = "26740" ;   //   - Helix Hotel
lf["INK"]   = "26741" ;   //   - INK48
lf["LRN"]   = "26742" ;  //   - Lorien Hotel & Spa
lf["LUM"]   = "26743" ;  //   - Hotel Lumen
lf["LWP"]   = "26744" ;  //   - Hotel Palomar Westwood
lf["MAD"]   = "26745" ;   //   - Madera Hotel
//lf["MAY"]   = "124" ;   //   - Mayfair Hotel & Spa
lf["MLW"]   = "26746" ;   //   - Hotel Marlowe
//lf["MNT"]   = "148" ;   //   - Monticello Inn
lf["MNB"]   = "26747" ;   //   - Hotel Monaco Baltimore
lf["MON"]   = "26748" ;   //   - Hotel Monaco San Francisco
lf["MRR"]   = "26749" ;   //  - Morrison House
lf["MSE"]   = "26750" ;   //   - The Muse Hotel
lf["NNZ"]   = "26751" ;   //   - Nine Zero Hotel
//lf["NOM"]   = "130" ;   //   - Hotel Monaco New Orleans
lf["ONX"]   = "26752" ;   //   - Onyx Hotel
lf["PAL"]   = "26753" ;   //   - Hotel Palomar San Francisco
lf["PHP"]   = "26754" ;   //  - Hotel Palomar Philadelphia
//lf["PPH"]   = "161" ;   //   - Pacific Palisades Hotel
lf["PRS"]   = "26755" ;   //   - Prescott Hotel
lf["RGE"]   = "26756" ;   //   - Hotel Rouge
lf["SER"]   = "26757" ;   //   - Hotel Serrano
lf["SFD"]   = "26758" ;   //   - Sir Francis Drake Hotel
lf["SLM"]   = "26759" ;   //   - Hotel Monaco Salt Lake City
lf["SMN"]   = "26760" ;   //   - Hotel Monaco Seattle
lf["SOL"]   = "26761" ;   //   - Hotel Solamar
lf["SPA"]   = "26762" ;   //   - 70 Park Avenue Hotel 
//lf["SUM"]   = "170" ;   //   - Summit Lodge
lf["TPZ"]   = "26763" ;   //   - Hotel Topaz
lf["TRI"]   = "26764" ;   //   - Hotel Triton
//lf["VFL"]   = "152" ;   //   - Villa Florence
lf["VPK"]   = "26765" ;   //   - Hotel Vintage Park
lf["VPZ"]   = "26766" ;   //   - Hotel Vintage Plaza
//lf["VHT"]   = "3699" ;   //   - VU hotel
lf["VRB"]   = "26767" ;   //   - Vero Beach Hotel & Spa
//lf["DUP"]   = "255" ;   //   - Dupont Circle Hotel
                 
function hashCheckKey(key)
		{
    var value = "100";
    for (var i in lf) 
    	{
      if (i == key && lf[i] != null) 
        {
        value = lf[i];
        break;
        }
    	}
    return value;
		}
			
	
function getFID()
	{
		if( typeof(FGID) !="undefined"  )    
			{
	//		alert("heres FGID: " + FGID);
			
			//Check if number greater than 0
	     myRegExp = /[0-9]+/g
      if(myRegExp.test(FGID)) 
    		{
    		if ( FGID != "0") //ok, got a logged in user, now check type
    			 { 
    			 if ( checkValidUserType() ) 			return FGID;
    		   else return "";
    		   }	
			  }	 
			}  
			return "";
	}    	
	
	
	function checkValidUserType()
		{
		if( typeof(FGTYPE) !="undefined"  )    
			{
	//		alert("heres FGTYPE: " + FGTYPE);
			//FGTYPE is a copy of profiletype from session..
			if ( FGTYPE == "NotEnrolled" )  	return false;
			else                    		    	return true;
			
			}	 
		else
			{
			return false;
			}
		}	

	

function GoPropertySpecial(propertyCode , specialCode )
		{
    	
		
		//FID NEEDS TO BE SET IN ASPX PAGE
		
		//Check if there is value returned when runing getFID();
		var userCheck = getFID();
		
		
		var PromoString = "";
		
		if (specialCode != "") PromoString = "promo=" +  specialCode  + "&" ;
		
	//	alert("promo " + PromoString);
		
		//Custreftype=5&Custrefchain=10179&memberprogram=Kimpton InTouch&custref=<MEMBERID>&MemberID=<MEMBERID>&firstname=<FIRSTNAME>&lastname=<LASTNAME>
		if ( userCheck.length > 0 ) {
			var newurl1 = "https://gc.synxis.com/rez.aspx?" + 
			"hotel"         		 + "=" +     hashCheckKey(propertyCode)   + "&" +   
		  PromoString +
			//"module"                 + "=" +     "PropertySearch"             + "&" +           
			//"operation"              + "=" +     "SinglePropertySearch"       + "&" +           
			//"execute"                + "=" +     "yes"                        + "&" +           
			//"propertyCodeType"       + "=" +     "RV"                         + "&" +           
			"chain"    		          + "=" +     "10179"                      + "&" +       
			"level"    		          + "=" +     "2"                      		+ "&" + 

			//"instanceId"             + "=" +     "31"                         + "&" +           
			//"propertyCode"           + "=" +     propertyCode                 + "&" +           
			"Custreftype"  	          + "=" +     "5"                      + "&" +           
			"Custrefchain"	          + "=" +     "10179"                      + "&" + 	 
			"memberprogram"	          + "=" +     "Kimpton%20InTouch"             + "&" +           
			"custref"             + "=" +     userCheck                   + "&" +           
			"MemberID"	          + "=" +     userCheck             + "&" +           
			"firstname"	          + "=" +     ""             + "&" +           
			"lastname"	          + "=" +     "";
		} else {
			var newurl1 = "https://gc.synxis.com/rez.aspx?" + 
			"hotel"         		 + "=" +     hashCheckKey(propertyCode)   + "&" +   
			//"module"                 + "=" +     "PropertySearch"             + "&" +           
			//"operation"              + "=" +     "SinglePropertySearch"       + "&" +           
			//"execute"                + "=" +     "yes"                        + "&" +           
			//"propertyCodeType"       + "=" +     "RV"                         + "&" +       
			  PromoString +    
			"level"    		          + "=" +     "2"                      		+ "&" + 
			"chain"    		          + "=" +     "10179"           ;             
			//"instanceId"             + "=" +     "31"                         + "&" +           
			//"propertyCode"           + "=" +     propertyCode                 + "&" +           
			//"memberid"    			    + "=" +     getFID()                         ;
		}
		
		
		
		
		//"adults"               + "=" +     adults                       + "&" +           
		//"children"             + "=" +     children                     + "&" +           
		//"numberOfRooms"        + "=" +     "1"                          + "&" +           
		//"promotionCode"        + "=" +     ""                           + "&" +           
		//"rateCode"             + "=" +     ""                           + "&" +           
		//"corporateId"          + "=" +     ""                           + "&" +           
		//"travelAgentId"        + "=" +     ""                           + "&" +           
		//"arriveDate"           + "=" +     startDay                     + "&" +           
		//"arriveMonth"          + "=" +     startMonth                   + "&" +           
		//"arriveYear"           + "=" +     startYear                    + "&" +           
		//"departDate"           + "=" +     departDay                    + "&" +           
		//"departMonth"          + "=" +     departMonth                  + "&" +           
		//"departYear"           + "=" +     departYear                   + "&" +           
 // 		"promo"            + "=" +     specialCode                  + "&" +           
		//"numberofnights"       + "=" +     numNights                    + "&" +           
		//"lookAndFeelId"          + "=" +     hashCheckKey(propertyCode)   + "&" +   
		//"frequentGuestId"        + "=" +     getFID()                         ;

  //window.open(newurl1,"Reservations","toolbar=no,width=970,height=705,status=no,scrollbars=yes,directories=no,resizable=yes,menubar=no");
 window.open(newurl1,"_self");

//alert(newurl1);

		}
		
// DATE CODE

 var monthName = new Array ("January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November", "December");
 var dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday");
 var calendarCtrlStrings = new Array ("","","Close");
 
 
function Launch(page) { OpenWin = this.open(page, "KirupaStyle", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=yes,width=800,height=600"); } 
function Launch_hotel(page) { OpenWin = this.open(page, "KirupaStyle", "toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes,width=820,height=600"); } 