/* GENERAL FUNCTIONS
-----------------------------------------------------*/
function animateMenu() {
	if($.browser.msie && jQuery.browser.version.substr(0,1) == '6') return;
	$('#head li').not("li[@id=badge]").find("a").css({backgroundPosition: '0px -48px'}).hover(function() {
		$(this).animate({ backgroundPosition: '(0px 1px)' }, { duration:300, queue:false });
	}, function() {
		$(this).animate({ backgroundPosition: '(0px -48px)' }, { duration:300, queue:false });										
	});
	$('#nav li').css({backgroundPosition: '0px -46px'}).hover(function() {
		$(this).animate({ backgroundPosition: '(0px 0px)' }, { duration:300, queue:false });
	}, function() {
		$(this).animate({ backgroundPosition: '(0px -46px)' }, { duration:300, queue:false });										
	});
}

function autoPopulate(id) {
	$('#'+id).each(function() {
		if ((this.value == '') && (this.title != '')) { this.value = this.title; }
		$(this).focus(function() { if (this.value == this.title) { this.value = ''; this.select(); } });
		$(this).blur(function() { if (!this.value.length) { this.value = this.title; } });
	});
}

$(document).ready(function() {
	$("tbody tr").filter("tr:odd").addClass("odd").end().filter("tr:even").addClass("even"); 				// TABLE STRIPING	
	$("a[@href^='http://'],a[@href$='.doc'],a[@href$='.pdf'],a[@href$='.jpg']").attr("target", "_blank");	// EXTERNAL LINKS IN NEW WINDOW
	animateMenu();
	autoPopulate('email-subscribe');
});
