
function NewWindow(mypage,myname,w,h,scroll,pos,tools)
{
	if(pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}
	if(pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}
	else if((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=0;TopPosition=20
	}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar='+tools+',resizable=yes';
win=window.open(mypage,myname,settings);
}

//NO FRAMES

if (top.location != self.location) {
top.location = self.location
}


//-- Global Variables
//-- Search+Returns items from the QueryString or Pathname
function getSearchAsArray() {
var results = new Array()
var input = unescape(location.search.substring(1));
    
var srchArray ;
  if (input) {
  srchArray = input.split("&")	
  }
  //if we receive the query string and the required number
  //of parameters is OK, otherwise try to build the parameters 
  //from the pathname
  if (input && (srchArray.length>=3)) {
    srchArray = input.split("&")	
    var tempArray = new Array()
    
  for (i = 0; i < srchArray.length; i++) {
  tempArray = srchArray[i].split("=")	
  results[tempArray[0]] = tempArray[1]
  }
  } else {		
  var vpath ;
  var section_focus, the_item, submenu ;
  vpath = unescape(location.pathname) ;	
  srchArray = vpath.split("/") ;
  for (i = 2; i < srchArray.length; i++) {						
  //for debug reason
  //alert(srchArray[i]);
    	   if (i==2) {
    		section_focus = srchArray[i];
    		the_item = srchArray[i];					
    	    } else if (i==srchArray.length-1) {
    		submenu = srchArray[i];
    		submenu = submenu.split(".")[0];
    	    } else {
    		the_item +="/"+ srchArray[i];
    	    }
    	}	
    	results["section_focus"]=section_focus;
    	results["the_item"]=the_item;
    	results["submenu"]=submenu;
    }    
    return results
}

srchString = getSearchAsArray();

//QueryString Items
var section_focus = unescape(srchString["section_focus"]);
var the_item = unescape(srchString["the_item"]);
var submenu = unescape(srchString["submenu"]);
var disImg = unescape(srchString["disImg"]);

//Browsers
var wBrwsr = navigator.appName;
var wVersn = parseFloat(navigator.appVersion);

//-- Main Navigation
function SiteIndx(the_item,section_focus,URL_for_main,submenu)  {
document.location.href = daBaseURL + "/menu/" + the_item + URL_for_main + "?" + "section_focus=" + section_focus + "&the_item=" + the_item + "&submenu=" + submenu;
}

//index page MouseOvers
function styleOver(cellBk,dv1,dv2)
{
document.getElementById(cellBk).style.backgroundColor= "#ada7a7";
document.getElementById(dv1).className= 'indexTxtSlctd';
document.getElementById(dv2).className='indexTxtSlctd';
}

function styleOut(cellBk,dv1,dv2)
{
document.getElementById(cellBk).style.backgroundColor="cccccc";
document.getElementById(dv1).className='doink';
document.getElementById(dv2).className='indexTxt';
}

function changeit(lyrOne,lyrTwo,lyrThr,lyrFr,sctn,txt){
var theTable ="";

if(document.layers){

theTable +="<table width=\"100%\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgColor=\"red\">";
theTable +="<tr>";
theTable +="<td><img src=\"/media/images/sec_tri.gif\" width=\"10\" height=\"18\" border=\"0\"></td>";
theTable +="<td width=\"2%\">img</td>";
theTable +="<td width=\"98%\" height=\"20\" class=\"topMenuB\">";
theTable +="<a href=\'#'>"+ txt +"</a>";
theTable +="</td>";
theTable +="</tr>";
theTable +="</table>";

eval("document."+lyrOne+".document."+lyrTwo+".document."+lyrThr+".document."+lyrFr+".document.write(theTable)");
eval("document."+lyrOne+".document."+lyrTwo+".document."+lyrThr+".document."+lyrFr+".document.close()");
}
}

function changeitBk(lyrOne,lyrTwo,lyrThr,lyrFr,sctn,txt){
var theTable ="";

if(document.layers){
 theTable +="<table width=\"100%\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
 theTable +="<tr>";
 theTable +="<td><img src=\"/media/images/sec_tri.gif\" width=\"10\" height=\"18\" border=\"0\"></td>";
 theTable +="<td width=\"2%\"><img src=\"/media/images/spacer.gif\" width=\"5\" height=\"1\"></td>";
 theTable +="<td width=\"98%\" height=\"20\" class=\"topMenu\">";
 theTable +="<a href=\"javascript:SiteIndx('"+sctn+"','"+sctn+"','/index.upb','')\">"+txt+"</a>";
 theTable +="</td>";
 theTable +="</tr>";
 theTable +="</table>"

eval("document."+lyrOne+".document."+lyrTwo+".document."+lyrThr+".document."+lyrFr+".document.write(theTable)");
eval("document."+lyrOne+".document."+lyrTwo+".document."+lyrThr+".document."+lyrFr+".document.close()");

}
}

//MouseOvers for NS4
//-- Corner Color Change --//
function crnImg(iImg,lImg) {
if (document.layers) {
document.layers[iImg].document.layers[lImg].bgColor='#ada7a7';
}
}

//menu for page 2
function crnImgBk(iImg,lImg) {
if (document.layers) {
document.layers[iImg].document.layers[lImg].bgColor='cccccc';
}
}

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
