var divMoved = false;
var divShowing = true;
var navDiv = null;
var anch = null;
var divPad = null;
var pageHeight = 0;
var paneName = "content";

// Detect If In Frameset
if (this.name!="main") {
	// Load another stylesheet
	document.write('<link rel="stylesheet" href="insite/style.css" type="text/css">');
}
else{
	document.write('<link rel="stylesheet" href="insite/framestyle.css" type="text/css">');
}

function sizeContentWindow() {
if (this.name!="main") {
	// Calculate Window Size
	if (document.layers) {
        pageHeight = window.innerHeight;
    } else if (document.all) {
        pageHeight = document.body.clientHeight;
    } else if (document.getElementById) {
        pageHeight = window.innerHeight;
    }
	// Set content pane to the correct size;
	var layerObject = document.getElementById(paneName);
	if(layerObject!=null){
		if((pageHeight - 30) > 10){
			layerObject.style.height = ( pageHeight - 30 );
		}
	}
}
}

function startNav(contentPane){
if (this.name!="main") {
if(contentPane!=null){
			paneName = contentPane;
	}
	moveNav();
}
}

function moveNav(){
if (this.name!="main") {
// Initialise Drop down menu to new position and hide.
	var anch = null;
	var layerObject = document.getElementById("dropnav");
	if(document.getElementById("dropnav")!=null){	
		document.getElementById("dropnav").style.visibility = 'hidden';
		divShowing = false;
		document.getElementById("products").style.left = 130;
		divMoved = true;
		var anch = document.getElementById("products");
		if(anch!=null){
			document.getElementById("products").onmouseover = new Function('dropNav()');
		}
	}
	navDiv = document.getElementById("dropnav");
	anch = document.getElementById("products");
	divPad = document.getElementById("navpad");
	document.getElementById("products").onmouseover = new Function('enableDropDown()');
	document.getElementById("dropnav").onmouseout = new Function('disableDropDown()');
	document.getElementById("products").onmouseout = new Function('disableDropDown()');
	// Set size of content div
	sizeContentWindow();
	window.onresize = new Function("sizeContentWindow()");
}
}
function enableDropDown(){
if (this.name!="main") {
	document.getElementById("dropnav").onmouseover = new Function('enableDropDown()');
	document.getElementById("dropnav").style.visibility = 'visible';
	document.getElementById("products").onmouseout = new Function('disableDropDown()');
	divShowing = true;
}
}
function disableDropDown(){
if (this.name!="main") {
document.getElementById("dropnav").style.visibility = 'hidden';
	divShowing = false;
}
}