// JavaScript Document

	if (document.images) {
	
		menuImg1on = new Image();
		menuImg1on.src = "images/IntroPCs_On.gif";
		menuImg2on = new Image();
		menuImg2on.src = "images/Windows_On.gif";
		menuImg3on = new Image();
		menuImg3on.src = "images/Internet_On.gif";
		menuImg4on = new Image();
		menuImg4on.src = "images/Word_On.gif";
		menuImg5on = new Image();
		menuImg5on.src = "images/Excel_On.gif";
		menuImg6on = new Image();
		menuImg6on.src = "images/PowerPoint_On.gif";
	
		menuImg1off = new Image();
		menuImg1off.src = "images/IntroPCs.gif";
		menuImg2off = new Image();
		menuImg2off.src = "images/Windows.gif";
		menuImg3off = new Image();
		menuImg3off.src = "images/Internet.gif";
		menuImg4off = new Image();
		menuImg4off.src = "images/Word.gif";
		menuImg5off = new Image();
		menuImg5off.src = "images/Excel.gif";
		menuImg6off = new Image();
		menuImg6off.src = "images/PowerPoint.gif";
	}

	function imgOn(imgName) {
		if (document.images) {
			document[imgName].src = eval(imgName + "on.src");
		}
	}

	function imgOff(imgName) {
		if (document.images) {
			document[imgName].src = eval(imgName + "off.src");
		}
	}


function getBrowser(){
	var browser;
	browser = navigator.appName.indexOf("Microsoft Internet Explorer") != -1 ? "IE" : "NS";
	return browser;
}

function showSearch(){
	document.getElementById('search').style.visibility = "visible";
}

function hideSearch(){
		document.getElementById('search').style.visibility = "hidden";
}

function showContent(id, size){
	for (var i=0;i<size;i++){
		document.getElementById('content' + (i+1)).style.visibility = "hidden";
	}
	document.getElementById(id).style.visibility = "visible";
}

function hideContent(size,displayContent){
	for (var i=0;i<size;i++){
		document.getElementById('content' + (i+1)).style.visibility = "hidden";
	}
	

	document.getElementById('content' + displayContent).style.visibility = "visible";
}

function clrStatus(){
	window.status = '';
}	//Function: ovrMsg()

function loseFocus(linkObj){
	if(linkObj.blur)
		linkObj.blur();
}

function refreshContent(size,displayContent){
	hideContent(size,displayContent);
	document.srchForm.srchVal.value = "";
	document.srchForm.srchVal.blur();	
}

function setFocus(){
	opener.document.srchForm.srchVal.focus();	
}

function validate(frmObj){

	//getting search string value from the form...
    var str = frmObj.srchVal.value;
	
	//trumming leading and trailing spaces from the search string
    while (str.substring(0,1) == ' ') {
		str = str.substring(1);
	}
    while (str.substring(str.length-1,str.length) == ' '){
		str = str.substring(0,str.length-1);
	}
 
 	//checking length of the search string
	if (str.length > 50){
		window.alert('Search text must not be longer than 50 characters.');
	}
	else{
		//searching nuggets by calling the "Search()" function in "nugget.js" file
		search(frmObj);
	}
}	//Function: validate()
