<!--
//BROWSER SNIFF
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS4 = (!document.all && !document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;
var dhtml = !isNS4;
var isPc = navigator.userAgent.indexOf("Windows") != -1;
var isMac = !isPc;


//IMAGE PRELOADS
var shadow_right_dk = new Image();
shadow_right_dk.src = "../images/shadow_right_dk.gif";

var b_3dtour = new Image();
b_3dtour.src = "../images/b_3dtour.gif";
var b_3dtour_over = new Image();
b_3dtour_over.src = "../images/b_3dtour_over.gif";

var b_printpage = new Image();
b_printpage.src = "../images/b_printpage.gif";
var b_printpage_over = new Image();
b_printpage_over.src = "../images/b_printpage_over.gif";

var b_reserve = new Image();
b_reserve.src = "../images/b_reserve.gif";
var b_reserve_over = new Image();
b_reserve_over.src = "../images/b_reserve_over.gif";

var b_viewmore = new Image();
b_viewmore.src = "../images/b_viewmore.gif";
var b_viewmore_over = new Image();
b_viewmore_over.src = "../images/b_viewmore_over.gif";

var b_pop_close = new Image();
b_pop_close.src = "../images/b_pop_close.gif";
var b_pop_close_over = new Image();
b_pop_close_over.src = "../images/b_pop_close_over.gif";

var b_pop_act = new Image();
b_pop_act.src = "../images/b_pop_act.gif";
var b_pop_act_over = new Image();
b_pop_act_over.src = "../images/b_pop_act_over.gif";

//FUNCTIONS

function emailSignup(email) {
    //alert(email);
    document.forms[0].elements['email'].value = email;
    document.forms[0].submit();
}

function getStyles(prefix) {
	if(prefix == undefined) prefix = '';
    if (isPc) {
    	return "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + prefix + "styles.css\">";
    } else {
    	return "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + prefix + "styles_mac.css\">";
    }
}

function getSpacer() {
    if (isNS6 || (isMac && isIE5)) {
    	return "300";
    } else {
    	return "1";
    }
}

function getNavSpacer() {
    if (isPc) {
    	if (isIE4 || isIE5) {
	    return "17";
    	}
    	if (isNS4) {
	    return "11";
    	}
    	if (isNS6) {
	    return "15";
    	}
    }
    if (isMac) {
    	if (isIE4 || isIE5) {
	    return "14";
    	}
    	if (isNS4) {
	    return "12";
    	}
    	if (isNS6) {
	    return "15";
    	}
    }
}

function popFolkArt(location) {
	var dx=550;
	var dy=380;

	var w = window.open(location, 'popup_folk', 'width=' + dx + ',height=' + dy + ',status=no,resizable=yes,menubar=yes,location=no,scrollbars=yes,toolbar=no');
	w.focus();
}

function popActivity(location) {
	var dx=550;
	var dy=380;

	var w = window.open(location, 'popup_act', 'width=' + dx + ',height=' + dy + ',status=no,resizable=yes,menubar=yes,location=no,scrollbars=yes,toolbar=no');
	w.focus();
}

function popVirtual(location) {
	var dx=550;
	var dy=580;

	var w = window.open('../virtual/'+location+'.htm', 'popup_virtual', 'width=' + dx + ',height=' + dy + ',status=no,resizable=yes,menubar=no,location=no,scrollbars=yes,toolbar=no');
	w.focus();
}

function popOffsite(location) {
	var x=10;
	var y=10;
	var dx=650;
	var dy=450;

	if (isIE4) {
	    var w = window.open(location, '_blank');
	    return;
	}
	var w = window.open();
	w.document.writeln("<html><head></head>");
	w.document.writeln("<frameset border=0 rows=50,* frameborder=no framespacing=0>");
	w.document.writeln("<frame frameborder=no framespacing=0 marginheight=0 marginwidth=0 name=nav noresize scrolling=no src=\"popOffsiteNav.htm\">");
	w.document.writeln("<frame frameborder=no framespacing=0 name=body noresize src=\"" + location + "\">");
	w.document.writeln("</frameset>");
	w.document.writeln("</html>");

	w.focus();
}

function swap(name,state) {
	if(document.images) {
		document[name].src = eval(name + state + ".src");
	}
}

function gotoRoom(which) {
	opener.location = which;
	opener.focus();
}

function dropdownGoto(theElement) {
	var which = theElement.options[theElement.selectedIndex].value;
	document.location = which;
}

function validateForm() {
	if (false) alert('sss');
}

function speedcheckOpen() {
	var timeoutId;
	//alert(document.images.length);
	for (i=0; i < document.images.length; i++) {
		if(!document.images[i].complete) {
			//alert("image" + document.images[i].src + " not ready");
			//timeoutId = setTimeout("speedcheckOpen()",1000);
		}
	}
	var location = ('http://www.rarebrick.com/util/checkspeed/index.htm');
	speedcheckWindow = window.open(location, 'speedcheck', 'width=200,height=200,status=no,resizable=no,menubar=no,location=no,scrollbars=no,toolbar=no');
	//speedcheckWindow.focus();
	window.focus();
}

function speedcheckClose() {
	speedcheckWindow.close();
}

function setFlashHeaderHeightSmall() {
	setFlashHeaderHeight('142px');
	//return false;
}
function setFlashHeaderHeightTall() {
	setFlashHeaderHeight('286px');
	//return false;
}
function setFlashHeaderHeight(height) {
	try {
		var elem = document.getElementById('flashheader');
		elem.style.height = height;
		elem = document.getElementById('flashnav');
		elem.style.height = height;
	} catch (Exception) {
		//alert('erorr setFlashHeaderHeight');
	}
}
//-->
