
var sstatus='unset';
var defsclass='nsbox';

function sbox(eid,newclass,other) {

	var element = document.getElementById(eid);
	if(otherone)
		var otherone = document.getElementById(other);

	if(sstatus == eid) {
// must be the same option so toggle it off
// clear both menus if either is already set
            element.className=defsclass;
			if(otherone)
				otherone.className=defsclass; 
			sstatus='unset';
	}
	else {
		if (status != 'unset' ) {
// must be a different option clear and then set it
// clear both menus if either is already set
			element.className=defsclass; 
			if(otherone)
	    		otherone.className=defsclass;
				sstatus=eid;
				element.className=newclass;
			}
        	else 
// must be just turning an option on
        	{
        	    sstatus=eid;
        	    element.className=newclass;
        	}
	}
}   

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

window.onload = externalLinks;

function PopIt(filename, orgname, h, w, dlg, s, r, y, x)
{
    if(dlg=="") dlg="pop" +orgname;
    if(!s) s="yes";
    if(!r) r="auto";
    if(!y) o=",top=52,left=5";
    if(y) o=",top="+y+",left="+x;
    popup = window.open(filename,dlg,"height="+h+",width="+w+",scrollbars="+s+",resizable="+r+o);
    popup.opener.name = orgname;
}
