
var hotels=[];

// 3 regions/countries -- US, Canada, Caribbean
   
           
           
hotels.can=[['Hyatt Regency Calgary','calrc'],['Hyatt Regency Montreal','mtlrm'],['Hyatt Regency Vancouver','yvrrv']]

hotels.car=[ ['Hyatt Regency Aruba Resort & Casino', 'aruba' ], ['Hyatt Regency Trinidad','trirt']] 

            hotels.us=[['Hyatt Regency Tamaya Resort & Spa','tamay'] ,
                       ['Hyatt Regency Albuquerque ','albuq'] ,
                       ['Hyatt Place Albuquerque Airport','abqza'] ,
                       ['Hyatt Place Albuquerque/Uptown','abqzu'] ,
                       ['Grand Hyatt Atlanta in Buckhead','atlgh'] ,
                       ['Hyatt Place Atlanta Airport-North','atlza'] ,
                       ['Hyatt Place Atlanta Airport-South','atlzs'] ,
					   ['Hyatt Place Atlanta-East/Lithonia','atlzl'] ,
					   ['Hyatt Place Atlanta/Alpharetta/Windward Parkway','atlzi'] ,
					   ['Hyatt Place Atlanta/Buckhead','atlzb'] ,
					   ['Hyatt Place Atlanta/Cobb Galleria','atlzg'] ,
					   ['Hyatt Place Atlanta/Duluth/Gwinnett Mall','atlzw'], 
					   ['Hyatt Place Atlanta/Duluth/Johns Creek','atlzj'] ,
					   ['Hyatt Place Atlanta/Norcross/Peachtree','atlzn'] ,
                       ['Hyatt Place Atlanta/Perimeter Center','atlzp'] ,
					   ['Hyatt Place Atlanta/Alpharetta/North Point Mall','atlzm'],					 
					   ['Hyatt Regency  Atlanta','atlra'] ,
					   ['Hyatt Regency Suites Atlanta Northwest','atlrs'] ,
					   ['Hyatt Place Austin-North Central','auszn'] ,
					   ['Hyatt Place Austin/Arboretum','ausza'] ,                      
                       ['Hyatt Regency Austin','ausra'] ,
                       ['Hyatt Regency Lost Pines Resort and Spa','auslp'] ,                      
                       ['Hyatt Summerfield Suites Austin/Arboretum','ausxa'] ,
					   ['Hyatt Place Baltimore/BWI Airport','bwiza'] ,
					   ['Hyatt Place Baltimore/Owings Mills','bwizo'] ,
                       ['Hyatt Regency Baltimore','bwirb'] ,  
					   ['Park Hyatt Beaver Creek Resort and Spa','beave'] ,                     
                       ['Hyatt Place Baton Rouge/I-10','btrzs'] ,				   					   
                       ['Hyatt Regency Bellevue','belle'] ,
                       ['Hyatt Place Birmingham/Inverness','bhmzi'] ,
                       ['Hyatt Place Birmingham/Hoover','bhmzh'] ,
                       ['Hyatt Place Boise/Towne Square','boizt'] ,
                       ['Hyatt Regency Coconut Point Resort & Spa','naprn'] ,
                       ['Hyatt Harborside at Boston\'s Logan International Airport','bosha'] ,
                       ['Hyatt Regency Cambridge','bosrc'] ,
                       ['Hyatt Regency Boston','bosto'] ,
                       ['Hyatt Place Boston/Medford','boszm'] ,
                       ['Hyatt Summerfield Suites Boston/Waltham','bosxw'] ,
                       ['Hyatt Summerfield Suites Boston/Burlington','bosxb'] ,
                       ['Hyatt Summerfield Suites Bridgewater','ewrxb'] ,
                       ['Hyatt Regency Buffalo','buffa'] ,
                       ['Hyatt Regency Chesapeake Bay','chesa'] ,
					   ['Hyatt Place Charlotte/Arrowood','cltzc'] ,
                       ['Hyatt Place Charlotte/City Park','cltzt'] ,
                       ['Hyatt Place Charlotte Airport/Tyvola Road','cltzo'] ,
                       ['Hyatt Summerfield Suites Charlotte Airport','cltxc'] ,
                       ['The Hyatt Lodge at McDonald\'s Campus','chilo'] ,
                       ['Hyatt Regency McCormick Place','chimc'] ,
                       ['Hyatt Regency Chicago','chirc'] ,
                       ['Hyatt Regency O\'Hare','chiro'] ,
                       ['Hyatt Regency Woodfield','chirw'] ,
                       ['Hyatt Deerfield','deerf'] ,
                       ['Hyatt Lisle','lisle'] ,
                       ['Hyatt Rosemont','rosem'] , 
					   ['Hyatt Summerfield Suites Chicago/Schaumburg','chixs'] ,
					   ['Hyatt Place Chicago Schaumburg','chizs'] ,
					   ['Hyatt Place Chicago/Hoffman Estates','chizh'] ,
                       ['Hyatt Place Chicago/Itasca','chizi'] ,
                       ['Hyatt Place Chicago/Lombard/Oak Brook','chizl'] ,
                       ['Hyatt Place Cincinnati Airport/Florence','cinza'] ,
                       ['Hyatt Regency Cincinnati','cinci'] ,
                       ['Hyatt Place Cincinnati-Northeast','cinzn'] ,
                       ['Hyatt Place Cincinnati/Blue Ash','cinzb'] ,
                       ['Hyatt Regency Cleveland - Arcade','clerc'] ,
                       ['Hyatt Place Cleveland/Independence','clezi'] ,
                       ['Hyatt Place Colorado Springs/Garden of the Gods','coszc'] ,
                       ['Hyatt Summerfield Suites Colorado Springs','cosxc'] ,
                       ['Hyatt Place Columbia/Harbison','caezh'] ,
					    ['Hyatt Place Columbus North','csgzc'] ,
                       ['Hyatt on Capitol Square','capit'] ,					  
                       ['Hyatt Regency Columbus','cmhrc'] ,
                       ['Hyatt Place Columbus/Dublin','cmhzd'] ,                      
                       ['Hyatt Place Columbus/Worthington','cmhzw'] ,					  
                       ['Hyatt Regency DFW Airport','dfwap'] ,
                       ['Grand Hyatt DFW','dfwgh'] ,
                       ['Hyatt Regency Dallas','dfwrd'] ,
                       ['Hyatt Place Dallas/Plano','dfwzp'] ,
                       ['Hyatt Place Dallas-North','dfwzn'] ,
                       ['Hyatt Place Dallas/Arlington','dfwza'] ,
                       ['Hyatt Place Dallas/Grand Prairie','dfwzg'] ,
                       ['Hyatt Place Dallas/Grapevine','dfwzd'] ,
                       ['Hyatt Place Dallas/Las Colinas','dfwzw'] ,
					    ['Hyatt Place Dallas/Park Central','dfwze'] ,
                       ['Hyatt Summerfield Suites Dallas/Lincoln Park','dfwxp'] ,
                       ['Hyatt Summerfield Suites Dallas/Richardson','dfwxr'] ,
                       ['Hyatt Summerfield Suites Dallas/Uptown','dfwxu'] ,
                       ['Hyatt Summerfield Suites Dallas/Addison','dfwxa'] ,
					   ['Hyatt Summerfield Suites Dallas/Las Colinas','dfwxl'] ,
                       ['Hyatt Regency Denver','dencc'] ,
                       ['Grand Hyatt Denver','denrd'] ,
                       ['Hyatt Regency Tech Center - Denver','denve'] ,
                       ['Hyatt Place Denver Tech Center','denzt'] ,
                       ['Hyatt Place Denver-South/Park Meadows','denzs'] ,
                       ['Hyatt Place Denver Airport','denza'] ,
                       ['Hyatt Summerfield Suites Denver Tech Center','denxt'] ,
                       ['Hyatt Regency Dearborn','dttrd'] ,
                       ['Hyatt Place Detroit/Auburn Hills','detza'] ,
                       ['Hyatt Place Detroit/Utica','detzu'] ,
                       ['Hyatt Place Detroit/Livonia','detzl'] ,					   
                       ['Hyatt Dulles','dulle'] ,
					   ['Hyatt Regency Reston','resto'],					   
                       ['Hyatt Place Chantilly/Dulles Airport-South','iadzs'] ,
					   ['Hyatt Place Sterling/Dulles Airport-North','iadzn'] ,
					   ['Hyatt Summerfield Suites Herndon','iadxh'] ,
                       ['Hyatt Place El Paso Airport','elpza'] ,
                       ['Hyatt Place Fair Lawn/Paramus','ewrzf'] ,
                       ['Hyatt Fair Lakes','fairl'] ,
                       ['Hyatt Regency Bonaventure Conference Center & Spa','ftlfl'] ,
                       ['Hyatt Regency Pier Sixty-Six Resort & Spa','ftlhp'] ,
                       ['Hyatt Place Fort Wayne','fwazf'] ,
                       ['Hyatt Place Fort Worth/Hurst','dfwzh'] ,
                       ['Hyatt Place Fort Worth/Cityview','dfwzc'] , 
                       ['Hyatt Place Fremont/Silicon Valley','sfozf'] , 
					   ['Hyatt Summerfield Suites Gaithersburg','wasxg'] ,
                       ['Hyatt Place Greensboro','gsozg'] ,
                       ['Hyatt Regency Greenville','gsprg'] ,
					   ['Hyatt Place Greenville/Haywood','pgvzg'] ,
                       ['Hyatt Regency Greenwich','gwich'] ,
                       ['Hyatt Regency Waikiki Beach Resort and Spa','hnlrw'] ,
                       ['Hyatt Regency Houston','hourh'] ,
                       ['Hyatt Place Houston/Greenspoint/IAH Airport','houza'] ,
                       ['Hyatt Summerfield Suites Houston/Energy Corridor','houxw'] ,
                       ['Hyatt Summerfield Suites Houston/Galleria','houxg'] ,
                       ['Hyatt Regency Huntington Beach Resort & Spa','hunrh'] ,
                       ['Hyatt Regency Lake Tahoe Resort, Spa and Casino','tvllt'] ,
                       ['Hyatt Grand Champions Resort, Villas and Spa','champ'] ,
                       ['Hyatt Regency Indianapolis','indri'] ,
                       ['Hyatt Place Indianapolis Airport','indza'] ,
                       ['Hyatt Place Indianapolis/Keystone','indzk'] ,					   
                       ['Hyatt Regency Irvine','irvin'] ,
                       ['Hyatt Regency Jacksonville Riverfront','jaxrj'] ,					   
                       ['Hyatt Regency Jersey City on the Hudson','newjp'] ,
					   ['Hyatt Place Kansas City/Overland Park/Conv Cntr','mkczc'] ,
                       ['Hyatt Place Kansas City/Overland Park/Metcalf','mkczm'] ,
                       ['Hyatt Regency Crown Center','mkcrk'] ,                     
                       ['Hyatt Place Kansas City Airport','mkcza'] ,
                       ['Hyatt Key West Resort and Spa','kwest'] ,
                       ['Grand Hyatt Kauai Resort and Spa','kauai'] ,
                       ['Hyatt Place Las Vegas','laszl'] ,
                       ['Hyatt Regency Lexington','lexrl'] ,
                       ['Hyatt Regency Long Island','haupp'] ,
                       ['Hyatt Regency Century Plaza','laxcp'] ,
                       ['Hyatt Regency Long Beach','lgbrl'] ,
                       ['Hyatt Westlake Plaza in Thousand Oaks','westl'] ,
					   ['Hyatt Valencia/Santa Clarita Conference Center','valen'] ,
                       ['Hyatt Place Louisville-East','sdfze'] ,
					   ['Hyatt Regency Louisville','sdfrl'] ,
					   ['Hyatt Place Saratoga/Malta','albzs'] ,
                       ['Hyatt Regency Maui Resort and Spa','oggrm'] ,
                       ['Hyatt Place Memphis/Primacy Parkway','memzp'] ,
                       ['Hyatt Place Memphis/Wolfchase Galleria','memzw'] ,
                       ['Hyatt Regency Coral Gables','coral'] ,
                       ['Hyatt Regency Miami','miarm'] ,
                       ['Hotel Victor','victo'] ,
                       ['Hyatt Place Miami Airport-West/Doral','miazd'] ,
                       ['Hyatt Summerfield Suites Miami Airport','miaxm'] ,
                       ['Hyatt Regency Milwaukee','mkerm'] ,
                       ['Hyatt Place Minneapolis/Eden Prairie','mspze'] ,
                       ['Hyatt Place Minneapolis Airport-South','mspza'] ,
					   ['Hyatt Regency Minneapolis','msprm'] ,
					   ['Hyatt Regency Monterey','mrydm'],
                       ['Hyatt Morristown at Headquarters Plaza','morrm'] ,
                       ['Hyatt Summerfield Suites Morristown','morxm'] ,
                       ['Hyatt Place Mt. Laurel','phlzm'] ,
					   ['Hyatt Summerfield Suites Mt. Laurel','phlxm'] ,
                       ['Hyatt Place Mystic','bdlzy'] ,
                       ['Hyatt Place Nashville/Opryland','bnazo'] ,
                       ['Hyatt Place Nashville-Northeast','bnazh'] ,
                       ['Hyatt Place Nashville/Brentwood','bnazb'] ,
                       ['Hyatt Place Nashville Airport','bnaza'] ,
                       ['Hyatt Place Nashville/Franklin/Cool Springs','bnazf'] ,
					   ['Hyatt Regency New Brunswick','eerrn'] ,					
                       ['Grand Hyatt New York','nycgh'] ,
					   ['Hyatt Regency Newport','rinew'] ,
                       ['Hyatt Regency Newport Beach','newpo'] , 
					   ['Hyatt Place Oklahoma City Northwest','okczn'] ,
                       ['Hyatt Place Oklahoma City Airport','okczo'] ,
                       ['Hyatt Place Ontario Mills','ontzo'] ,					   
                       ['Hyatt Regency Orange County','alica'] ,
                       ['Hyatt Regency Orlando International Airport','orlan'] ,
                       ['Hyatt Regency Grand Cypress','vista'] ,
                       ['Hyatt Place Orlando/Universal','orlzu'] ,
                       ['Hyatt Place Orlando/Convention Center','orlzl'] ,
                       ['Hyatt Regency Philadelphia at Penn\'s Landing','penrp'] ,
                       ['Hyatt Summerfield Suites Philadelphia/Plymouth Meeting','phlxp'] ,
                       ['Hyatt Regency Phoenix','phxrp'] ,
                       ['Hyatt Place Phoenix-North','phxzn'] ,					   
                       ['Hyatt Place Tempe/Phoenix Airport','phxza'] ,					   
                       ['Hyatt Regency Pittsburgh Int\'l Airport','pitap'] ,
                       ['Hyatt Place Pittsburgh/Cranberry','pitzc'] ,
                       ['Hyatt Place Pittsburgh Airport','pitza'] ,
                       ['Hyatt Summerfield Suites Pleasant Hill','oakxh'] ,
                       ['Hyatt Summerfield Suites Pleasanton','oakxp'] ,					   
					   ['Hyatt Place Dublin/Pleasanton','sfozb'] ,
                       ['Hyatt Regency Princeton','princ'] ,
                       ['Hyatt Place Princeton','ewrzp'] ,
                       ['Hyatt Place Raleigh-North','rduzw'] ,
                       ['Hyatt Place Raleigh - Durham Airport','rduzr'] ,
                       ['Hyatt Place Richmond/Innsbrook','riczi'] ,
                       ['Hyatt Place Richmond/Arboretum','ricza'] ,
                       ['Hyatt Place Richmond/Chester','riczc'] ,
					   ['Hyatt Place Roanoke Airport/Valley View Mall','roazr'] ,
                       ['Hyatt Regency Rochester','roche'] ,
                       ['Hyatt Place Rogers/Bentonville','rogzb'] ,
                       ['Hyatt Regency Sacramento','sacra'] ,
                       ['Hyatt Place Sacramento/Rancho Cordova','saczr'] ,
                       ['Hyatt Regency Hill Country Resort and Spa','sanhc'] ,
                       ['Grand Hyatt San Antonio','satgh'] ,
                       ['Hyatt Regency San Antonio','satrs'] ,
                       ['Hyatt Place San Antonio-Northwest/Medical Center','satzn'] ,
                       ['Hyatt Place San Antonio/Riverwalk','satzr'] ,
					    ['Hyatt Place San Antonio Airport South','satza'] ,
                       ['Hyatt Regency La Jolla at Aventine','jolla'] ,
                       ['Hyatt Regency Mission Bay Spa and Marina','sanis'] ,
                       ['Manchester Grand Hyatt San Diego','sanrs'] ,
                       ['Hyatt Regency San Francisco Airport','sfobu'] ,
                       ['Hyatt at Fisherman\'s Wharf','sfofw'] ,
                       ['Hyatt Regency San Francisco','sfors'] ,
                       ['Grand Hyatt San Francisco','sfous'] ,
                       ['Hyatt Regency Santa Clara','clara'] ,
                       ['Hyatt Regency Sarasota','srqss'] ,
                       ['Hyatt Regency Savannah','savrs'] ,
                       ['Hyatt Regency Scottsdale Resort and Spa at Gainey Ranch','scott'] ,
                       ['Hyatt Place Scottsdale/Old Town','scozo'] ,
                       ['Hyatt Summerfield Suites Scottsdale/Old Town','phxxs'] ,
					   ['Grand Hyatt Seattle','seagh'] ,	
                       ['Hyatt Place Secaucus/Meadowlands','ewrzs'] ,
                       ['Hyatt Vineyard Creek Hotel and Spa','sonom'] ,					   
					   ['Hyatt Place South Bend/Mishawaka','sbnzm'] ,
                       ['Hyatt Regency St Louis','stlou'] ,
					   ['Hyatt Regency St Louis Riverfront','stlrs'] ,                    
                       ['Hyatt Regency Tampa','tpart'] ,
                       ['Grand Hyatt Tampa Bay','tparw'] ,
                       ['Hyatt Place Tampa/Busch Gardens','tpazb'] ,
                       ['Hyatt Place Tampa Airport/Westshore','tpazw'] ,					   
                       ['Hyatt Place Lakeland Center','tpazl'] ,					   
					   ['Hyatt Place Topeka Northwest','topzt'] ,
                       ['Hyatt Place Tucson Airport','tusza'] ,
                       ['Hyatt Place Tulsa/Southern Hills','tulzs'] ,
                       ['Grand Hyatt Washington','wasgh'] ,
                       ['Hyatt Regency Washington on Capitol Hill','wasrw'] ,
                       ['Hyatt Regency Bethesda','bethe'] ,
                       ['Hyatt Regency Crystal City at Reagan National Airport','wasrc'] ,
					   ['Hyatt Summerfield Suites Parsippany','ewrxp'] ,
                       ['Hyatt Summerfield Suites White Plains','lgaxw'] ,
                       ['Hyatt Regency Wichita','wicrw']] 


                       hotels.us.region_Albuquerque = [0, 1,2,3];
                       hotels.us.region_Atlanta = [4,5,6,7,8,9,10,11,12,13,14,15,16,17];
                       hotels.us.region_Austin = [18,19,20,21,22];
                       hotels.us.region_Baltimore = [23,24,25];
					   hotels.us.region_BeaverCreek = [26];
                       hotels.us.region_BatonRouge = [27];
                       hotels.us.region_Bellevue = [28];
                       hotels.us.region_Birmingham = [29,30];
                       hotels.us.region_Boise = [31];
                       hotels.us.region_BonitaSprings = [32];
                       hotels.us.region_Boston = [33,34,35,36,37,38];
                       hotels.us.region_Bridgewater = [39];
                       hotels.us.region_Buffalo = [40];
                       hotels.us.region_Cambridge = [41];
                       hotels.us.region_Charlotte = [42,43,44,45];
                       hotels.us.region_Chicago = [46,47,48,49,50,51,52,53,54,55,56,57,58];
                       hotels.us.region_Cincinnati = [59,60,61,62];
                       hotels.us.region_Cleveland = [63,64];
                       hotels.us.region_ColoradoSprings = [65,66];
                       hotels.us.region_Columbia = [67];
					    hotels.us.region_ColumbusGA = [68];
                       hotels.us.region_ColumbusOH = [69,70,71,72];					
                       hotels.us.region_Dallas = [73,74,75,76,77,78,79,80,81,82,83,84,85,86,87];
                       hotels.us.region_Denver = [88,89,90,91,92,93,94];
                       hotels.us.region_Detroit = [95,96,97,98];
                       hotels.us.region_Dulles = [99,100,101,102,103];
                       hotels.us.region_ElPaso = [104];
                       hotels.us.region_FairLawn = [105];
                       hotels.us.region_Fairfax = [106];
                       hotels.us.region_FortLauderdale = [107,108];
                       hotels.us.region_FortWayne = [109];
                       hotels.us.region_FortWorth = [110,111];
                       hotels.us.region_Fremont = [112];
                       hotels.us.region_Gaithersburg = [113];
                       hotels.us.region_Greensboro = [114];
                       hotels.us.region_Greenville = [115,116];
                       hotels.us.region_Greenwich = [117];
                       hotels.us.region_Honolulu = [118];
                       hotels.us.region_Houston = [119,120,121,122];
                       hotels.us.region_HuntingtonBeach = [123];
                       hotels.us.region_InclineVillage = [124];
                       hotels.us.region_IndianWells = [125];
                       hotels.us.region_Indianapolis = [126,127,128]; 
					   hotels.us.region_Irvine = [129]; 	  
                       hotels.us.region_Jacksonville = [130];
					   hotels.us.region_JerseyCity = [131];
                       hotels.us.region_KansasCityKS = [132,133];
                       hotels.us.region_KansasCityMO = [134,135];
                       hotels.us.region_KeyWest = [136];
                       hotels.us.region_KoloaKauai = [137];					   
                       hotels.us.region_LasVegas = [138];
                       hotels.us.region_Lexington = [139];
                       hotels.us.region_LongIsland = [140];
                       hotels.us.region_LosAngeles = [141,142,143,144,178];
                       hotels.us.region_Louisville = [145,146];
					   hotels.us.region_Malta = [147];
                       hotels.us.region_Maui = [148];
                       hotels.us.region_Memphis = [149, 150];
                       hotels.us.region_Miami = [151,152,153,154, 155];
                       hotels.us.region_Milwaukee = [156];
                       hotels.us.region_Minneapolis = [157,158,159];					   
					   hotels.us.region_Monterey = [160];
                       hotels.us.region_Morristown = [161, 162];
                       hotels.us.region_MtLaurel = [163,164];
                       hotels.us.region_Mystic = [165];
                       hotels.us.region_Nashville = [166,167,168,169,170];
					   hotels.us.region_NewBrunswick = [171];                      
                       hotels.us.region_NewYork = [172,131];
                       hotels.us.region_Newport = [173];
                       hotels.us.region_NewportBeach = [174];
                       hotels.us.region_OklahomaCity = [175,176];
                       hotels.us.region_OntarioMills = [177];
                       hotels.us.region_OrangeCounty = [178,129];  
                       hotels.us.region_Orlando = [179,180,181,182];
                       hotels.us.region_Philadelphia = [183,184];
                       hotels.us.region_Phoenix = [185,186,187];
                       hotels.us.region_Pittsburgh = [188,189,190];
                       hotels.us.region_PleasantHill = [191];
                       hotels.us.region_Pleasanton = [192,193];
                       hotels.us.region_Princeton = [194,195];
                       hotels.us.region_Raleigh = [196,197];
                       hotels.us.region_Richmond = [198,199,200];
					   hotels.us.region_Roanoke = [201];
                       hotels.us.region_Rochester = [202];
                       hotels.us.region_Rogers = [203];
                       hotels.us.region_Sacramento = [204,205];
                       hotels.us.region_SanAntonio = [206,207,208,209,210,211];
                       hotels.us.region_SanDiego = [212,213,214];
                       hotels.us.region_SanFrancisco = [215, 216, 217, 218];
                       hotels.us.region_SantaClara = [219];
                       hotels.us.region_Sarasota = [220];
                       hotels.us.region_Savannah = [221];
                       hotels.us.region_Scottsdale = [222, 223, 224];
					   hotels.us.region_Seattle = [225];
                       hotels.us.region_Secaucus = [226];                                      
                       hotels.us.region_SonomaCounty = [227];					   
					   hotels.us.region_SouthBend = [228];
                       hotels.us.region_StLouis = [229,230];  
                       hotels.us.region_Tampa = [231,232,233,234,235];
					   hotels.us.region_Topeka = [236];
                       hotels.us.region_Tucson = [237];
                       hotels.us.region_Tulsa = [238];
                       hotels.us.region_WashingtonDC = [239,240,241,242];
					   hotels.us.region_Whippany = [243];
                       hotels.us.region_WhitePlains = [244];
                       hotels.us.region_Wichita = [245];

					   
                     


hotels.us.region_all = [];



function changeRegion(r,p) {
	 if(p) r.selectedIndex = findIndex(r.options,p);
	 
	 var c,h,s,region;
	 
	 c = r.form.country; h = r.form.hotel;
	 s = r.options[r.selectedIndex];
	 
	 if(r.selectedIndex == 0) {
	    disablesearch();
	 	resetOptions(c,r,h);
	 	} else {
	 	document.getElementById('c_'+s.className).selected = "selected";
	 	region = "region_"+s.value;
	 	setHotelOptions(c,r,h,hotels[s.className][region],hotels[s.className]);
	 }
}

function resetOptions(c,r,h) {
	c.selectedIndex = r.selectedIndex = h.selectedIndex = 0;
	h.options[0].text = 'Select Hotel...';
	h.disabled = true;
	h.options.length = 1;
	setRegionOptions(r,regions['all']);
}

function setRegionOptions(r,a) {
	var o,i;
	o = r.options;
	o.length = a.length+1;
	for(i=0; i<a.length; i++) {
		o[i+1] = new Option(a[i][1],a[i][2]);
		o[i+1].className = a[i][0];
	}
	r.selectedIndex = (a.length==1) ? 1 : 0;
}

function setHotelOptions(c,r,h,a,p) {
	var o,i,p;
	o = h.options;
	o.length = a.length+1;
	for(i=0; i<a.length; i++) {
		if(p) {
			myString = p[a[i]][0];
			myString = myString.replace("&amp;", "&");					
			o[i+1] = new Option(myString,p[a[i]][1]);
		} else {
			myString = a[i][0];
			myString = myString.replace("&amp;", "&");					
			o[i+1] = new Option(myString,a[i][1]);
		}
	}
	o[0].text = 'Choose a Hotel in '+((!p) ? c.options[c.selectedIndex].text  : r.options[r.selectedIndex].text+' area');
	
	h.selectedIndex = (a.length==1) ? 1 : 0;
	
	if(h.selectedIndex == 1){
	    captureid();
		enablesearch();
	}else{
		disablesearch();
	}
	
	h.disabled = false;
	
	sortopts(document.getElementById('hotel'));
	
}

function findIndex(o,v) {
	for(var i=0; i<o.length; i++) {
		if(o[i].value == v) return i;
	}
	return 0;
}

function submitcheckout () {
	
	var spirit = "";
	var checkinmonthyear = "";
	var checkoutmonthyear = "";
	var checkinday = "";
	var checkoutday = "";
	var refPage = "";
	var kids = "";
	var adults = "";
	var number = "";
	
	
	if (document.getElementById("hotelspirit"))							
		spirit =  document.getElementById("hotelspirit").value;
    else
		spirit = "null";
	
	checkinmonthyear = document.getElementById("monthyear0").value;
	checkinday = document.getElementById("day0").value;
	checkoutmonthyear = document.getElementById("monthyear1").value;
	checkoutday = document.getElementById("day1").value;
	
	kids = document.getElementById("kids").value;
	adults = document.getElementById("adults").value;
	number = document.getElementById("number").value;
	
	var refPage = "Limited";
	var offerCode = document.getElementById("offerCode").value;
	
	
	document.location = ('limited-tracking.jsp?pid=' + spirit + '&checkinmonthyear=' + checkinmonthyear + '&checkinday=' + checkinday + '&checkoutmonthyear=' + checkoutmonthyear + '&checkoutday=' + checkoutday + '&icamp=' +spirit + '_LTO105&refPage=' + refPage + '&offerCode=' + offerCode + '&kids=' + kids + '&adults=' + adults + '&number=' + number);
}


var formObj=document.getElementById('quickbook');

function recallBookingData() {

	/* If date is not between August 28 and October 2
	then leave dates to default. */
	var update = false;
	var my1='<dsp:valueof bean="DatesHolder.monthYear1" />';
	var my2='<dsp:valueof bean="DatesHolder.monthYear2"/>';
	var d1='<dsp:valueof bean="DatesHolder.day1"/>';
	var d2='<dsp:valueof bean="DatesHolder.day2"/>';
	var formObj=document.getElementById('quickbook');
	
	if ((my1=='08 08') && (parseInt(d1,10) > 28)) update = true;
	if (my1=='09 08') update = true;
	if ((my1=='10 08') && (parseInt(d1,10) < 2)) update = true;
	
	if(update) {
		formObj.day0.selectedIndex = parseInt(d1,10);
		formObj.day1.selectedIndex = parseInt(d2,10);	
	}
}
		

function monthAdjust(){
	
	for(j=0; j < 2; j++){
		//Loop through both months
		var day = document.getElementById('day' + j);
		var moYr = document.getElementById('monthyear' + j);
		var month = $F(moYr.id);
		
		switch(month){
		case "08 08" :
			// need to reduce days to 28 - 31 for August
			day.options.length = 0;
			var x = 28;
			for(i=0;i<4;i++){
				day.options[i] = new Option(x+i,x+i) ;
			}
			break;
			
		case "09 08" :
			// adjust to 30 for Sep
			day.options.length = 0;
			for(i=0;i<30;i++){
				day.options[i] = new Option(i+1,i+1) ;
			}
			break;
			
		case "10 08" :
			// Oct only needs to the 2th
			day.options.length = 0;
			for(i=0;i<2;i++){
				day.options[i] = new Option(i+1,i+1) ;
			}
			break;
			
		default:
			// if we get here, there's a problem... this switch is only set up to do June - Aug
			break;
		}
	
	}
}

function sortopts(list) {
	// list is reference to the dropdown to be sorted
	arrTexts = new Array();

	
	for(i=0; i<list.length; i++)  {
	  arrTexts[i] = new Array();
	  arrTexts[i][0] = list.options[i].text;
	  arrTexts[i][1] = list.options[i].value;
	}
	
	arrTexts.sort();
	
	for(i=0; i<list.length; i++)  {
		if(i==0) continue; // no need to sort the first entry
	  list.options[i].text = arrTexts[i][0];
	  list.options[i].value = arrTexts[i][1];
	}
}

		
	function changeCountry(countryValue)	{	
	
	    disablesearch();
	    
	    resetRegionDD();
	    				    				
		var thisValue = countryValue.value;
		
		var o;
		o = document.getElementById("hotel");
		
		var hotellist;	
			
		switch(countryValue.value)		{
			
			case "c_us":				 
				document.quickbook.hotel.disabled = true;		
				document.getElementById("regiondiv").style.display = "block";							
								
				o.length = hotels.us.length +1;
				for(i=0; i< hotels.us.length; i++) {				
					o[i+1] = new Option(hotels.us[i][0],hotels.us[i][1]);
				}
				
				sortopts(o);
				
			  break;    
			case "c_can":
				document.quickbook.hotel.disabled = false;
				document.getElementById("regiondiv").style.display = "none";	
								  
			  	o.length = hotels.can.length +1;
				for(i=0; i< hotels.can.length; i++) {				
					o[i+1] = new Option(hotels.can[i][0],hotels.can[i][1]);					
			  	}				  
				//sortopts(o);
			  break;
			 case "c_car":
			 	document.quickbook.hotel.disabled = false;
			 	document.getElementById("regiondiv").style.display = "none";
			 	
			 	o.length = hotels.car.length +1;
				for(i=0; i< hotels.car.length; i++) {				
					o[i+1] = new Option(hotels.car[i][0],hotels.car[i][1]);
				}
				//sortopts(o);
			  break; 
			 case "c_trin":
			 	document.quickbook.hotel.disabled = false;
			 	document.getElementById("regiondiv").style.display = "none";
			 	
			 	o.length = hotels.trin.length +1;
				for(i=0; i< hotels.trin.length; i++) {				
					o[i+1] = new Option(hotels.trin[i][0],hotels.trin[i][1]);
				}
				//sortopts(o);
			  break; 			 
			default:
			
				// this case should not occur
			 	o.length = hotels.us.length +1;
				for(i=0; i< hotels.us.length; i++) {										
					o[i+1] = new Option(hotels.us[i][0],hotels.us[i][1]);							
				}
			}
			
			resetHotelDD();
					
		}	
		
			
	

function resetHotelDD() {

hoteldd = document.getElementById("hotel");

hoteldd.options[0].text = "Please choose a hotel";

}


function resetRegionDD() {

regiondd = document.getElementById("region");

regiondd.selectedIndex = 0;

}

function enablesearch() {

searchbutton = document.getElementById("check_avail_button");

searchbutton.style.backgroundColor = "#648ab1";
searchbutton.style.cursor = "pointer";
searchbutton.disabled = false; 


}

function disablesearch() {

document.getElementById("hotelspirit").value = null;

searchbutton = document.getElementById("check_avail_button");

searchbutton.style.backgroundColor = "#BBBBBB";
searchbutton.style.cursor = "pointer";
searchbutton.disabled = true; 


}


function captureid(){
document.getElementById("hotelspirit").value = document.getElementById("hotel").value;
}


