function openVariableWindow(strUrlPath, strWindowName, intWinHeight, intWinWidth, intWinTop, intWinLeft, strWindowFeatures, blnCentreWindow) { 
	
	var wndHeight = intWinHeight;
	var wndWidth = intWinWidth;
	var X = intWinLeft;
	var Y = intWinTop;
	
	if (blnCentreWindow == true) {
		if ((navigator.userAgent.indexOf("Mac")!=-1) || (navigator.userAgent.indexOf("Macintosh")!=-1)) {
			wndHeight -= 16;
			wndWidth -= 15;
		} 
		
		if (screen.availWidth) {
			X = ( (screen.availWidth / 2) - (wndWidth / 2) ) ;
			Y = ( (screen.availHeight / 2) - (wndHeight / 2) ) ;
		}
	}
	
	strWindowName = window.open(strUrlPath, strWindowName,"left=" + X + ",screenX=" + X + ",screenY=" + Y + ",top=" + Y + ",height=" + wndHeight + ",width=" + wndWidth + "," + strWindowFeatures);
	strWindowName.moveTo(X,Y);
	strWindowName.focus();
} 


function galleryPopup(blnThingType, intThingID) { 
	
	var wndHeight = 360;
	var wndWidth = 460;
	var X = 0;
	var Y = 0;
	if ((navigator.userAgent.indexOf("Mac")!=-1) || (navigator.userAgent.indexOf("Macintosh")!=-1)){
		wndHeight -= 16;
		wndWidth -= 15;
	}
	
	if (screen.availWidth) {
		X = ( (screen.availWidth / 2) - (wndWidth / 2) ) ;
		Y = ( (screen.availHeight / 2) - (wndHeight / 2) ) ;
	}
	galleryWin = window.open("14.asp?" + blnThingType + "=" + intThingID,"galleryWin","left=" + X + ",screenX=" + X + ",screenY=" + Y + ",top=" + Y + ",height=" + wndHeight + ",width=" + wndWidth);
	galleryWin.moveTo(X,Y);
	galleryWin.focus();
}


// Start Initialise Functions//

var bw = new checkBrowser();
writeCSS();

// ----------------------- //


function checkBrowser(){
    var b = navigator.appName;
    if (b == "Netscape"){
        this.b = "ns";
    }
    else if (b == "Microsoft Internet Explorer"){
        this.b = "ie";
    }
    else{
        this.b = b;
    }

    this.dom = document.getElementById?1:0;
    this.v = parseInt(navigator.appVersion);
    this.ns = (this.b=="ns" && this.v>=4);
    this.ns4 = (this.b=="ns" && this.v==4);
    this.ns6 = (this.dom && !document.all) ? 1:0;

    this.ie = (this.b=="ie" && this.v>=4);
    this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0);
    this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
    if (this.ie5){
        this.v = 5;
    }
    this.bw  = (this.ie5 || this.ie4 || this.ns4 || this.ns6);
    return this;
}


function writeCSS() {
	if (bw.ie||bw.dom) {
		document.write("<LINK REL=stylesheet HREF='_css/_siteCustomContent_IE.css' TYPE='text/css'>");
		}
	else if (bw.ns4) {
		document.write("<LINK REL=stylesheet HREF='_css/_siteCustomContent_Other.css' TYPE='text/css'>");
		}
	else {
		document.write("<LINK REL=stylesheet HREF='_css/_siteCustomContent_IE.css' TYPE='text/css'>");
	}
}

function startSearch() {
	if (document.keywordSearch.KEYWORDS.value != "") {
		document.keywordSearch.submit();
	}
}