// Reposition the main DIV whenever the user resizes the browser

window.onresize = function () {
	document.getElementById('theWholeEnchilada').style.left = eval((((document.documentElement.clientWidth / 2) - 400)/document.documentElement.clientWidth)*100) + "%";
	document.getElementById('theWholeEnchilada').style.top = eval(((((document.documentElement.clientHeight / 2) - 300)/document.documentElement.clientHeight)*100)+2) + "%";
}

// Global Variables

var TTContent = "";

// Open a new window; the dimensions are 
// sent in the call to the function

function popup(url,winName,w,h) {
	var width  = w;
	var height = h;
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	var params = 'width='+width+', height='+height;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=auto';
	params += ', status=no';
	params += ', toolbar=no';
	newwin=window.open(url, winName, params);
	if (window.focus) { newwin.focus(); }
       	return false;
}

// Open a new window to show our gallery images

function popUpGallery(model) {
	var width  = 350;
	var height = 450;
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	var params = 'width='+width+', height='+height;
	params += ', top='+top+', left='+left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable=no';
	params += ', scrollbars=yes';
	params += ', status=no';
	params += ', toolbar=no';
	newwin=window.open('galleryView.php?model='+model,model,params);
	if (window.focus) { newwin.focus(); }
       	return false;
}

// Two quick functions to manage the mouseover on the video

function flash() {
	document.getElementById("videoText").style.color = "#800";
	document.getElementById("videoLink").style.color = "#FFF";
	document.getElementById("video").style.border = "3px double #0C0";
}

function noFlash() {
	document.getElementById("videoText").style.color = "#0C0";
	document.getElementById("videoLink").style.color = "#0C0";
	document.getElementById("video").style.border = "3px double #800";
}

// Turn on/off dots when a user passes over a menu item

function emptyCircle(layerIs) {
	document.getElementById(layerIs).src = "images/emptyCircle.gif";
}

function fillCircle(layerIs) {
	document.getElementById(layerIs).src = "images/" + layerIs +"Dot.gif";
}

// Show/Hide the submenus

function showHide(layerIs) {
	if(document.getElementById(layerIs).style.visibility=='hidden') {
		document.getElementById(layerIs).style.visibility='visible';
	} else {
		document.getElementById(layerIs).style.visibility='hidden';
	}
}
