
$(document).ready(function() {

	// NAVIGATION ALL PAGES - FADE IN
	
	$("div#nav ul li a").css({"opacity" : 0}).hover(function(){														  
			$(this).stop(true, true).animate({"opacity" : 1}, 350); 
		}, function(){
			$(this).stop(true, true).animate({"opacity" : 0}, 200);
	
	});
	
	// FIREFOX Bug, opacity sticks if you dont hover off-
	// navigation button, but use the browser back
	$("div#nav ul li a").click(function() {
		$(this).stop(true, true).animate({"opacity" : 0}, 5000);	
	});

	
	
	// CONTACT PAGE - INFO BOX SLIDE DOWN
	/*
	$("#content-contact").click(function() {   
		if ($("#contact-slideDown").is(":hidden")) {
			$("#contact-slideDown").slideDown("slow");
		} else {
			$("#contact-slideDown").slideUp("slow");
		}

	});  
	*/
	
	
	
	// Fade In Copy
	$("div.copy").delay(400).fadeIn('slow');
	$("div.gd-usa").delay(400).fadeIn('slow');
	$("div.dieline").delay(400).fadeIn('slow');
	
	
	
	//FLIP BREADCRUMB TO BLUE on HOVER
	var flip_bg_position = $("li.flip").css("background-position");
	$("li.flip").hover(						
		 function () {
			$(this).css("background-position","-272px -100px");
		  },
		  function () {
			$(this).css("background-position",flip_bg_position);
		  }
	);
	
	// NEWS PAGE - ARTICLE SLIDE DOWN
	/*$("ul#articles li h2").click(function() {   
		$(this).siblings("p").slideToggle('slow');
	});  
	
	$(".example1").colorbox({width:"50%", inline:true, href:"#inline_example1"});
	$(".example2").colorbox({width:"80%", height:"80%", iframe:true});
	$(".example3").colorbox({width:"50%", inline:true, href:"#inline_example3"});
	*/
	
	
	/* // COMMENTED OUT IF USING PHP RANDOMIZER
	function randOrd() {
		return (Math.round(Math.random())-0.5); 
	}
	// Declare the featured work for random display on home page
	var featuredWork = [ 'us-gda', 'medibag', 'ric-pipino' ];
	featuredWork.sort( randOrd );
	var bgRandom = featuredWork[1];
	$("#container").removeClass();
	$("#container").addClass(bgRandom);
	var itemTitleLoad = $("#title-link div#"+bgRandom);
	$(itemTitleLoad).delay(800).fadeIn('slow');
	*/
	
	
	
	/*// Fade In the correct link corresponding to BG
	var bgRandom = $("#container").attr('class');
	$("#title-link div#"+bgRandom).delay(800).fadeIn('slow');
	
	*/
	
	
	
	/*
	$("ul#nav a").click(function() {   
		if ($(this).attr('rel')) {
		// attribute exists
			var itemSelected = $(this).attr('rel');
	
			$("#container").removeClass();
			$("#container").addClass(itemSelected);
			
			var itemTitle = $("#title-link div#"+itemSelected);
			$(itemTitle).siblings().css('display','none');
			$(itemTitle).fadeIn('slow');
			//alert(itemSelected);
			return false; 
		} else {
	     // attribute does not exist
			return true;
		}
	});  
	*/
});

