/* used with user default.asp and in admin/defaultAdmin.asp */
	
	function replaceChars(entry,old,newStr) {
		out = "" + old; // replace this
		add = "" + newStr; // with this
		temp = "" + entry; // temporary holder

		while (temp.indexOf(out)>-1) {
			pos= temp.indexOf(out);
			temp = "" + (temp.substring(0, pos) + add + temp.substring((pos + out.length), temp.length));
		}
		return temp;
	}


	function searchres(){
		var truecount = 0;
		
		if(document.formname.search.value==""){
			alert("Enter some words to search on.");
			document.formname.search.focus();
			truecount = 0;
		}else{
			truecount = 1;
		}
		
		// As the keywords are separated by commas, users may enter commas in the search string
		// so replace any such commas in the search string by spaces
		
		document.formname.search.value = replaceChars(document.formname.search.value, ",", " ");
				
		if(truecount==0){
			return false;
		}else{
			return true;
		}		
	}
	
				
	function loadBox(sWords){
		// it appears that this function is not used anywhere
		
		document.formname.search.value=sWords;
		document.formname.search.focus();
	}
			
	function windowOpener(thisUrl,X1,Y1) { 
    var winX=screen.width;
    var winY=screen.height;
  	if (!X1) X1=590;
  	if (!Y1) Y1=380;

  helpWindow = window.open(thisUrl,"Help","toolbar=no,width="+X1+",height="+Y1+",left="+
    (winX-X1)/2+",top="+(winY-Y1-20)/2+",location=no,directories=no, status=no, menubar=no,scrollbars=yes,resizable=yes");
  }

