var isIE = 0;
var isOtherBrower = 0;

if (navigator.appName.indexOf('Microsoft Internet Explorer') != -1) {isIE = 1;}
else {isOtherBrow = 1;}

///////// This script will prevent MSIE 6 from using the site */
///////// appInfo = navigator.appVersion; */
///////// srcPOS = appInfo.indexOf('MSIE'); */
///////// browserVersion =  appInfo.substring(srcPOS+5,srcPOS+6) */
///////// browserVersion = parseInt(browserVersion); */

///////// if (isIE && (browserVersion >= 6)) top.location = '../mserror.html' */


if (document.layers) {
	origWidth = innerWidth;
	origHeight = innerHeight;
	}
        
function reloadPage() {
	if (innerWidth != origWidth || innerHeight != origHeight) 
	location.reload();
	}

if (document.layers) onresize = reloadPage;


var myPage = self.location;
var thisPage = top.location;

var currInterface = 1;
var dhtmlScroll = 0;
var useFrames = 0;




//////////	Detecting DOM Type */
//////////	Initialize var for DOM Type detection */
var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;

////////// Feature Sensing to detect DOM Type */
if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[objectID]); }
		};}
	}
}



///////// Drop Down Menu */
///////// Script needs detecting DOM TYPE to work (above)*/
				
var menuTop = 45;
var menuLeft = 0;

var domSMenu = null;
var oldDomSMenu = null;
var t = 10;
var lDelay = 50;
var lCount = 0;
var mDelay = 5;

function popMenu(menuNum){
	if (isDHTML) {
////////// Sets the previous menu's visibility to hidden */
		t = 2;
		if (oldDomSMenu) {
			oldDomSMenu.visibility = 'hidden'; 
			oldDomSMenu.zIndex = '0'; 
			t = mDelay; 
			lCount = 0;
		}

////////// Defines the DOMs	of the menu objects */
		var idMenu = 'menuHead';
		var domMenu = findDOM(idMenu,0);

		var idMenuOpt = 'menuHead' + menuNum;
		var domMenuOpt = findDOM(idMenuOpt,0);		

		var idSMenu = 'menu' + menuNum;
		var domSMenu = findDOM(idSMenu,1);

////////// Defines the positions of the sub-menus */
	if (isID || isAll) { 	
				var menuLeft = (domMenu.offsetLeft) + (domMenuOpt.offsetLeft) + 0;
				var menuTop = (domMenu.offsetTop) + (domMenu.offsetHeight) + 0;
			}
		if (isLayers) {
				var menuLeft = document.layers[idMenu].layers[idMenuOpt].pageX - 0;
				var menuTop = domMenu.pageY + domMenu.clip.height - 0;
		}

////////// Positions and shows the menu */
		if (oldDomSMenu != domSMenu) {	
			domSMenu.left = menuLeft; 
			domSMenu.top = menuTop;
			domSMenu.visibility = 'visible';
			domSMenu.zIndex = '500';
			oldDomSMenu = domSMenu;
		}

////////// Resets oldDom if it is the same as the current DOM */
		else { oldDomSMenu = null; }
	}

////////// Returns a 'null' value for non-DHTML Browsers */
	else { return null; }
}

function delayHide() {
////////// Checks to see if there is a menu showing and whether */
////////// the global variable 't' has been set to 0 */
    if ((oldDomSMenu) && (t == 0)) {

////////// Hides the old menu, resets menu conditions, */
////////// and stops the function running */
        oldDomSMenu.visibility = 'hidden'; 
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0; 
        return false;
    }

////////// Interupts the function if another menu is opened */
    if (t == mDelay) { lCount = 0; return false; }

////////// Repeats the function adding 1 to lCount each time until */
////////// lCount is equal to lDelay and then sets 't' to 0 so that */
////////// the menu will hide when it runs again */
    if (t == 1) { 
        lCount = lCount + 1;
        if (lDelay <= lCount) { t = 0; }
        if (lDelay >= lCount) { setTimeout('delayHide(' + t + ')',mDelay); }
    }
}
