parentwin = window.opener;

function OpenApplyWindow(FileName,WindowName)
{
	if (IsNs4)
	{	WindowFeature="Resizable=Yes,ScrollBars=Yes,MenuBar=No,Directories=No,ToolBar=No,Location=No,Status=No,Width=800,Height=600,ScreenX=0,ScreenY=0,Top=0,Left=0" }
	else 
	{	WindowFeature="Resizable=Yes,ScrollBars=Yes,MenuBar=No,Directories=No,ToolBar=No,Location=No,Status=No,Width=602,Height=600,ScreenX=0,ScreenY=0,Top=0,Left=0" }
	
	newWindow=open(FileName,WindowName,WindowFeature);
	if (newWindow.opener == null) { newWindow.opener = self; }
	if (newWindow.focus) { newWindow.focus(); }
}

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}

IsNs4 = (document.layers)? true:false
IsIe4 = (document.all)? true:false
verOK=(IsNs4||IsIe4)

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

function regular_pop(page,section){
	var winl = (screen.width - 640) / 2;
	var wint = (screen.height - 500) / 2;
	str = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=640,height=500"+",top="+wint+",left="+winl;
	cpjob = window.open(page,section,str);
	cpjob.focus();
}

function replace(s, t, u) {
  /*
  **  Replace a token in a string
  **    s  string to be processed
  **    t  token to be found and removed
  **    u  token to be inserted
  **  returns new String
  */
  i = s.indexOf(t);
  r = "";
  if (i == -1) return s;
  r += s.substring(0,i) + u;
  if ( i + t.length < s.length)
    r += replace(s.substring(i + t.length, s.length), t, u);
  return r;
  }

function expand(s)
{
/*
  var td = s;
  var d = td.getElementsByTagName("div").item(0);
  td.className = "menuHover";
  d.className = "menuHover";
  */
	  document.getElementById('sub_COMM').className = "menuNormal";
	  document.getElementById('sub_JOB').className = "menuNormal";
	  document.getElementById('sub_CED').className = "menuNormal";
	  document.getElementById('sub_SUPP').className = "menuNormal";
	  /*
	  document.getElementById('COMM').className = "pri-menuNormal";
	  document.getElementById('JOB').className = "pri-menuNormal";
	  document.getElementById('CED').className = "pri-menuNormal";
	  document.getElementById('SUPP').className = "pri-menuNormal";
	  */
	  document.getElementById('sub_'+s).className = "menuHover";
	  //document.getElementById(s).className = "pri-menuHover";
	  //document.getElementById('sub_'+s).style.display="inline";
	  /*
	  if (s=="COMM") {
		document.getElementById('pri-nav').className = "pri-comm";
	  } else if (s=="JOB") {
		document.getElementById('pri-nav').className = "pri-job";
	  } else if (s=="CED") {
		document.getElementById('pri-nav').className = "pri-ced";
	  } else if (s=="SUPP") {
		document.getElementById('pri-nav').className = "pri-supp";
	  }*/
	  document.getElementById('pri_nav').className = "pri_"+s;
	  //document.getElementById("dflt_navi").innerHTML = s;
		//document.getElementById('sub_'+s).style.display="inline";  
		//alert(document.getElementById('pri-nav').className);
}  
function collapse(s)
{
  document.getElementById('sub_'+s).className = "menuNormal";
	//document.getElementById('sub_'+s).style.display="inline";  
	//alert(document.getElementById('sub_'+s).className);
}  
function showDefaulTag()
{
	//if(typeof a!="undefined") {
	if ((document.URL.indexOf("artsection=COMM") >= 0) || (document.URL.indexOf("jscommunity.php") >= 0) ) {
		expand("COMM");
		if (document.URL.indexOf("communitycode=SMKG") >= 0) {
			document.getElementById('item_SMKG').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=FIN") >= 0) {
			document.getElementById('item_FIN').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=BLD") >= 0) {
			document.getElementById('item_BLD').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=IT") >= 0) {
			document.getElementById('item_IT').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=HRA") >= 0) {
			document.getElementById('item_HRA').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=ENG") >= 0) {
			document.getElementById('item_COMMENG').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=MER") >= 0) {
			document.getElementById('item_MER').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=RECR") >= 0) {
			document.getElementById('item_RECR').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=MFG") >= 0) {
			document.getElementById('item_MFG').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=RET") >= 0) {
			document.getElementById('item_RET').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=FGRD") >= 0) {
			document.getElementById('item_FGRD').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=HOT") >= 0) {
			document.getElementById('item_HOT').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=CHI") >= 0) {
			document.getElementById('item_CHI').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=TEMP") >= 0) {
			document.getElementById('item_TEMP').className = "itemHighlight"; 
		} else if (document.URL.indexOf("communitycode=CLE") >= 0) {
			document.getElementById('item_CLE').className = "itemHighlight"; 
		}
		
	} else if ( ((document.URL.indexOf("artsection=JOB") >= 0) && (document.URL.indexOf("jsarticleindex.php") >= 0)) || (document.URL.indexOf("arttype=JAPPL") >= 0)  || (document.URL.indexOf("arttype=FOCUS") >= 0) || (document.URL.indexOf("arttype=CORP") >= 0) || (document.URL.indexOf("arttype=INDP") >= 0) || (document.URL.indexOf("arttype=SOCI") >= 0) || (document.URL.indexOf("arttype=MGT") >= 0) || (document.URL.indexOf("arttype=CHAMA") >= 0) || (document.URL.indexOf("arttype=GEKNO") >= 0) || (document.URL.indexOf("arttype=PRFIN") >= 0) || (document.URL.indexOf("arttype=LEISU") >= 0) || (document.URL.indexOf("arttype=JSPEC") >= 0)) { 
		expand("JOB");
		if (document.URL.indexOf("arttype=JAPPL") >= 0) {
			document.getElementById('item_JAPPL').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=FOCUS") >= 0) {
			document.getElementById('item_FOCUS').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=CORP") >= 0) {
			document.getElementById('item_CORP').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=INDP") >= 0) {
			document.getElementById('item_INDP').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=LEISU") >= 0) {
			document.getElementById('item_LEISU').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=SOCI") >= 0) {
			document.getElementById('item_SOCI').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=MGT") >= 0) {
			document.getElementById('item_MGT').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=JSPEC") >= 0) {
			document.getElementById('item_JSPEC').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=CHAMA") >= 0) {
			document.getElementById('item_CHAMA').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=GEKNO") >= 0) {
			document.getElementById('item_GEKNO').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=PRFIN") >= 0) {
			document.getElementById('item_PRFIN').className = "itemHighlight"; 
		}
	} else if (((document.URL.indexOf("artsection=CED") >= 0) && (document.URL.indexOf("jsarticleindex.php") >= 0)) || (document.URL.indexOf("artsection=CED") >= 0) || (document.URL.indexOf("cesearch.php") >= 0) || (document.URL.indexOf("coursesearch.php") >= 0) || (document.URL.indexOf("cedir.php") >= 0) || (document.URL.indexOf("coursedirectory.php") >= 0) || (document.URL.indexOf("jsevents.php") >= 0) || (document.URL.indexOf("courseresult.php") >= 0) || (document.URL.indexOf("arttype=ESPEC") >= 0) ) {
		expand("CED");
		if (document.URL.indexOf("arttype=CINTR") >= 0) {
			document.getElementById('item_CINTR').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=EDUF") >= 0) {
			document.getElementById('item_EDUF').className = "itemHighlight"; 
		} else if (document.URL.indexOf("jsevents.php") >= 0) {
			document.getElementById('item_EVENT').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=ESPEC") >= 0) {
			document.getElementById('item_ESPEC').className = "itemHighlight"; 
		} else if ((document.URL.indexOf("coursedirectory.php") >= 0) || (document.URL.indexOf("cedir.php") >= 0) ) {
			document.getElementById('item_COURSEDIR').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=STUD") >= 0) {
			document.getElementById('item_STUD').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=ENG") >= 0) {
			document.getElementById('item_ENG').className = "itemHighlight"; 
		} else if ( (document.URL.indexOf("cesearch.php") >= 0) || (document.URL.indexOf("coursesearch.php") >= 0) || (document.URL.indexOf("courseresult.php") >= 0) ) {
			document.getElementById('item_COURSESEARCH').className = "itemHighlight"; 
		}
	} else if (((document.URL.indexOf("artsection=SUPP") >= 0) && (document.URL.indexOf("jsarticleindex.php") >= 0)) || (document.URL.indexOf("jssalary.php") >= 0) || (document.URL.indexOf("jspollquestions.php") >= 0) || (document.URL.indexOf("jspoll.php") >= 0) || (document.URL.indexOf("jspollresults.php") >= 0) || (document.URL.indexOf("arttype=SELF") >= 0) || (document.URL.indexOf("arttype=HOROS") >= 0) || (document.URL.indexOf("arttype=TEACH") >= 0) || (document.URL.indexOf("arttype=READ") >= 0) || (document.URL.indexOf("jsforum") >= 0) ) {
		expand("SUPP");
		if (document.URL.indexOf("jsforum.php") >= 0) {
			document.getElementById('item_FORUM').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=TEACH") >= 0) {
			document.getElementById('item_TEACH').className = "itemHighlight"; 
		} else if (document.URL.indexOf("READ") >= 0) {
			document.getElementById('item_READ').className = "itemHighlight"; 
		} else if (document.URL.indexOf("jssalary.php") >= 0) {
			document.getElementById('item_SALARY').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=SELF") >= 0) {
			document.getElementById('item_SELF').className = "itemHighlight"; 
		} else if (document.URL.indexOf("arttype=HOROS") >= 0) {
			document.getElementById('item_HOROS').className = "itemHighlight"; 
		} else if ( (document.URL.indexOf("jspollquestions.php") >= 0)  || (document.URL.indexOf("jspoll.php") >= 0) || (document.URL.indexOf("jspollresults.php") >= 0) ) {
			document.getElementById('item_POLL').className = "itemHighlight"; 
		}
	} else {
		expand("COMM");
	}
}



