$(document).ready(function() {
	//alert(window.location);
	$("#profLogin").click(function () {
		if ($("#profLoginArea").css("display") == "none") {
			$("#profLoginArea").slideDown("slow");
			$("#user_id").focus();
		} else {
			$("#profLoginArea").slideUp("slow");
		}
	});
	$("a.advancedSearch").click(function () {
		if ($("#advancedSearch").css("display") == "none") {
			$("#advancedSearch").slideDown("slow");
		} else {
			$("#advancedSearch").slideUp("slow");
		}
	});	
	// Jquery tools - tooltip
	$("ul.topNav a[title]").tooltip({
		position: "bottom center",
		effect: "fade",
		offset: [0, 0],
		delay: 0,
		predelay: 0
	});
	
	$("ul.modalities input").change(function() {
		if ($(this).attr("id") == "techniqueAny") {
			if ($(this).is(":checked")) {
				$("ul.modalities input").attr("checked","");
				$(this).attr("checked","checked");
			}
		} else {
			$("#techniqueAny").attr("checked","");
		}
	});
	$("form.search .searchTerm").focus(function () {
		//if ($(this).val() == default_search_text) {
			$(this).val("");
		//}
	});
	$("#nl_signup_email").focus(function () {
		if ($(this).val() == "Enter email address") {
			$(this).val("");
			var fx_options = {};
			if (!$("#newsletter_signup fieldset.captcha").is(":visible")) {
				$("#newsletter_signup fieldset.captcha").show('blind',fx_options,1000);
			}
		}
	});
	
	$("#prof_signup_email").focus(function () {
		if ($(this).val() == "Enter email address") {
			$(this).val("");
			var fx_options = {};
			if (!$("#prof_signup fieldset.captcha").is(":visible")) {
				$("#prof_signup fieldset.captcha").show('blind',fx_options,1000);
			}
		}
	});
});
