// JavaScript Document
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

function Cursor(){
	document.getElementById('query').focus();
}

function validate(thisform){
		with (thisform){
			var fld = document.getElementById("query").value;
			if(fld== ''){
				return false;
			}else{
				return true;
			}
		}
	}

function Jobs(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='jobs?key='+key
	}else{
		window.location.href='jobs'
	}
}

function Web(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='web?query='+key
	}else{
		window.location.href='/'
	}
}

function News(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='news?key='+key
	}else{
		window.location.href='news'
	}
}

function Prod(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='products?key='+key
	}else{
		window.location.href='products'
	}
}

function Blogs(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='blogs?key='+key
	}else{
		window.location.href='blogs'
	}
}

function People(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='people?fname='+key
	}else{
		window.location.href='people'
	}
}

function Submit(){
	var key = document.getElementById("query").value;
	if(key){
		window.location.href='web?query='+key;
	}else{
		window.location.href='/'
	}
}
	

function clickclear(thisfield, defaultimage, thisname) {
	if(thisfield.value == ""){
		newImage = "url(images/"+defaultimage+")";
		document.getElementById(thisname).style.backgroundImage = newImage; 
	}	

}

function clickrecall(thisfield, defaultimage, thisname) {
	if (thisfield.value == "") {
		newImage = "url(images/"+defaultimage+")";
		document.getElementById(thisname).style.backgroundImage = newImage; 
	}

}

function SetOnKeyDown( targetDocument ){
	targetDocument.onkeydown = function ( e ){
	e = e || event || this.parentWindow.event ;
	switch ( e.keyCode ){
		case 13 : // ENTER
			document.sql.submit();
		break;
		}
	}
}


