	//Site functions

(function($){
	siteFunctions = function() {
		$(".blink").fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100); // User Nav Hint
		
		// IE6 PNG Fix
		$(document).pngFix(); 
		
		// Auto Hide Info
		$("#copyWrapper").delay(2000).animate({left:"-209px"}, 200);
		
		// Show/Hide Details Web Design
		copyVisible = "closed";
		$('#copyWrapper a.trigger').click(function() {
			if (copyVisible == "open") {				
				$("#copyWrapper").animate({left:"-209px"}, 200);
				$("#copyWrapper a.trigger").html("Open");
				copyVisible = "closed";
			} 
			else if (copyVisible == "closed") {
				$("#copyWrapper").animate({left:"0px"}, 200);
				$("#copyWrapper a.trigger").html("Close");
				copyVisible = "open";
			}
		});
		
		// Show/Hide Details Components
		componentCopyVisible = "closed";
		$('#componentCopyWrapper a.trigger').click(function() {
			if (componentCopyVisible == "open") {				
				$("#componentCopyWrapper").animate({left:"-209px"}, 200);
				$("#componentCopyWrapper a.trigger").html("Open");
				componentCopyVisible = "closed";
			} 
			else if (componentCopyVisible == "closed") {
				$("#componentCopyWrapper").animate({left:"0px"}, 200);
				$("#componentCopyWrapper a.trigger").html("Close");
				componentCopyVisible = "open";
			}
		});
		
		// Auto Hide Info
		$("#componentCopyWrapper").delay(2000).animate({left:"-209px"}, 200);
		
		// Nav Functions
		$(".pagedContent").hide(); //Hide all content
		$("#bottomText div:first").show(); // Show first content
		$("#navlist li:first").addClass("active");
		
		
		$("#navlist li").click(function() {
			$('html, body').animate({
			scrollTop: $("#bottomText").offset().top
			}, 2000);
			
			
			$("#navlist li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".pagedContent").hide(); //Hide all tab content
			
			var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});
		
		// Switch Between Web Components and Web Design
		function showComponents() {
			$("#componentContainer").fadeIn();
			$("#designTitle").fadeOut(function() {
				$("#componentsTitle").fadeIn();
			});
		};
		
		function showWebDesign() {
			$("#webContainer").fadeIn();
			$("#componentsTitle").fadeOut(function() {
				$("#designTitle").fadeIn();
			});
		};
		
		$("#navlist li.component").click(function() {
			$("#webContainer").fadeOut(function() {
				showComponents();
			});
		});
		
		$("#navlist li.design").click(function() {
		$("#componentContainer").fadeOut(function() {
				showWebDesign(); // Show Portfolio
			});
			
		});
		
	
		// menu effects
		
		$('#menu a')
			.css( {backgroundPosition: "-20px 0px"} )
			.mouseover(function(){
				$(this).stop().animate({backgroundPosition:"(-20px -60px)"}, {duration:500})
				.css( {color: "#e8e8e8"} )
			})
			.mouseout(function(){
				$(this).stop().animate({backgroundPosition:"(80px -10px)"}, {duration:200, complete:function(){
					$(this).css({backgroundPosition: "-20px 0px"})
					.css( {color: "#b1b1b1"} )
				}})
			})
		
	};
  })(jQuery);
