//<!-- 
var PageLoad = false;
var isgecko = (document.getElementById && !document.all) ? 1 : 0;
var ismac = (navigator.appVersion.indexOf("Mac") != -1);
var isie = (document.all) ? 1 : 0;
var isns4 = (document.layers) ? 1 : 0;
var isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);

// ------[ Generic Popup Window ]------------------------------------------------- //
function popWin(url,w,h,scroll,tools,name,center) {
	var str = "height=" + h + ",innerHeight=" + h;
	str += ",width=" + w + ",innerWidth=" + w;
	if(!center) var center = false;
	if(!scroll) scroll = 0;
	if(!tools) tools = 0;
	if(!name) name = "pop";

	if((window.screen) && (center)) {
		var ah = screen.availHeight - 30;
		var aw = screen.availWidth - 10;

		var xc = (aw - w) / 2;
		var yc = (ah - h) / 2;

		str += ",left=" + xc + ",screenX=" + xc;
		str += ",top=" + yc + ",screenY=" + yc;
		}
		
	pop = window.open(url,name,'toolbar=' + tools + ',location=0,directories=0,status=0,menubar=0,scrollbars=' + scroll + ',resizable=1,' + str).focus();
	}
	
// ------[ Cookie Handle ]------------------------------------------------- //
var now = new Date();
var expires = now.getTime() + 365 * 24 * 60 * 60 * 1000;
var expires = new Date(expires)
function WriteCookie(name, value) {
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
	}

function WriteCookieExp(name, value, Exp) {
	var expires = now.getTime() + Exp;
	var expires = new Date(expires)	
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString();
	}	

function ReadCookie(Name) {   
	var search = Name + "="   
	if (document.cookie.length > 0) { 					// if there are any cookies      
		offset = document.cookie.indexOf(search)       
		if (offset != -1) { 							// if cookie exists          
			offset += search.length  					// set index of beginning of value         
			end = document.cookie.indexOf(";", offset)	// set index of end of cookie value         
			if (end == -1) end = document.cookie.length         
			return unescape(document.cookie.substring(offset, end))      
			}    
		}
	}	

// ------[ Flash Function ]------------------------------------------------- //
	function openSlideShow() {
		var location = (section.indexOf("eventsOverview") != -1) ? "events" : section;

		var so = new SWFObject(SitePath+"Flash/loews_ml.swf", "flashHeader", "581", "434", "8", "#ffffff");
			so.addParam("wmode", "transparent");
			so.addParam("quality", "high");
			so.addParam("scale", "noscale");
			
			so.addVariable("flashPath", SitePath + "Flash/");
			so.addVariable("resources", SitePath + "Content/" + Culture + "/Hotels/" + HotelID + "/");
			so.addVariable("displayType", "slideshow");
			so.addVariable("location", location);
			so.addVariable("language", Culture);			
			
			so.write("flash-header");			
			}
		
	function closeSlideShow() {
	    var location = (section.indexOf("eventsOverview") != -1) ? "events" : section;
	
		var so = new SWFObject(SitePath+"Flash/loews_ml.swf", "flashHeader", "581", "145", "8", "#ffffff");
			so.addParam("wmode", "transparent");
			so.addParam("quality", "high");
			so.addParam("scale", "noscale");

			so.addVariable("flashPath", SitePath + "Flash/");
			so.addVariable("resources", SitePath + "Content/" + Culture + "/Hotels/" + HotelID + "/");
			so.addVariable("displayType", "banner");
			so.addVariable("location", location);
			so.addVariable("language", Culture);		
			
			so.write("flash-header");		
			}
	
		function FlashPromo() {
			document.location = "Offers/SpecialOffers.aspx#"
			}
	
		function displayPromos() {
			
			} 	
			
		function FlashMoreInfo() {
			document.location = "LocationInfo/ProvidedServices.aspx"
			}
		
		function openQTVR() {
			switch(section) {
				case "rooms": 
					document.location = '../Tour/RoomsSuitesGallery.aspx';
					break;
				case "dining": 
					document.location = '../Tour/DiningLoungesGallery.aspx';
					break;
                case "eventsOverview": 
					document.location = '../Tour/FunctionSpaceGallery.aspx';
					break;				
				case "events": 
					document.location = '../../Tour/FunctionSpaceGallery.aspx';
					break;
				default: 
					document.location = '../Tour/RoomsSuitesGallery.aspx';
					break;
				}
			}
	
// ------[ Table Selector ]-------------------------------------------------- //
function tableSet(type) {
	var measurementsMeters = document.getElementById("measurements-meters");
	var measurementsFeet = document.getElementById("measurements-feet");
	var selectFeet = document.getElementById("select-feet");
	var selectMeters = document.getElementById("select-meters");
	
	if(type == 'meters') {
		measurementsMeters.style.display = '';
		measurementsFeet.style.display = "none";
		
		selectFeet.className = 'button';
		selectMeters.className = 'button selected';
	} else {
		measurementsMeters.style.display = "none";
		measurementsFeet.style.display = '';	
		
		selectFeet.className = 'button selected';
		selectMeters.className = 'button';		
		}
	}	

	
// ------[ Table RollOver ]------------------------------------------------- //
function initTableHover() {
	var table = document.getElementsByTagName("table");
	
	for(t=0; t < table.length; t++) {
		if(table[t].className.indexOf("hover") != -1) {
			var tbody = table[t].getElementsByTagName("tbody")[0];
			if(tbody) {
				var tr = tbody.getElementsByTagName("tr");
				for(x=0; x < tr.length; x++) {
					tr[x].onmouseover 	= function() { this.className = "hover"; };
					tr[x].onmouseout 	= function() { this.className = ""; };		
					var a = tr[x].getElementsByTagName("a")[0];
					if(a) {
						tr[x].href = a.href;
						tr[x].style.cursor = "pointer";
						tr[x].onclick = function() { document.location = this.href; };					
						}
					}	
				}
			}
		}	
	}
	
YAHOO.util.Event.addListener(window, "load", initTableHover, true);
	
// ------[ Create XHTML Element ]------------------------------------------------- //
function createElement(element) {
	if (typeof document.createElementNS != 'undefined') {
		return document.createElementNS('http://www.w3.org/1999/xhtml', element);
		}
	if (typeof document.createElement != 'undefined') {
		return document.createElement(element);
		}
	return false;
	}		
	


// ------[ SpaceLinks JS ]------------------------------------------------- //
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.availWidth)?Math.floor(Math.random()*(screen.availWidth-w)):1;TopPosition=(screen.availHeight)?Math.floor(Math.random()*((screen.availHeight-h)-75)):1;}
	if(pos=="center"){LeftPosition=(screen.availWidth)?(screen.availWidth-w)/2:1;TopPosition=(screen.availHeight)?(screen.availHeight-h)/2:1;}
	if(pos=="default"){LeftPosition=1;TopPosition=1}
	else if((pos!="center" && pos!="random" && pos!="default") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
	if(win.focus){win.focus();}
	}













//-->