//-- portal_lib.js: Core JS library 
//-- Library file MUST be loaded before all else

//-- Function Library

function goWin(url, type, w, h, scroll) {
	if (!type || type == "") type = 1
	if (type == 1) top.location = "./" + url
	else if (type == 2) window.open(url, "smallWin", "toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,scrollbars=" + scroll + ",width=" + w + ",height=" + h + ",top=0,screenY=0,left=0,screenX=0")
	else if (type == 3) window.open(url, "fullWin")
}


function escapeURL(p_text) {
  re1 = /\&/gi;
  re2 = / /gi;
  re3 = /\+/gi;
 var  p_str = p_text;
  p_str = p_str.replace(re1,"%26");
  p_str = p_str.replace(re2,"%2B");
  p_str = p_str.replace(re3,"%2B");
  return p_str;
}

function dropdown(mySel)
{
var myWin, myVal;

myVal = mySel.options[mySel.selectedIndex].value;

if(myVal)
 {
 if(mySel.form.target)myWin = parent[mySel.form.target];
 else myWin = window;
 if (! myWin) return true;
 myWin.location = myVal;
 }
return true;
}

function openNewWin(elem){
  if(elem.options[0].selected) {
  alert("Please select a URL from the menu.");
  } else {
  window.open(elem.options[elem.selectedIndex].value);
  }
}