
	$(document).ready(function(){
	
		/* Rollover menu images */
		$(".menu").hover (
			function () {
				var imgSrc = $(this).attr("src");
				imgSrc = imgSrc.replace("off", "hover");
				$(this).attr("src", imgSrc);
			},
			function () {
				var imgSrc = $(this).attr("src");
				imgSrc = imgSrc.replace("hover", "off");
				$(this).attr("src", imgSrc);
		});
		
		/* Down-click menu images */
		$(".menu").mousedown (
			function () {
				var imgSrc = $(this).attr("src");
				imgSrc = imgSrc.replace("hover", "active");
				$(this).attr("src", imgSrc);
		});
		$(".menu").mouseup (
			function () {
				var imgSrc = $(this).attr("src");
				imgSrc = imgSrc.replace("active", "off");
				$(this).attr("src", imgSrc);
		});
		
		/*
		
			ANCHORS
			
		*/
				
		/* Get rid of ugly dotted lines around links
		   Thanks to Boris Crismancich: http://www.crismancich.de/
		*/
		$("a").bind("focus",function(){if(this.blur)this.blur();}).css("outline", "none");


		/* Highlight form inputs */
		$("fieldset input, fieldset textarea").focus( function() {
			if ($(this).hasClass("required")) {
				$(this).css("border-top", "1px solid #FFCC00");
				$(this).css("border-right", "1px solid #FFCC00");
				$(this).css("border-bottom", "1px solid #FFCC00");
			} else {
				$(this).css("border", "1px solid #FFCC00");
			}
		});
		$("fieldset input, fieldset textarea").blur( function() {
			if ($(this).hasClass("required")) {
				$(this).css("border-top", "1px solid #ccc");
				$(this).css("border-right", "1px solid #ccc");
				$(this).css("border-bottom", "1px solid #ccc");
			} else {
				$(this).css("border", "1px solid #ccc");
			}
		});
		
		/* Panel tabs */
		$("#panel").tabs({
			/*fx: {
				opacity: 'toggle',
				duration: 'fast'
			},*/
			select: function(e, ui) {
				// Make selected tab current
				$("#panel ul li:eq(" + ui.index + ")").css("background-color", "#fff");
				$("#panel ul li:not(:eq(" + ui.index + "))").css("background-color", "#f6f6f6");
			}
		});
		
		$("#panel ul li a").click( function() {
			this.blur();
			return false;
		}).mousedown( function() {
			this.blur();
			return false;
		});

	});
