// JavaScript Document

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}

function swap_img(elem_name, img_name) {
	if (document.images) {
			document.images[elem_name].src = img_name;}
}

/*function openWin(url) {
//var w_left = Math.abs(screen.width/2-300);
var w_left = Math.abs((screen.width*.5)-325);

var openWin = window.open(url,"notepad_win","left='+w_left+',top=60,scrollbars=no,menubar=no,height=400,width=510,resizable=yes,toolbar=no,location=no,status=no");
openWin.focus();
}
*/

function raw_popup(url, target, features) {
//var w_left = Math.abs((screen.width*.5)-0);
//var _POPUP_FEATURES = "left='+w_left+',top=60,location=0,statusbar=0,menubar=0,width=510,height=400";
var _POPUP_FEATURES = "left=180,top=60,location=0,statusbar=0,menubar=0,width=510,height=390";
    // pops up a window containing url optionally named target, optionally having features
    if (isUndefined(features)) features = _POPUP_FEATURES;
    if (isUndefined(target  )) target   = '_blank';
    var theWindow = window.open(url, target, features);
    theWindow.focus();
    return theWindow;
}

function link_popup(src, features) {
    // to be used in an html event handler as in: <a href="..." onclick="link_popup(this,...)" ...
    // pops up a window grabbing the url from the event source's href
    return raw_popup(src.getAttribute('href'), src.getAttribute('target') || '_blank', features);
}

function isUndefined(v) {
    var undef;
    return v===undef;
}