var selectedHome = '';
var selectedProduct = '';

// Wait until document is ready
$(document).ready(function(){	
	// Set the background width
	resizeBackgroundWidth(getWindowWidth());
	
	// Keep an eye out for the user resizing the browser window
	$(window).bind("resize", resizeWindow);
	function resizeWindow( e ) {
		resizeBackgroundWidth(getWindowWidth());
		}
	});

function resizeBackgroundWidth(width) {
	document.getElementById('backgroundImage').width = width;
	}

function getWindowWidth() {
  	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	}
 
function getWindowHeight() {
  	return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
	}
	
// Swap homepage area on mouseover 
function homeMouseover(id) {
	if (selectedHome != '') {
		document.getElementById(selectedHome).style.display = 'none';
		document.getElementById(selectedHome + '_tab').style.backgroundImage = 'url(images/highlight-left-off.png)';
		}
		
	document.getElementById(id).style.display = 'block';
	document.getElementById(id + '_tab').style.backgroundImage = 'url(images/highlight-left-on.png)';
	
	selectedHome = id;
	}
	
function homeMouseout() {
	//if (selectedHome != '' && selectedHome != defaultHome) {
		//document.getElementById(selectedHome).style.display = 'none';
		//}
		
	//document.getElementById(defaultHome).style.display = 'block';
	
	//selectedHome = defaultHome;
	//document.getElementById('defaultTab').style.backgroundImage = 'url(images/highlight-left-on.png)';
	}
	
// Swap product area on mouseover 
function productMouseover(id) {
	if (selectedProduct != '') {
		document.getElementById(selectedProduct).style.display = 'none';
		}
		
	document.getElementById(id).style.display = 'block';
	
	selectedProduct = id;
	}
	
function gotoURL(destination) {
	window.location = destination;
	}
