/*
//
// Reposition the line stretches to accomodate for browser shape changes
function lineStretch(){
	var height = window.innerHeight;
	
	if (height < 633){
		alert(document.getElementById('leftLineStretchTD').style['vertical-align']);
		
		//document.getElementById('leftLineStretchTD').style['vertical-align'] = "top";
	}
	
	
	setTimeout(lineStretch,4000);	
}
*/


//
// Display the name of a tile in the given target element
function displayTileName(img, targetElement){
	var obj = document.getElementById(targetElement).firstChild;
	
	obj.nodeValue = img.alt;
	
	//sIFR.redraw();
}


//
// Go back to displaying the type name in the target element
function restoreTypeName(oldTypeName,targetElement){
	var obj = document.getElementById(targetElement).firstChild;
	
	obj.nodeValue = oldTypeName;
	
	//sIFR.redraw();
}


//
// Show the min left column - done after page has loaded to avoid old scrollbar showing
function enableScrolling(){
	document.getElementById('mainContainerLeftColumn').style.overflow = "auto";
}


//
// Show the min left column - done after page has loaded to avoid old scrollbar showing
function disableScrolling(){
	document.getElementById('mainContainerLeftColumn').style.overflow = "hidden";
}


//
// Do a rollOver
function rollOver(path, img){
	img.src = "images/" + path + "-over.gif";
}


//
// Do a rollOut
function rollOut(path, img){
	img.src = "images/" + path + ".gif";
}


//
// Resize the feature image
function resizeFeatureImage(id, heightReduction){
	var div = document.getElementById(id);
	
	if (heightReduction == null) heightReduction = 0;
	
	var windowWidth = window.innerWidth;
	var windowHeight = window.innerHeight;
	
//	alert(heightReduction);
	
	div.style.width = windowWidth - 317 + "px";
	div.style.height = windowHeight - 146 - heightReduction + "px";
	
	setTimeout(resizeFeatureImage,10,id,heightReduction);
}


//
// Resize a contact sheet
function resizeContactSheet(id){
	var div = document.getElementById(id);
	
	var windowWidth = window.innerWidth;
	
	div.style.width = windowWidth - 317 + "px";
	
	setTimeout(resizeContactSheet,10,id);
}


//
// Resize a rotating image
function resizeRotatingImage(id){
	var div = document.getElementById(id);
	
	var windowWidth = window.innerWidth;
	var windowHeight = window.innerHeight;
	
	div.style.width = windowWidth - 800 + "px";
	div.style.height = windowHeight - 200 + "px";
	
	
	var de = document.documentElement; 
	
	var shiftY = de.scrollTop != null ? de.scrollTop : document.body.scrollTop; 
	
	div.style.top = 178 + shiftY + "px";
	
	//alert(shiftY);
	
	setTimeout(resizeRotatingImage,10,id);
}


//
// Force the page width to stay above a certain amount
function forcePageWidth(id){
	var div = document.getElementById(id);
	
	var windowWidth = window.innerWidth;
	var minWidth = 980;
	
	if (windowWidth < minWidth){
		div.style.width = minWidth + "px";
	} else {
		div.style.width = "100%";
	}
	
	setTimeout(forcePageWidth,10,id);
}
