
d = new Date();
year = d.getFullYear();

function clearCurrentLink(){
    var a = document.getElementsByTagName("A");
    for(var i=0;i<a.length;i++)
        if(a[i].href == window.location.href.split("#")[0])
            a[i].className = "on"; //removeNode(a[i]);
}

function removeNode(n){
    if(n.hasChildNodes())
        for(var i=0;i<n.childNodes.length;i++)
            n.parentNode.insertBefore(n.childNodes[i].cloneNode(true),n);
    n.parentNode.removeChild(n);
}

function textField() {
	if (document.getElementsByTagName) {
		var inputs = document.getElementsByTagName("INPUT");
		for(i=0;i<inputs.length;i++) {
			if (inputs[i].getAttribute("type") == "text") {
				inputs[i].onfocus = function(){ this.className = 'on'; }
				inputs[i].onblur = function(){ this.className = 'off'; }
			}
		}
		var textareas = document.getElementsByTagName("TEXTAREA");
		for(i=0;i<textareas.length;i++) {
			textareas[i].onfocus = function(){ this.className = 'on'; }
			textareas[i].onblur = function(){ this.className = 'off'; }
		}
		var selects = document.getElementsByTagName("SELECT");
		for(i=0;i<selects.length;i++) {
			selects[i].onfocus = function(){ this.className = 'on'; }
			selects[i].onblur = function(){ this.className = 'off'; }
		}
	}
}

function checkSearch(obj) {
	if (obj.bizsearch.value == "") {
		alert("You must enter a search keyword.");
		return false;
	}
}

window.onload = function() {
	clearCurrentLink();
	textField();
	if (document.getElementById("homeimg")) {
		if (ie4||dom) {
			startit();
		} else {
			setInterval("rotateimage()",pause);
		}
	}
}

sfHover = function() {
	var sfEls = document.getElementById("navlinks").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);


/*******
SIMPLE WINDOW POPPER
*******/
function newWin(url,w,h,s) {
	var aw = window.screen.availWidth;
	var ah = window.screen.availHeight;
	if (!w) { w = "550" }
	if (!h) { h = "550" }
	if (!s) { s = "no" }
	var awpos = (aw / 2) - (w / 2); 
	var ahpos = (ah / 2) - (h / 2);
	var features = "toolbar=no,location=no,status=no,menubar=no,resizable=no";
	features += ",width=" + w + ",left=" + awpos;
	features += ",height=" + h + ",top=" + ahpos;
	features += ",scrollbars="+s;
	winOpen = window.open(url,'newWin',features);
}
