/*
Site-wide JS
*/

$(document).ready(function(){
	// Enable drop-down twoLevel menu.
	$("#header #menu ul li a").hover(
		function(){$(this).addClass("hover");},
		function(){$(this).removeClass("hover");}
	)
	$(".project_thumb").hover(function(){$(this).addClass('hover')}, function(){$(this).removeClass('hover')}).click(function(){
		window.location = $(this).parent().attr("href");
		// console.log($(this).parent().attr("href"), $(this));
		return false;
	});
	var counter = 0;
	$(".employee_picture").each(function(){
		var img_base = $(this).attr('src').substring(0, $(this).attr('src').length-4).split('/');
		img_base = img_base[img_base.length-1];
		$(this).wrap("<div class='employee_video_wrapper'></div>").before("<div class='employee_video_container'><div id='employee_video_"+img_base+"_"+counter+"'></div></div>");
		var flashvars = {video_location:img_base};
		swfobject.embedSWF("/media/swf/employee_player.swf", 'employee_video_'+img_base+"_"+counter, "175", "131", "10", "/media/swf/expressInstall.swf", flashvars, {wmode:"transparent", quality: "high", allowscriptaccess: "sameDomain", allowfullscreen: "false"}, false);
		counter++;
	})
});
var setLocation = function(loc_object){
	window.location.hash = "#"+$.param(loc_object);
};