var flashes=["home","project","gallery","partners","testimonials","contact"];

$(document).ready(function() {
	$('ul#navigation').localScroll({
		axis: 'xy',
		onBefore: function() {
			$('ul#navigation a').each(function(i) {$(this).removeClass('hover')});
			$(this).addClass('hover');
			return true;
		},
		onAfter: function(el) {
			if(navigator.appName.indexOf("Microsoft")!=-1){
				window[el.id+"_flash"].Play()
			}else{
				document[el.id+"_flash"].Play()
			}
		}
	});
	initFlashes();
	$("div#ICameToPlayGallery").slideView();
	$('#testimonials .content_middle').equalHeights();
	$('#partners .content_middle').equalHeights();
});

function initFlashes(){
	$(flashes).each(function(i){
		A=this.toString();
		div=document.createElement("div");
		div.setAttribute("id",A+"_bg");
		div.setAttribute("class","contentholder");
		div.setAttribute("className","contentholder");
		document.body.appendChild(div);
		so=new SWFObject("/flash/"+A+".swf",A+"_flash",1600,800,8,"#ffffff");
		so.addParam("wmode","transparent");
		so.write(A+"_bg")
	})
}

(function ($) {
$.fn.equalHeights = function(px) {
	$(this).each(function(){
		var currentTallest = 0;
		$(this).children().each(function(i){
			if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
		});
		if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
		$(this).children().css({'min-height': currentTallest}); 
	});
	$('.clear').css({'min-height': '1px','height': '1px'});
	return this;
};
})(jQuery);
