// swf object

var flashvars = {
	file:"http://"
};	
var params = {
	wmode:"transparent"
};
//swfobject.embedSWF("swf/home.swf", "content_flash", "901", "365", "9.0.0", "extensions/expressInstall.swf", flashvars, params);

// drop down menu

function hideContentImages(){
	$(".contentImageSubpage").css("display", "none");	
	$(".content_image").css("display", "none");
}

$(document).ready(function(){
	
	$(".contentImageSubpage").css("display", "none");	
	$(".content_image").css("display", "none");	
	//$("#content_text_layout2").css("display", "none");
	 setTimeout( function() { 
		$(".contentImageSubpage").fadeIn(800);
		$(".content_image").fadeIn(800);
		//$("#content_wide_container").fadeIn(2000);
		}, 500 );	
		
		var intro_done = false;
		
		$(function(){
			setTimeout( function() { 
				intro_done = true;
			}, 300 );
						
			$('.my-community #link_community').animate({fontSize: 25},{ duration: 300, queue: false });
			$('.my-community #link_community').animate({top: -5},{ duration: 300});
			
			$('.my-home #link_home').animate({fontSize: 25},{ duration: 300, queue: false });
			$('.my-home #link_home').animate({top: -5},{ duration: 300, queue: false});
			
			$('.the-story #link_story').animate({fontSize: 25},{ duration: 300, queue: false });
			$('.the-story #link_story').animate({top: -5},{ duration: 300, queue: false });
			
			$('.stop-by #link_stop_by').animate({fontSize: 25},{ duration: 300, queue: false });
			$('.stop-by #link_stop_by').animate({top: -5},{ duration: 300, queue: false });
			
			$('.live-longer #link_live_longer').animate({fontSize: 25},{ duration: 300, queue: false });
			$('.live-longer #link_live_longer').animate({top: -5},{ duration: 300, queue: false });
			
			$(".contentSubNav ul > li:last").css("border-right", "0px");  //border-right:2px solid #000000;
			
		});
	
		//var animation_done = true;	
		$(".mainNav").attr('animation_done', 'true');
	
			var $linkWidth;
			$(".mainNav").hover(function(){
				$this = $(this);
				if(intro_done == true){
					$linkWidth = $(this).width();
					$this.css("cursor", "pointer");
					$this.children("#slider").css("cursor", "pointer");
					$this.css("width", ($linkWidth) + "px"); 
					if($this.attr('animation_done') == "true"){
						$this.children("#slider").slideDown("fast");       
					}
				}
			},
			function (){
				var $this = $(this);
				$this.attr('animation_done', 'false');
				$this.children("#slider").slideUp("fast");	
				$this.children("#slider").slideUp("fast",function(){
					$this.attr('animation_done', 'true');
						
				});
			});
});

