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 chg1(){ document.getElementById('tree1').className = "over"; }
function chg2(){ document.getElementById('tree2').className = "over"; }
function chg7(){ document.getElementById('tree7').className = "over"; }
function chg8(){ document.getElementById('tree8').className = "over"; }

function chgback(){
	document.getElementById('tree1').className = "active";
	document.getElementById('tree2').className = "active";
	document.getElementById('tree7').className = "active";
	document.getElementById('tree8').className = "active";
}

function chgST() {
	if (document.getElementById('intl').className == "shown"){
		document.getElementById('intl').className = "none"
		document.getElementById('ST').className = "shown"
	} else if (document.getElementById('ST').className == "shown"){
		document.getElementById('ST').className = "none"
		document.getElementById('intl').className = "shown"
	}
}

function chgCP() {
	if (document.getElementById('optional').className == "postshown"){
		document.getElementById('optional').className = "posthidden"
		document.getElementById('a5').className = "postshown"
	} else if (document.getElementById('a5').className == "postshown"){
		document.getElementById('a5').className = "posthidden"
		document.getElementById('optional').className = "postshown"
	}
}

function expandmsg (postid) { 
  whichpost = document.getElementById(postid); 
   if (whichpost.className=="postshown") { 
      whichpost.className="posthidden"; 
  } 
   else { 
      whichpost.className="postshown"; 
   } 
} 

function collapse(){
	document.getElementById('a4').className = "posthidden";
}

function rcHover(){ document.getElementById('rcHover').className = "rchover"; }
function rcOut(){ document.getElementById('rcHover').className = "rclink"; }

function hov1(){ document.getElementById('nnnhover').className = "sw1"; }
function hov2(){ document.getElementById('nnnhover').className = "sw2"; }
function hov3(){ document.getElementById('nnnhover').className = "sw3"; }
function hov0(){ document.getElementById('nnnhover').className = "sw0"; }

function hov4(){ document.getElementById('hovmain').className = "sw4"; }
function hov5(){ document.getElementById('hovmain').className = "sw5"; }
function hov6(){ document.getElementById('hovmain').className = "sw6"; }
function hov7(){ document.getElementById('hovmain').className = "sw7"; }
function hov8(){ document.getElementById('hovmain').className = "sw8"; }
function hov9(){ document.getElementById('hovmain').className = "sw9"; }
function hovx(){ document.getElementById('hovmain').className = "swx"; }

function expandcollapse (postid) { 
   whichpost = document.getElementById(postid); 
   if (whichpost.className=="postshown") { 
      whichpost.className="posthidden"; 
   } 
   else { 
      whichpost.className="postshown"; 
   } 
} 

function expandul (postid) { 
   whichpost = document.getElementById(postid); 
   if (whichpost.className=="list") { 
      whichpost.className="lost"; 
   } 
   else { 
      whichpost.className="list"; 
   } 
} 


sfHover = function() {
	var sfEls = document.getElementById("header").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
/* if (window.attachEvent) window.attachEvent("onload", sfHover); */

/*****************************************************
* subNav
* 3/04/2001
* --youngpup--
*****************************************************/
subNav.Registry = []
subNav.aniLen = 250
subNav.hideDelay = 1000
subNav.minCPUResolution = 10
// constructor
function subNav(id, dir, left, top, width, height)
{
this.ie = document.all ? 1 : 0
this.ns4 = document.layers ? 1 : 0
this.dom = document.getElementById ? 1 : 0
if (this.ie || this.ns4 || this.dom) {
this.id = id
this.dir = dir
this.orientation = dir == "left" || dir == "right" ? "h" : "v"
this.dirType = dir == "right" || dir == "down" ? "-" : "+"
this.dim = this.orientation == "h" ? width : height
this.hideTimer = false
this.aniTimer = false
this.open = false
this.over = false
this.startTime = 0
this.gRef = "subNav_"+id
eval(this.gRef+"=this")
subNav.Registry[id] = this
var d = document
var strCSS = "";
strCSS += '#' + this.id + 'Container { visibility:hidden; '
strCSS += 'left:' + left + 'px; '
strCSS += 'top:' + top + 'px; '
strCSS += 'overflow:hidden; z-index:10000; }'
strCSS += '#' + this.id + 'Container, #' + this.id + 'Content { position:absolute; '
strCSS += 'width:' + width + 'px; '
strCSS += 'height:' + height + 'px; '
strCSS += 'clip:rect(0 ' + width + ' ' + height + ' 0); '
strCSS += '}'
this.css = strCSS;
this.load()
}
}
subNav.writeCSS = function() {
document.writeln('<style type="text/css">');
for (var id in subNav.Registry) {
document.writeln(subNav.Registry[id].css);
}
document.writeln('</style>');
}
subNav.prototype.load = function() {
var d = document
var lyrId1 = this.id + "Container"
var lyrId2 = this.id + "Content"
var obj1 = this.dom ? d.getElementById(lyrId1) : this.ie ? d.all[lyrId1] : d.layers[lyrId1]
if (obj1) var obj2 = this.ns4 ? obj1.layers[lyrId2] : this.ie ? d.all[lyrId2] : d.getElementById(lyrId2)
var temp
if (!obj1 || !obj2) window.setTimeout(this.gRef + ".load()", 100)
else {
this.container = obj1
this.menu = obj2
this.style = this.ns4 ? this.menu : this.menu.style
this.homePos = eval("0" + this.dirType + this.dim)
this.outPos = 0
this.accelConst = (this.outPos - this.homePos) / subNav.aniLen / subNav.aniLen 
// set event handlers.
if (this.ns4) this.menu.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
this.menu.onmouseover = new Function("subNav.showMenu('" + this.id + "')")
this.menu.onmouseout = new Function("subNav.hideMenu('" + this.id + "')")
//set initial state
this.endSlide()
}
}
subNav.showMenu = function(id)
{
var reg = subNav.Registry
var obj = subNav.Registry[id]
if (obj.container) {
obj.over = true
for (menu in reg) if (id != menu) subNav.hide(menu)
if (obj.hideTimer) { reg[id].hideTimer = window.clearTimeout(reg[id].hideTimer) }
if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
}
}
subNav.hideMenu = function(id)
{
var obj = subNav.Registry[id]
if (obj.container) {
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = window.setTimeout("subNav.hide('" + id + "')", subNav.hideDelay);
}
}
subNav.hideAll = function()
{
var reg = subNav.Registry
for (menu in reg) {
subNav.hide(menu);
if (menu.hideTimer) window.clearTimeout(menu.hideTimer);
}
}
subNav.hide = function(id)
{
var obj = subNav.Registry[id]
obj.over = false
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer = 0
if (obj.open && !obj.aniTimer) obj.startSlide(false)
}
subNav.prototype.startSlide = function(open) {
this[open ? "onactivate" : "ondeactivate"]()
this.open = open
if (open) this.setVisibility(true)
this.startTime = (new Date()).getTime() 
this.aniTimer = window.setInterval(this.gRef + ".slide()", subNav.minCPUResolution)
}
subNav.prototype.slide = function() {
var elapsed = (new Date()).getTime() - this.startTime
if (elapsed > subNav.aniLen) this.endSlide()
else {
var d = Math.round(Math.pow(subNav.aniLen-elapsed, 2) * this.accelConst)
if (this.open && this.dirType == "-") d = -d
else if (this.open && this.dirType == "+") d = -d
else if (!this.open && this.dirType == "-") d = -this.dim + d
else d = this.dim + d
this.moveTo(d)
}
}
subNav.prototype.endSlide = function() {
this.aniTimer = window.clearTimeout(this.aniTimer)
this.moveTo(this.open ? this.outPos : this.homePos)
if (!this.open) this.setVisibility(false)
if ((this.open && !this.over) || (!this.open && this.over)) {
this.startSlide(this.over)
}
}
subNav.prototype.setVisibility = function(bShow) { 
var s = this.ns4 ? this.container : this.container.style
s.visibility = bShow ? "visible" : "hidden"
}
subNav.prototype.moveTo = function(p) { 
this.style[this.orientation == "h" ? "left" : "top"] = this.ns4 ? p : p + "px"
}
subNav.prototype.getPos = function(c) {
return parseInt(this.style[c])
}
subNav.prototype.onactivate = function() { }
subNav.prototype.ondeactivate = function() { }
