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;

/* Rollover Images */
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_n."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_n.", "_r."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_r.", "_n."));
				}
			}
			else if(images[i].getAttribute("src").match("_s."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_s.", "_r."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_r.", "_s."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
	window.addEventListener("load", smartRollover2, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
	window.attachEvent("onload", smartRollover2);
}

function showTips(nm){
  var style=document.getElementById?
              document.getElementById(nm).style:(
                document.all?document.all(nm).style:(
                  document.layers?document.layers[nm]:null
                  )
              );
  if(style) style.visibility='inherit';
}
function hideTips(nm){
  var style=document.getElementById?
              document.getElementById(nm).style:(
                document.all?document.all(nm).style:(
                  document.layers?document.layers[nm]:null
                  )
              );
  if(style) style.visibility='hidden';
}

function Input(areaname,checkvalue,formname){
	if(document.forms[formname].elements[areaname].value == checkvalue){
		document.forms[formname].elements[areaname].value = "";
	}
}
function Output(areaname,checkvalue,formname){
	if(document.forms[formname].elements[areaname].value == ""){
		document.forms[formname].elements[areaname].value = checkvalue;
	}
}


/* Rollover Images */
function smartRollover2() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("input");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("type").match("image")) {
				if(images[i].getAttribute("src").match("_n."))
				{
					images[i].onmouseover = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_n.", "_r."));
					}
					images[i].onmouseout = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_r.", "_n."));
					}
				}
				else if(images[i].getAttribute("src").match("_s."))
				{
					images[i].onmouseover = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_s.", "_r."));
					}
					images[i].onmouseout = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_r.", "_s."));
					}
				}
			}
		}
	}
}
