
var designresources={

addEvent:function(target, functionref, tasktype){
	if (target.addEventListener)
		target.addEventListener(tasktype, functionref, false);
	else if (target.attachEvent)
		target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
},

init:function(){
	var searchbox=document.getElementById("keywords")
	searchbox.onfocus=function(){
		if (this.value=="Search Resources")
			this.value=""
		else
			this.select()
	}
	var menulinks=document.getElementById("resourcesmenu").getElementsByTagName("a")
	var categoryparam=window.location.href.match(/\/(C\d+)($|\/)/)
	categoryparam=RegExp.$1
	for (var i=0; i<menulinks.length, categoryparam!=""; i++){
		if (menulinks[i].href.lastIndexOf(categoryparam)!=-1){
			menulinks[i].style.background="silver"
			menulinks[i].style.color="black"
			return
		}
	}
}

}

designresources.addEvent(window, function(){designresources.init()}, "load")