(function($) {
	$.fn.focusBlur = function(textVal) {
		
		return this.each(function(i, ele) {
			$(ele).focus(function() {
				if(this.value == textVal) {
					this.value = "";
				}
			});
			$(ele).blur(function() {
				if(this.value == "") {
					this.value = textVal;
				}
			});
		});
	};
})(jQuery);

$(document).ready(function() {
	$('.user_input', '#subscribe').focusBlur('Enter email for newsletter');
	
	$('#get_approved_form').validate({
		rules: {
			first_name: 'required',
			last_name: 'required',
			email: {
				required: true,
				email: true
			},
			phone: 'required',
			affiliation: 'required'
		},
		errorPlacement: function(error, element) { } //don't show error labels
	});
	
	if ($.browser.msie && parseInt($.browser.version, 10) == 6) {
		$('li', "#header").hover(function() {
			if(this.className != "on") {
				this.className = "hover";
			}
		}, function() {
			if(this.className != "on") {
				this.className = "";
			}
		});
	}
});
