var hoverColour = "#af662f";
$(function(){
	$("div.hoverBtn").show("fast", function() {
		$(this).append("<div></div>");
		$(this).children("a").hover(function(){
			if ($(this).attr("rel") == "") {
				$(this).attr("rel", $(this).css("color"));
			}
			$(this).parent().children("div")
				.stop()
				.css({"display": "none", "opacity": "1"})
				.fadeIn("fast");
			$(this)	.stop()
				.css({"color": $(this).attr("rel")})
				.animate({"color": hoverColour}, 350);
		},function(){
			$(this).parent().children("div")
				.stop()
				.fadeOut("slow");
			$(this)	.stop()
				.animate({"color": $(this).attr("rel")}, 250);
		});
	});
});


$(document).ready(function(){
	var height = $(document).height();
	var divHeight = $('div#vcentered').height();
	
	$('div#vcentered').css({'position':'relative','top': height/2 - divHeight/2 });
	
	$("#menu div a").click(function(){
		$clicked = $(this);
		
		var idToLoad = $clicked.attr("id").split('-');
		$("#content_inside").find("div:visible").fadeOut("slow", function(){
			$("#"+idToLoad[0]).fadeIn();
		})

		$clicked.siblings("#menu div a").animate({
			opacity: 1
		}, 600 );

	});
	
});


ieFocus = function() {
	var sfEls = document.getElementsByTagName("INPUT");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" iefocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" iefocus\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", ieFocus);
