 function QuickSearch() { 
	var SearchView  = "/CA256D160006CABE/WebSearch?SearchView&Query=";
	if (document.forms[0].search.value.length<1) { 
		alert("Please type the word or words you wish to search for in the Search Box.");
		document.forms[0].search.focus();
		return; } 
	else { 
		window.location = SearchView + document.forms[0].search.value + "&1=Search~&Start=1&Count=30&SearchOrder=4&SearchWV=TRUE&SearchMax=0&SearchThesaurus=FALSE&SearchType=FullText";
		return false; } 
}

function QL_jumpMenu(targ,selObj,restore){
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}

function printFriendly() { 


	var docid = "";
	var fieldFound = false;
	var frmCount = 0;
	var frmMaxCount = 5;

	while (fieldFound==false){
		if (document.forms[frmCount].DocUNID){
			docid = document.forms[frmCount].DocUNID.value			
			fieldFound = true;
		}
	frmCount++;

		if (frmCount > frmMaxCount){
			//get out of the loop
			fieldFound = true;
		}
	}

	if (docid.length > 0){
		 
	var docURL = '../webPrintDocs/' + docid + '?OpenDocument';		
  //window.open(docURL,'PRINTDOC','toolbar=no,location=no,resizable=yes,scrollbars=yes,directories=no,status=no,width=540,height=400');
  self.location.href = docURL;

	}else{
		alert("Printer friendly version of this document is not available");
	}
}



rnd.today=new Date();
rnd.seed=rnd.today.getTime();

function rnd() {
        rnd.seed = (rnd.seed*9301+49297) % 233280;
        return rnd.seed/(233280.0);
}

function randImg(number, ImgName, Suffix) {
        randVal = Math.ceil(rnd()*number);
        return ImgName + randVal + '/$File/' + ImgName + randVal +'.'+ Suffix + '"';
}

//--------------------------------
// Cool Menus associated functions
//--------------------------------
function getQSVal(token){
	/*----------------------------------------
	Author : FLD
	Desc   : Get the value of a key from 
	         the QS
	         Pass the key (token) you want
	         and the response will be its value
	------------------------------------------*/
	sQString=window.location.toString();
	sQString=unescape(sQString);
	aQString=sQString.split("&");

	sReturn="";

	for(i=0;i<aQString.length;i++){
		curval = aQString[i].split("=");

		if (curval[0]==token){
			sReturn = curval[1];
			}
	}
	return sReturn;
}



function ifCurrent(tstLevel,appendClassNameTxt){
	/*------------------------------------
	Author : FLD
	Desc   : check the passed value tstLevel
		 with the QS key 'cTxt'
	------------------------------------------*/
	sCurrentSelected='cllevel0_Current';
	sDefaultClass='cllevel0';

	sRetVal=sDefaultClass+appendClassNameTxt;

	if (getQSVal("ctxt")==tstLevel){
		sRetVal = sCurrentSelected+appendClassNameTxt;
		}
	return sRetVal;
}


function styleToUse(){
	/*------------------------------------
	Author : FLD
	Desc   : used when creating the menus
		 -workaround NS4.x failure to recognise
		  "text-align : center;" in CSS
	------------------------------------------*/

var rtn;
	if(document.all){
		rtn = "";
	}else{
		rtn = "NS";
	}
	return rtn;
}
