sfHover = function() {
	if(!document.getElementsByTagName) return false;
	var sfEls = document.getElementById("nav").getElementsByTagName("li");
	var sfEls1 = document.getElementById("subnav").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"), "");
		}
	}
	for(var i=0; i < sfEls1.length; i++) {
		sfEls1[i].onmouseover=function() {
			this.className+=" sfhover1";
		}
		sfEls1[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover1\\b"), "");
		}
	}
}

if(window.attachEvent) window.attachEvent("onload", sfHover);

try {
 document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

function showdiv(id, action, color, bg) {
	if(action == 'block') {
		document.getElementById(color+id).style.background = "url(/forgranted/wp-content/themes/default/images/gradients/bg_"+color+".gif) repeat-x left -74px";
	} else {
		document.getElementById(color+id).style.background = bg;
	}
}

function change_img(num, color, bg) {
	if(num == 1) {
		showdiv("-1-focus", "block", color, bg);
		showdiv("-2-focus", "none", color, bg);
		showdiv("-3-focus", "none", color, bg);
	} else if(num == 2) {
		showdiv("-1-focus", "none", color, bg);
		showdiv("-2-focus", "block", color, bg);
		showdiv("-3-focus", "none", color, bg);
	} else if(num == 3) {
		showdiv("-1-focus", "none", color, bg);
		showdiv("-2-focus", "none", color, bg);
		showdiv("-3-focus", "block", color, bg);
	}
}

function feed_change(box) {
	var feed_type = box.value;
	document.getElementById('feed_type').innerHTML = '<input type="hidden" name="url" value="http://feeds.feedburner.com/~e?ffid='+feed_type+'" />';
}

function checksub(form) {
	if(document.signup.email.value.indexOf('@', 0) == -1) {
		alert("Your email must be in the format: email@address.com");
		document.signup.email.focus();
		return false;
	}
	return true;
}