
// Home page rotation
$(document).ready(function(){
    $('#rotation').cycle({
        fx: 'fade',
        speed: 1000, 
        timeout: 4000
    });
});

// Open external links in new window
// - 9/12/08 added pdfs as well
$(document).ready(function() {
	$("a[@href^=http]").each(function() {
		if(this.href.indexOf(location.hostname.replace(/www./gi, "")) == -1) {
			$(this).click(function() { window.open(this.href, "_blank"); return false; });
		}
	});
	$("a[href*=.pdf]").click(function() { window.open(this.href, "_blank"); return false; });
});

// Add form validation
$(document).ready(function() {
	if(! $('.vform').length) return false;
	$('.vform').validate();
});

// Suckerfish for poor IE < 7
sfHover = function() {
	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"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
