function NewWindow(winURL,winName,features) { 
	window.open(winURL,winName,features);
}
function CloseWindow() {
	window.close();
  self.close();
}
function Display(item) {
  obj=document.getElementById(item);
  visible=(obj.style.display!="none")  
  if (visible) {
    obj.style.display="none";
  } else {
    obj.style.display="block";
  }
}
function Hide(item) {
  obj=document.getElementById(item);
  visible=(obj.style.display!="none")  
  if (visible) {
    obj.style.display="none";
  } 
}
function ShowAll() {
	for(var i=0; i < arguments.length; i++) {
   	obj=document.getElementById(arguments[i]);
   	visible=(obj.style.display!="none")  
   	if (!visible) {
  		obj.style.display="block";
   	}
	}
}
function HideAll() {
	for(var i=0; i < arguments.length; i++) {
   	obj=document.getElementById(arguments[i]);
   	visible=(obj.style.display!="none")  
   	if (visible) {
   		obj.style.display="none";
   	}
	}
}
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;
}
// this function used instead of Display() because it can receive several arguments at once
function MM_showHideLayers() { //v6.0  
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
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_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];}
}
function MM_setTextOfTextfield2(objName,x,newObjName) { //v3.0 //modified by CMH. 5/15/07.
	var newObj = MM_findObj(newObjName);
	var newText = newObj.value;
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}
/*
*This JavaScript takes an input number and adds commas in the proper places.
*As needed by its original purpose, also adds a dollar.
*Copyright 1998, David Turley <dturley@pobox.com>
*Feel free to use and build on this code as long as you include this notice.
*Last Modified March 3, 1998
*/
function addCommas(formObj) {
  var Num = formObj.value;
  if (Num.length > 0) {
  // remove input commas
  var idx = Num.indexOf(",");
  while ( idx > -1 ) {
    Num = Num.replace(",",""); 
    idx = Num.indexOf(",");
	}
  var newNum = "";
  var newNum2 = "";
  var count = 0;
  //check for decimal number
  if (Num.indexOf('.') != -1) {   //number has decimal
    if (Num.indexOf('.') == Num.length-1) {  //number ends with a decimal point
      Num += "00";
    }
    if (Num.indexOf('.') == Num.length-2){ //number ends with a single digit
      Num += "0";
    }
    if (Num.indexOf('.') < Num.length-3){  //number has too many decimal values, therefore truncate
      Num = Num.substr(0,Num.indexOf('.')+3);
    }
    var a = Num.split("."); 
    Num = a[0]; //the part we will commify
    var end = a[1] //the decimal place we will ignore and add back later
  }
  else {var end = "00";} 
  //this loop actually adds the commas 
  for (var k = Num.length-1; k >= 0; k--) {
    var oneChar = Num.charAt(k);
    if (count == 3){
      newNum += ",";
      newNum += oneChar;
      count = 1;
      continue;
    }
    else {
      newNum += oneChar;
      count ++;
    }
  } //but now the string is reversed!
  //re-reverse the string
  for (var k = newNum.length-1; k >= 0; k--) {
    var oneChar = newNum.charAt(k);
    newNum2 += oneChar;
  }
  // add dollar sign and decimal ending from above
  newNum2 = newNum2 + "." + end;
  formObj.value = newNum2;
  }
}
/*faculty books list: function to hide and show layers*/
function toggleLayer(whichLayer)
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}