// onFocus/onBlur for search form

function alterNate(elm){
	if (!elm.base) elm.base = elm.value
	if (elm.value == elm.base) elm.value = "";
	else if (elm.value == "") elm.value = elm.base;
}

// standards compliant external windows
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";
 }
}

// dropdown menu function to enable it in IE6
sfHover = function() {
	var sfEls = document.getElementById("nav").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);

// image randomizer
var Quotation=new Array()
Quotation[0] = "<img src=\"images/header-giraffe.jpg\" width=\"752\" height=\"174\">";
Quotation[1] = "<img src=\"images/header-orangutang.jpg\" width=\"752\" height=\"174\">";
Quotation[2] = "<img src=\"images/header-rhino.jpg\" width=\"752\" height=\"174\">";
Quotation[3] = "<img src=\"images/header-elephant.jpg\" width=\"752\" height=\"174\">";
 
var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}
