$(document).ready(function(){

	$("img.png24").pngfix();

	if($("#team").length) $("#team .profile-desc").hide();

	var ww1 = $(window).width();
	var prime_container_width = 0;

	if(ww1 > 1280) { prime_container_width = 1280; } else if(ww1 < 960) { prime_container_width = 960; } else { prime_container_width = ww1; }
	$("#container").css('width', prime_container_width+'px');

	//$(window).bind('resize', function() {});

	start();

	if($("#team").length) {

		last_fragment = false;

		$("#team > ul").append("<p class=\"inst\">Hover over our pictures to read our profiles</p>");
		
		$("#team > ul li").hover(function(){
			if(last_fragment) $(last_fragment).hide();
			$("#team .inst").hide();
			var fragment = $("a", this).attr("href");
			$(fragment).show();
			last_fragment = fragment;
		},function(){
			return false;
		});

		$("#team > ul li a").click(function(){ return false; });

	}

	$("#navbar .dropdown > li").hover(function(){
		$("> a", this).addClass("open");
		$(".sub", this).show();
	},function(){
		$("> a", this).removeClass("open");
		$(".sub", this).hide();
	});

});

function start() {

	slider = false;
	ww = $(window).width();
	cw = $("#container").width();

	if(slider === false && ww != cw) {

		if(ww > 1280 && cw != 1280) {
			slider = true;
			$("#container").animate({ width: "1280px" },{ duration: 250, easing: "linear" }); 
		} else if(ww < 960 && cw != 960) {
			slider = true;
			$("#container").animate({ width: "960px" },{ duration: 250, easing: "linear" });
		} else if(ww > 960 && ww < 1280) {
			slider = true;
			$("#container").animate({ width: ww+"px" },{ duration: 250, easing: "linear" });
		}

	}

	timeout = setTimeout("start()",300);

}
