//  THIS FILE CONTAINS THE FOLLOWING FUNCTIONS:

//

var ext = ".gif";

//  ROLL OVER IMAGE FUNCTION
function imageOver(imageName){
	document.images[imageName].src = imageDir + imageName + "_ov" + ext;
}

//  ROLL OFF IMAGE FUNCTION
function imageOff(imageName){
	if(imageName != curImg){
		document.images[imageName].src = imageDir + imageName + ext;
	}
}


var curImg = "";

//  CURRENT PAGE IMAGE FUNCTION
function curImgOn(imageName){
	curImg = imageName;
	imageOver(curImg);
}


var extjpg = ".jpg";

//  ROLL OVER IMAGE FUNCTION JPGS
function imageOverjpg(imageName){
	document.images[imageName].src = imageDir + imageName + "_ov" + extjpg;
}

//  ROLL OFF IMAGE FUNCTION JPGS
function imageOffjpg(imageName){
	document.images[imageName].src = imageDir + imageName + extjpg;
}


//  POP UP WINDOW FUNCTION
function windowOpener(what_url,winheight,winwidth) {
	options="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+winwidth+",height="+winheight;

	popwin = window.open(what_url,'pop_win',options);
	popwin.focus();
}

function windowOpener2(what_url,winheight,winwidth) {
	options="toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+winwidth+",height="+winheight;

	popwin = window.open(what_url,'pop_win',options);
	popwin.focus();
}


//  Open URL in main window and close pop up
function loadParentUrl(url) {
	window.opener.document.location = url;
	window.close();
}


//Container for preloaded images
var preloadArray = new Array();

// Preload an image
function preloadImage(imgSrc){
    var i = preloadArray.length;
    preloadArray[i] = new Image();
    preloadArray[i].src = imgSrc;
}



function makeExclusive(boxRef){
	document.loginForm.loginAsStaff.checked = 0;
	document.loginForm.loginAsTrust.checked = 0;
	boxRef.checked = 1;
}

//  DROP DOWN MENU FUNCTION
function dropdown(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function dropdownnewpage()
{
  pos=window.document.forms[0].menulist.selectedIndex;
  newpage=window.document.forms[0].menulist.options[pos].value; 
   
  if(newpage!= "")
  {
     window.open(newpage); 
  }
}

// Check search from is filled in correctly before submitting
function CheckForm () {

	//Check for a word to search
	if (document.frmsearch.txtsearch.value==""){
		alert("Please enter at least one keyword to search");
		document.frmsearch.txtsearch.focus();
		return false;
	}
	
	return true
}

