var currentPage;
var dropTimer = '';

function setupSifr(){
	sIFR.replaceElement("h2", named({sFlashSrc: "includes/swf/HelveticaNeueLight.swf", sColor: "#eceac1", sBgColor: "#333333", sWmode:"transparent"}));
	sIFR.replaceElement("h1", named({sFlashSrc: "includes/swf/HelveticaNeueLight.swf", sColor: "#eceac1", sBgColor: "#333333", sWmode:"transparent"}));
	}

function findMe(target){
	document.getElementById(target).className = "active";
		currentPage = target;
		if (currentPage == "interior" || currentPage == "amenity"){
			setupDropDown();
		}
		
}

function setupDropDown() {
	document.getElementById('thumb').style.display = 'block';
	document.getElementById('thumb').onmouseover = function() {
		thumbnail(this);
	}
	document.getElementById('thumbnails').onmouseover = function() {	
		thumbnail(this);
	}
	document.getElementById('thumb').onmouseout = function() {
		thumbnail(this.parentNode.parentNode);
	}
	document.getElementById('thumbnails').onmouseout = function() {
		thumbnail(this.parentNode);
	}
	if (document.all) {
		document.getElementById('thumbnails').style.backgroundImage = 'url(images/interface/dummy.gif)';
		document.getElementById('thumbnails').style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'images/interface/trans.png\',sizingMethod=\'scale\');';
	}
}

function expandNode() {
	window.clearTimeout(dropTimer);
	document.getElementById('thumb').style.display = 'none';
	fadeIn('thumb_overlay');
}

function collapseNode(target) {
	document.getElementById("thumb").style.display = "block";
	fadeOut('thumb_overlay');
}
function isTarget(target) {
	targetParent = target.parentNode;
	targetChilds = targetParent.childNodes;
	for (i=0;i<targetChilds.length;i++) {
		if (targetChilds[i].nodeType == 1 && targetChilds[i].getAttribute('id','thumbnails')) {
			return true;
			break;
		}
	}
	return false;
}

var thumbTimer = '';

function thumbnail(ovr) {
	to = ovr;
	if (ovr.id == 'thumbnails' || ovr.id == 'thumb') {
		window.clearTimeout(thumbTimer);
		expandNode();
	}
	else {
		window.clearTimeout(thumbTimer);
		thumbTimer = window.setTimeout("collapseNode()", 500);
	}
}
