// JavaScript Document
/* IE 7 Drop Menu Fix */
<!--//--><![CDATA[//><!--
sfHover = function() {
	//Navigation Drop Menu
	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"), "");
		}
	}
	//Catalog Viewer and other table cells
	var sfElTDs = document.getElementById("listcategories").getElementsByTagName("td");
	for (var j=0; j<sfElTDs.length; j++) {
		sfElTDs[j].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfElTDs[j].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>
//This will remove the start value when the user clicks into the textbox
function onFocusDeleteText(control)
{
	if(control.value != "" && control.value == control.getAttribute("startvalue")) {
		control.value = "";
		if (has(control,"dataclass")){
			if (control.className)
				control.className = control.getAttribute("dataclass");
			else
				control.setAttribute("class", control.getAttribute("dataclass"));
		}
	}	
}
//This will set it back to the start value, if the person didn't enter any data (happens when user leaves textbox)
function onBlurTextReplace(control)
{
	if(control.value == "") {
		control.value = control.getAttribute("startvalue");
		if (has(control,"emptyclass")){
			if (control.className)
				control.className = control.getAttribute("emptyclass");
			else
				control.setAttribute("class", control.getAttribute("emptyclass"));
		}
	}
}
//Firefox vs. IE --> checking to see if you actually want there to be styles.
function has(control,child){
  return ((control.hasAttribute && control.hasAttribute(child) ) || control.getAttribute(child));
}
//--
/*-- Tell a Friend --*/
function refafriend(curpage) {
	var returnpage=curpage;
	var loc="http://www.andersonsawards.com/tellafriend.cfm?page="+returnpage;
	window.location=loc;
}
/* Client-side access to querystring name=value pairs
	Version 1.2.4
	30 March 2008
	Adam Vandenberg
*/
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = {};
	this.get=Querystring_get;
	
	if (qs == null);
		qs=location.search.substring(1,location.search.length);

	if (qs.length == 0) 
		return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var pair = args[i].split('=');
		var name = unescape(pair[0]);
		
		var value = (pair.length==2)
			? unescape(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

function Querystring_get(key, default_) {
	var value=this.params[key];
	return (value!=null) ? value : default_;
}