
$(document).ready( function(){
		
	
	Cufon.replace('h1,h2,h3,h4,.info_div,.info,#navigation,#footer', {hover:true});


		
	$('#page_container').animate({width:"300px"},1500);

	$('.nav_link').hover( function(){
		
		$(this).fadeTo(800,0.4);
		

	},function(){
		
		$(this).fadeTo(800,1);

	});

	$('.open').click( function(){

	page_height = $(window).height();
	
	half_page = (page_height/2) - 75;
	
	

		$('#open_site').fadeOut("normal");
		$('#page_container').fadeIn("normal");

			$('#page_container').animate({height:"100%"},"slow");
			$('#page_container').animate({width:"100%"},"slow");			

		$('#page_container').animate({height:160,top:half_page});
		$('#footer').delay(1000).animate({left:"80%"});
					
		$('#info_div').delay(2800).slideDown("slow");	
		$('#info_div').fadeIn("normal");	
		$('#navigation').delay(2600).fadeIn("normal");
		
		$('#x_main').css({"border-top":"1px #1565B2 solid","border-bottom":"1px #1565B2 solid","background" : "#222222"});
		
	});


	$('.nav_link').click( function(){

		
		var info_div = $(this).attr('name');
			

		$('.info').animate({"top":"600"});
		$('.info').fadeOut("normal");
		$('.nav_link').css({"background" : "none"});
		$('.nav_link').css({"color" : "#999"});
		$('.nav_link').css({"border-left" : "none"});

		old_width = $(this).width();
		old_height = $(this).height();	
		old_left = $(this).position().left;
		old_top = $(this).position().top;
		
		$('.info').animate({top:0},"normal");
		
		$('.nav_link').css({"border-top":"1px #3c3c3c solid","border-bottom":"1px #3c3c3c solid","background" : "none"});
		$('.nav_link').animate({width:"100%",height:40,left:0,"z-index":6},"slow");
		$('.nav_link').animate({height:25},"slow");		
		$(this).animate({width:400,height:15,left:50});
		$(this).css({"background":"#212121"},"slow");		
		$('#'+info_div).css({"border-top":"1px #1565B2 solid","border-bottom":"1px #1565B2 solid","background" : "#222222"});

		
	

		$('#'+info_div).slideDown("normal");		
		$(this).css({"background" : "#333"});
		$(this).css({"border-left" : "1px #1E90FF solid"});
		$(this).css({"color" : "#000"});
		

	});


	do_resize();

	$(window).resize( function(){

		do_resize();

	});

	function do_resize(){

			//var images = $('.rotate_img').length;
			//var window_width = document.body.clientWidth;
			
			

	}

	



});

