$(document).ready(function(){
	$("h3").fadeTo(.95,".35");
	$("h5").fadeTo(.95,".3");
	$("#content img").fadeTo(1,"0");
	
	$("li").hover(function(){
		$(this).find("h3").fadeTo(300,"1");
		$(this).find("h5").fadeTo(300,"1");
		$(this).find("img").fadeTo(300,"1");
	}, function(){
		$(this).find("h3").fadeTo(300,".35");
		$(this).find("h5").fadeTo(300,".3");
		$(this).find("img").fadeTo(300,"0");
	})
	
	$("#content img").each(function(){
		var  imageURL = $(this).attr("src").replace("color", "bw");
		$(this).parent().css({'background-image':"url('"+imageURL+"')"});
	})
	
	var emailLink = $(".emailLink").attr("innerHTML");
	$(".emailLink").attr("innerHTML","<a href=\"mailto:"+emailLink+"\">"+emailLink+"</a>");
	
	$(".fancyImage").fancybox();
	
	$(".disclaimer").click(function(){
		if($(this).hasClass("activated")){
			$(this).removeClass("activated");
			$(".disclaimer_text").fadeOut(300);
		} else {
			$(this).addClass("activated");
			$(".disclaimer_text").fadeIn(300);
		}
	})
})

function setBackground(whatImageCurrent,whatCurrentZ){
	var theOrig = whatImageCurrent;
	var theZ = whatCurrentZ;
	theZ = whatCurrentZ - 1;
	var theCurrent = theOrig+1;
	if(theCurrent>3){theCurrent=1;}
	
	$("#bg"+theCurrent).css({'z-index':theZ});
	$("#bg"+theCurrent).show();
	$("#bg"+theOrig).fadeOut(1000);
	
	setTimeout("setBackground("+theCurrent+","+theZ+");",10000);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function noSpam(user,domain) {
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}
