/* jQuery Setup */
// Preload Images first on window.load
$(window).bind('load', function(){
	var cache = [];
	$("img").each(function(){
		var cacheImage = document.createElement('img');
		cacheImage.src = $(this).attr("src");
		cache.push(cacheImage)
	});
});
$(document).ready(function(){
	$(".partner-logo img").hover(function(){
		$(this).fadeTo(400, 0.0);
	},function(){
		$(this).fadeTo(300, 1.0);
	});
	$(".project-img img").hover(function(){
		$(this).fadeTo(400, 0.1);
	},function(){
		$(this).fadeTo(300, 1.0);
	});
	$(".hover").hover(function(){
		$(this).fadeTo(300, 0.5);
	},function(){
		$(this).fadeTo(100, 1.0);
	});
	$("img.projectpic").hover(function(){
		$(this).fadeTo(300, 0.6);
	},function(){
		$(this).fadeTo(100, 1.0);
	});
	$("img.projectpic").click(function(){
		var hoverimg = $(this).attr("src");
		var origimg = $("img#projectpic").attr("src");
		$(this).fadeTo(200, 0.0, function(){
			$(this).delay(100).attr("src",origimg);
			$(this).fadeTo(200, 1.0);
		});
		$("img#projectpic").fadeTo(200, 0.0, function(){
			$("img#projectpic").delay(100).attr("src",hoverimg);
			$("img#projectpic").fadeTo(200, 1.0);
		});
		$.scrollTo("#wrapper",200);
	});
	$("img.social[longdesc]").hoverswap();
	if(typeof document.body.style.maxHeight === "undefined") {
		// IE6 a/k/a don't do it !!
	} else {
		$('#news-carousel').jcarousel({
			auto:10,
			scroll:1,
			wrap:'circular'
		});
	}
	$(".hide-n-seek").fadeIn(1000);
	$(".lazy").lazyload({ 
		placeholder : "_img/filler.gif",
		effect : "fadeIn",
		effectspeed: 1000
	});
});

