//Main js file for DSPv6

	//Flash vars
	var flashvars = {};
	flashvars.adminMode = "false";

	var params = {};
	params.quality = "high";
	params.scale = "noscale";
	params.wmode = "transparent";
	params.allowFullScreen = "true";
	params.allowscriptaccess = "always";

	params.menu = "false";
	params.play = "true";
	params.bgcolor = "000000";
	var attributes = {id:"dsp", name:"dsp"};

	//SWF object
	swfobject.embedSWF("_/swf/DSPv6About.swf", "aboutswf", "1020px", "750px", "10.0.0", "_/swf/expressInstall.swf", flashvars, params, attributes, soCallbackFn);
	
	
	function soCallbackFn(e){
		//alert("e.success = " + e.success +"\ne.id = "+ e.id +"\ne.ref = "+ e.ref);
		if(e.ref){ swfobject.createCSS("about", "min-height:750px;"); }
	}//ends soCallbackFn
	
	
	
	
	
	$(document).ready(function($) {
	
	
		//SET UP HELICOPTER VIEW
		$("#slider").easySlider({
				/* auto: true,  */
				/* continuous: true */
			});
			
		$("#helicopter").css('display', 'none');
			
		$("#slider ul li a").hover(
		
			function(){//MOUSE OVER
				$(this).addClass("active");
				
				$("#slider ul li a").each(function(i){
					if( ! $(this).hasClass("active") ){ $(this).stop().fadeTo(400, 0.33); }
				});
			},
			
			function(){//MOUSE OUT
				$(this).removeClass("active");
				$("#slider ul li a").each(function(i){
					$(this).stop().fadeTo(400, 1);
				});
			}
		);//ends hover
		
		var worklink = $("#topmenu li#worklink");
		worklink.addClass("jQuery");
		//worklink.append("<a href='#' id='helicopterlink'>Helicopter</a>");
		worklink.append("<div class='over'><a href='#works' id='worklink'>Work</a><a href='#' id='helicopterlink'>Helicopter</a></div>");
		
		$("#topmenu li a").click(function(){
			$("#helicopter").fadeOut();
		});
		
		$("#slider ul li a").click(function(){
			$("#helicopter").fadeOut();
		});
		
		
		worklink.find("#helicopterlink").click(function(){
			$("#helicopter").stop().fadeIn();
		});
		
		
	
		//Fade in menu
		$('#topmenu').hide().fadeIn(1000);
		$('#botmenu').hide().fadeIn(1000);
		
		 //Animated scrolling to same page links
	   	$(function(){
		    $('a[href*=#]').click(function() {
		    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
		        && location.hostname == this.hostname) {
		            var $target = $(this.hash);
		            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
		            if ($target.length) {
		                var targetOffset = $target.offset().top;
		                $('html,body').stop().animate({scrollTop: targetOffset}, 1400);
		                return false;
		            }
		        }
		    });
		});
		
		
	});
	
	



