
      

//NOTE: This list needs to be synchronized with data in web.config 
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["-MIN"]  = "MINNE" ;   //    Minnesota - 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["MGH"]   = "51329" ;   //   - The Grand Hotel
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["PRP"]   = "56148" ;   //   - RiverPlace Hotel
lf["RGE"]   = "26756" ;   //   - Hotel Rouge
lf["SDP"]   = "53646" ;   //   - Hotel Palomar San Diego
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["SUR"]   = "52564";    //   - Surfcomber Hotel  3 letter version
lf["SURF"]  = "52564" ;   //   - Surfcomber Hotel
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 hashCheckValue(searchVal) {
    var value = "";
    for (var i in lf) {
        if (lf[i] == searchVal ) {
            value = 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 )
		{
    	// use FID code on page to get user ID - this usuall doesnt need to be set, it is included in the top menu
		    var userCheck = getFID();
        //Add promo if we have one
		var PromoString = "";
		if (specialCode != "") PromoString = "promo=" +  specialCode  + "&" ;

		//      "template=gcorcal" + "&" +   REMOVED PER ERIC

		if (userCheck.length > 0) 
            {
             var newurl1 = "https://gc.synxis.com/rez.aspx?" +
            "hotel=" + hashCheckKey(propertyCode) + "&" +
            PromoString +
            "chain=10179" + "&" +
            "level=2" + "&" +
            "Custreftype=5" + "&" +
            "Custrefchain=10179" + "&" +
            "memberprogram=Kimpton%20InTouch" + "&" +
            "custref=" + userCheck + "&" +
            "MemberID=" + userCheck;     
            }
        else
            {
            var newurl1 = "https://gc.synxis.com/rez.aspx?" +
            "hotel=" + hashCheckKey(propertyCode) + "&" +
            PromoString +
            "level=2" + "&" +
             "chain=10179";
        }

        window.open(newurl1,"_self");

		}
		
// 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"); }

//pops -- browser opener
var win = null;
function NewWindow(mypage,myname,w,h,scroll,tool,loca,stat){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',toolbar='+tool+',location='+loca+',status='+stat+',resizable'
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}

//start naming global khutils_ so we can discern them

function khutils_getUrlVars(urltoparse) {
  var vars = [], hash;
  var hashes = urltoparse.slice(urltoparse.indexOf('?') + 1).split('&');
  for (var i = 0; i < hashes.length; i++) {
    hash = hashes[i].split('=');
    vars.push(hash[0]);
    vars[hash[0]] = hash[1];
  }
  return vars;
}
