// JavaScript Document

Cufon.replace('h1, .index h2, a.button', { fontFamily: 'GB', hover: true });

$(document).ready( function() {
			// User-agent sniffing as specified by iHotelier.
			// Updated Dec. 2010 to treat iPhone/iPad/Android differently (display full site but show mobile link in footer):
			var mobileAgents = ["iphone", "android", "ipod", "palm", "palmos", "palmsource", "blackberry", "nokia", "midp", "wap", "java", "nokia", "hand", "symbian", "chtml", "wml", "ericsson", "lg", "audiovox", "motorola", "samsung", "sanyo", "sharp", "telit", "tsm", "mini", "windows ce", "smartphone", "240x320", "320x320", "mobileexplorer", "j2me", "sgh", "portable", "sprint", "vodafone", "docomo", "kddi", "softbank", "pdxgw", "j-phone", "astel", "minimo", "plucker", "netfront", "xiino", "mot-v", "mot-e", "portalmmm", "sagem", "sie-s", "sie-m"];
			var smartphoneAgents = ["ipad"];
			
			var curAgent = navigator.userAgent.toLowerCase();
			var isMobile = false;
			var isSmartphone = false;
			
			for (i=0;i<mobileAgents.length;i++) {
  				if( curAgent.indexOf(mobileAgents[i])!=-1 ) {
    				isMobile = true;
   				 	userAgent = curAgent;
    				break;
  				} // end if
			} // end for all mobileAgents[]
			if (isMobile) { location.replace('https://mobile.ihotelier.com/mbe/mobile/6048'); }
			else {
				for (i=0;i<smartphoneAgents.length;i++) {
					if( curAgent.indexOf(smartphoneAgents[i])!=-1 ) {
						isSmartphone = true;
						userAgent = curAgent;
						break;
					} // end if
				} // end for all smartphoneAgents[]
				if (isSmartphone) { 
						$("#mobileLink, .mobileLink").css({ display: "block" }); 
						$(".index .socialLinks").css({ width: "275px" });
				} // end if
			} // end else
		
	
			$("[rel='external']").addClass("externalLink").click(
			function() { 
				window.open($(this).attr("href")); return false;  // make rel="external" links open in new windows
			}); // end rel=external click()
			
			// handle the expanding "MORE" links in some pages' body copy:
			var EFFECT_SPEED = "fast";
			$("a.more").click( function(e) {
										$(this).fadeOut(EFFECT_SPEED, function() {
														$("div.more").slideDown(EFFECT_SPEED);
										});
										e.preventDefault();
			}); // end a.more click()
			
			// IE fix:
			if($.browser.msie && parseInt($.browser.version.substr(0,1))<=7) {
				$("#mainImage").css("z-index", "-1");	
			}
}); // end document.ready()
function addOuterGlow(elements) {
	elements.each( function() {
		var newElement = getWrappedHTML.call($(this));
		$(this).replaceWith(newElement);
	});
	function getWrappedHTML() {
		return '<table border="0"><tr><td class="topLeft"></td><td class="top"></td><td class="topRight"></td></tr><tr><td class="left">&nbsp;</td><td class="middle"><div class="' + $(this).attr("class") + '">' +
			$(this).html() + '</div></td><td class="right">&nbsp;</td></tr><tr><td class="bottomLeft"></td><td class="bottom"></td><td class="bottomRight"></td></tr></table>';
	} // end getWrappedHTML()
} // end addGlow();
