function imgchg(imgst,imgName) {
    imgc = eval(imgName + "_" + imgst + ".src");
    document [imgName].src = imgc;
}

function CopyRight() {
    document.write('<div style="color: #999999; font-size: 10px; text-align: center;">&#169; Morris Berger</div>');
}

function Logout() {
	var OK = false;
	OK = confirm("Logout of current session?");
	if (OK == true) {
		document.forms[0].action = "http://morrisberger.com/cgi-bin/plogin.pl";
		document.forms[0].target = "_top";
		document.forms[0].cmd.value = "session_logout";
		document.forms[0].method = "post";
		document.forms[0].submit();
	}
}
function fCancel(SCRIPT,CMD,STR) {
    var OK = "";
    OK = confirm(STR);
    if (OK == true) {
        document.forms[0].cmd.value = CMD;
        document.forms[0].action = SCRIPT;
        document.forms[0].submit();
    }
}

function FldFocus() {
    if (document.forms[0].elements[0]) {
        for (i=0; i<document.forms[0].elements.length; i++) {
            if (document.forms[0].elements[i].type == "text") {
                document.forms[0].elements[i].focus();
                return;
            }
        }
    }
}

function TrimSpaces (STR) {
    STR = STR.replace(/^ +/, ""); 
    STR = STR.replace(/ +$/, ""); 
    return (STR)
}
function NoSpaces (STR) {
    STR = STR.replace(/ +/g, ""); 
    return (STR)
}
function NoQuotes(STR) {
    STR = STR.replace(/\"+/g, ""); 
    return (STR)
}


// DROP DOWN MAIN MENU LINKS
function SearchLink() {
str = '<div class="horizontalcssmenu"> \
<ul id="cssmenu1"> \
<li><a href="#" onclick="return false;"><img src="http://morrisberger.com/images/clear.gif" border="0" width="80" height="23"></a> \
    <ul> \
	 <li><a href="jobsearch.php" onMouseOver="MM_swapImage(\'current\',\'\',\'http://morrisberger.com/images/current_button_reverse2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="http://morrisberger.com/images/current_button2.gif"alt="Current Searches" name="current" border="0"></a></li> \
	 <li><a href="filled_positions.php" onMouseOver="MM_swapImage(\'recent\',\'\',\'http://morrisberger.com/images/recent_button_reverse2.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="http://morrisberger.com/images/recent_button2.gif"alt="Recent Searches" name="recent" border="0"></a></li> \
    </ul> \
</li> \
</ul> \
</div>';
document.write(str);
}
var cssmenuids=['cssmenu1'] //Enter id(s) of CSS Horizontal UL menus, separated by commas
var csssubmenuoffset=-2 //Offset of submenus from main menu. Default is 0 pixels.

function createcssmenu2(){
for (var i=0; i<cssmenuids.length; i++){
  var ultags=document.getElementById(cssmenuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
		ultags[t].style.top=ultags[t].parentNode.offsetHeight+csssubmenuoffset+"px"
    	ultags[t].parentNode.onmouseover=function(){
			this.style.zIndex=100
    		this.getElementsByTagName("ul")[0].style.visibility="visible"
			this.getElementsByTagName("ul")[0].style.zIndex=0
    	}
    	ultags[t].parentNode.onmouseout=function(){
			this.style.zIndex=0
			this.getElementsByTagName("ul")[0].style.visibility="hidden"
			this.getElementsByTagName("ul")[0].style.zIndex=100
    	}
    }
  }
}
if (window.addEventListener)
window.addEventListener("load", createcssmenu2, false)
else if (window.attachEvent)
window.attachEvent("onload", createcssmenu2)


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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

