function onloadBody (body) {
  if( getCookieData("style") != "") {
	document.getElementById("styleSelect").value = getCookieData("style");
  }
  //window.document.getElementById("searchbox").focus();
}

function hideads() {
   copy = '';
   document.getElementById('adsRight').innerHTML=copy;
   document.getElementById('adsBottom').innerHTML=copy;
   document.getElementById('adsTop').innerHTML=copy;
}

		
function styleChanged(widget) {
   document.cookie = "style" + "=" + widget.value +
   ";path=/;domain=.fincher.org"+getExpirationString();
   document.getElementById("csslink").href= "http://www.fincher.org/style/"+getCookieData("style");
   window.location.reload(true);
   //location.href="";
}

function getCookieData(labelName) {
        var labelLen = labelName.length;
        // read cookie property only once for speed
        var cookieData = document.cookie;
        var cLen = cookieData.length;
        var i = 0;
        var cEnd;
        while (i < cLen) {
                var j = i + labelLen;
                if (cookieData.substring(i,j) == labelName) {
                        cEnd = cookieData.indexOf(";",j);
                        if (cEnd == -1) {
                                cEnd = cookieData.length;
                        }
                        return unescape(cookieData.substring(j+1, cEnd));
                }
                i++;
        }
        return "";
}


//return a string like "; expires=Thu, 5 Jan 2006 16:07:52 UTC"
function getExpirationString() {
  var exp = new Date();
  var threemonths = exp.getTime()+(120*24*60*60*1000);
  exp.setTime(threemonths);
  return "; expires="+exp.toGMTString();
}

function startList() {
        if ((navigator.userAgent.indexOf("IE")!=-1)) {
	var nodes = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<nodes.length; i++) {
		nodes[i].onmouseover = function() {
			this.className += " over";
		}
		nodes[i].onmouseout = function() {
			this.className = this.className.replace(new RegExp(" over\\b"), "");
		}
	}
        }
}

