function makeDiv(str)
{
return "<div style=\"width:100%\"><div align=\"right\"><a href=\"#\" onMouseOver=\"cClick();\">[X]</a></div><div class=smallblack>Jump to:</div>"+str+"</div>";

}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function setForm(rbutton,area,notarea){
//alert("in");
	var action;
	if(rbutton.id=='sitewide')
		action = "/search/";
		else
		action = "/<?php echo strtolower($thisarea); ?>/";
	document.forms['search'].action = action;
	document.getElementById(area).src = "/images/radon.gif";
	document.getElementById(notarea).src = "/images/radoff.gif";
	document.getElementById('scope').value = rbutton.id.toLowerCase();
//	alert(document.forms['search'].action);
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
MM_preloadImages('/images/bgorange.gif','/images/bggray.gif');
//-->

/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  Copyright 2001-3 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

// onresize for ns4
var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

var cur_lyr;	// holds id of currently visible layer
var cur_tab;	// holds id of currently visible layer
function swapLayers(id) {
  if (cur_lyr) hideLayer(cur_lyr);
  showLayer(id);
  cur_lyr = id;
  swapTabs(id);
}
var cur_lyr2="ln";	// holds id of currently visible layer
var cur_tab2="lntab";	// holds id of currently visible layer
function swapLayers2(id) {
  if (cur_lyr2) hideLayer(cur_lyr2);
  showLayer(id);
  cur_lyr2 = id;
  swapTabs2(id);
}

function swapTabs(id) {
	var tab = getElemRefs(id + "tab");
	if (cur_tab) {	  
		var thistab = getElemRefs(cur_tab);
	  if (thistab && thistab.css) thistab.className = "navbuttonoff";
	}
	cur_tab = id +"tab";
  	 if (tab && tab.css) tab.className = "navbuttonon";
}
function swapTabs2(id) {
	var tab = getElemRefs(id + "tab");
	if (cur_tab2) {	  
		var thistab = getElemRefs(cur_tab2);
	  if (thistab && thistab.css) thistab.className = "navbuttonoff";
	}
	cur_tab2 = id +"tab";
  	 if (tab && tab.css) tab.className = "navbuttonon";
}

function showLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "inline";
  var link_id = getElemRefs(id+"a");
 // if (link_id && link_id.css) link_id.className = "header2";
}

function hideLayer(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.display = "none";
    var link_id = getElemRefs(id+"a");
  if (link_id && link_id.css) link_id.className = "header";

}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { 
args=MM_validateForm2.arguments;
val=MM_findObj(args[0]);
if ((val.value == '<?php echo $searchPhrase; ?>') || (val.value == '')) {
//alert (val.value + " <?php echo $searchPhrase; ?>" + "match");
document.MM_returnValue = false;
} else  {
//alert (val.value + " <?php echo $searchPhrase; ?>" + "nomatch");
document.MM_returnValue = true;
}
}