  $(function(){
	$(".teamMember").css("opacity", 0.5);
	// content start state. contentColWork fades first or else the carousel will be buggy
	$(".contentColWork").fadeTo(100, 0, function(){
		$(".contentColWork").css("visibility", "visible");
		$(".contentColWork").css("display", "none");
	});
	$(".contentColContent").css("display", "none");
	$(".contentColContent").css("opacity", 0);
	$(".skill").css("opacity", .4);
	$("#launchLink").css("opacity", 0);
	// Makes the Philosophy Link and content start on
	$(".link").css("opacity", .4);
	$("#mainLink3").css("opacity", 1);
	$("#workLink1Content").css("display", "block");
	$("#workLink1Content").css("opacity", 1);
	$("#navWork").css("opacity", 1);
    $(".workLink").fadeTo(100, .4);
    $("#workLink1").fadeTo(100, 1);
	$("#vidBG").hide();


	$("#workLink1Content").fadeTo(100, 1, function(){
		$("#workLink1Content").css("visibility", "visible");
		$("#workLink1Content").css("display", "block");
			$(".carousels").css("width", 3000);
			$(".carousels").css("height", 3000);
		    $(".child").css("width", 245);
		    $(".child").css("overflow", "hidden");
	});


// Makes the Dots on carousels start transparent
	$(".dotOn1").css("opacity", 10);
	$(".dotOn2").css("opacity", 10);
	$(".dotOn3").css("opacity", 10);
	$(".dotOn4").css("opacity", 10);
	$(".dotOn5").css("opacity", 10);
	$(".dotOn6").css("opacity", 10);
	$(".dotOn7").css("opacity", 10);
	$(".dotOn8").css("opacity", 10);
	content = "#mainLink3";
	last = "workLink1Content";
	thisLink = "mainLink3";
  });
  $(document).ready(function(){
	$(".contentChange").click(function(){
		$("#launchLink").fadeTo(100, 0).empty();
		get = this.id;
		if (content != get ) {
			$("#"+last).css("display", "none");
			$("#"+get+"Content").css("display", "block");
			$("#"+get+"Content").css("opacity", 100);
			$(".skill").fadeTo(100, .4);
		}
		content = get;
		last = content+"Content";
	});
// This is for the view link in the illustrations section
	$(".illustrationsLink").click(function(){
		$("#launchLink").fadeTo(100, 0).empty();
		get = this.id;
	});
	

	
	// This is important because the "work" link in the main nav accesses the content for worklink1 so this one is hard coded
	$("#mainLink3").click(function(){
		$("#launchLink").fadeTo(100, 0).empty();
		get = this.id;
		if (content != "workLink1" ) {
			$("#"+last).css("display", "none");
			$("#"+last).css("display", "none");
			$("#workLink1Content").css("display", "block");
			$("#workLink1Content").css("opacity", 100);
			$(".skill").fadeTo(100, .4);
		    $("#navWork").css("display", "block");
		    $(".workLink").fadeTo(100, .4);
		    $("#workLink1").fadeTo(100, 1);
		    $("#navWork").fadeTo(100, 1);
			$(".carousels").css("width", 3000);
			$(".carousels").css("height", 3000);
		    $(".child").css("width", 245);
		    $(".child").css("overflow", "hidden");
		}
		content = "workLink1";
		last = content+"Content";
	});
	$(".link").click(function () {
      $(".link").fadeTo(100, .4);
	  $(this).fadeTo(100, 1);
	});
	$(".workLink").click(function () {
      $(".workLink").fadeTo(100, .4);
	  $(this).fadeTo(100, 1);
	  $(".carousels").css("width", 3000);
	  $(".child").css("width", 245);
	  $(".child").css("overflow", "hidden");
	});
	// Makes the main nav turn on and off the work nav 
    $("#mainLink1").click(function () {
	  $("#navWork").fadeTo(100, 0, function(){
		    $(".workLink").css("opacity", .4);
			$("#navWork").css("display", "none");
	  });
	});
    $("#mainLink2").click(function () {
	  $("#navWork").fadeTo(100, 0, function(){
		    $(".workLink").css("opacity", .4);
			$("#navWork").css("display", "none");
	  });
	});
	$(".teamMember").hoverIntent(function(){$(this).fadeTo("fast", 1);}, function(){$(this).fadeTo("fast", 0.5);});
	function mycarousel1_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn1").fadeTo(100, .1);
			$("#dotOn1"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel2_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn2").fadeTo(100, .1);
			$("#dotOn2"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel3_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn3").fadeTo(100, .1);
			$("#dotOn3"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel4_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn4").fadeTo(100, .1);
			$("#dotOn4"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel5_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn5").fadeTo(100, .1);
			$("#dotOn5"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel6_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn6").fadeTo(100, .1);
			$("#dotOn6"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel7_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn7").fadeTo(100, .1);
			$("#dotOn7"+idx).fadeTo(100, 1);
		}
	};
	function mycarousel8_itemFirstInCallback(carousel, item, idx, state) {
		if (idx != 0) {
			$(".dotOn8").fadeTo(100, .1);
			$("#dotOn8"+idx).fadeTo(100, 1);
		}
	};
    jQuery('#mycarousel1').jcarousel({
        itemFirstInCallback:  mycarousel1_itemFirstInCallback
    });
    jQuery('#mycarousel2').jcarousel({
        itemFirstInCallback:  mycarousel2_itemFirstInCallback
    });
    jQuery('#mycarousel3').jcarousel({
        itemFirstInCallback:  mycarousel3_itemFirstInCallback
    });
    jQuery('#mycarousel4').jcarousel({
        itemFirstInCallback:  mycarousel4_itemFirstInCallback
    });
    jQuery('#mycarousel5').jcarousel({
        itemFirstInCallback:  mycarousel5_itemFirstInCallback
    });
    jQuery('#mycarousel6').jcarousel({
        itemFirstInCallback:  mycarousel6_itemFirstInCallback
    });
	jQuery('#mycarousel7').jcarousel({
        itemFirstInCallback:  mycarousel7_itemFirstInCallback
    });
	jQuery('#mycarousel8').jcarousel({
        itemFirstInCallback:  mycarousel8_itemFirstInCallback
    });
    $(".bleedWork", this).click(function() {
	  	newImg = this.id;
		rutaImage = ("images/"+newImg+".jpg");
		$("#images").fadeOut("normal").empty();
		$("#vidBG").fadeOut("normal").empty();
		var objImage = new Image(); 
		$(objImage).load(function() {
			$("#images").hide();
			$("#images").append(this);
			$("#images img").css("marginLeft", 40);
			$("#images").fadeIn("fast");              
		});
		$(objImage).attr("src", rutaImage);
		return false;
    });
    $(".bleedVideo", this).click(function() {
		$(".skill").fadeTo(100, .4);
		$("#images").fadeOut("normal").empty();
		$("#vidBG").fadeIn("normal");
	  	newVideo = this.id;
		$("#images").append("<iframe allowtransparency='true' style='margin:20px 0 0 227px;' src ='http://www.dmgx.com/video.php?flv_path=rtmp://dmgx.fcod.llnwd.net/a4278/o37/dmg/"+newVideo+".flv' frameborder='0' scrolling='no' width='545px' height='310px'></iframe>").fadeIn("fast");
    });
	 $(".bleedSWF1", this).click(function() {
		$(".skill").fadeTo(100, .4);
		$("#images").fadeOut("normal").empty();
	  	newVideo = this.id;
		$("#images").append("<iframe allowtransparency='true' style='margin:20px 0 0 227px;' src ='content/animation/xmas06/index.html' frameborder='0' scrolling='no' width='610px' height='325px'></iframe>").fadeIn("fast");
    });
	 $(".bleedSWF2", this).click(function() {
		$(".skill").fadeTo(100, .4);
		$("#images").fadeOut("normal").empty();
	  	newVideo = this.id;
		$("#images").append("<iframe allowtransparency='true' style='margin:0px 0 0 227px;' src ='content/animation/zomboy/index.html' frameborder='0' scrolling='no' width='550px' height='428px'></iframe>").fadeIn("fast");
    });
	 $(".bleedSWF3", this).click(function() {
		$(".skill").fadeTo(100, .4);
		$("#images").fadeOut("normal").empty();
	  	newVideo = this.id;
		$("#images").append("<iframe allowtransparency='true' style='margin:20px 0 0 227px;' src ='content/animation/boingo/index.html' frameborder='0' scrolling='no' width='600px' height='336px'></iframe>").fadeIn("fast");
    });
	 $(".bleedSWF4", this).click(function() {
		$(".skill").fadeTo(100, .4);
		$("#images").fadeOut("normal").empty();
	  	newVideo = this.id;
		$("#images").append("<iframe allowtransparency='true' style='margin:0px 0 0 227px;' src ='content/animation/kungfugirl/index.html' frameborder='0' scrolling='no' width='550px' height='413px'></iframe>").fadeIn("fast");
    });
	 $(".bleedSWF5", this).click(function() {
		$(".skill").fadeTo(100, .4);
		$("#images").fadeOut("normal").empty();
	  	newVideo = this.id;
		$("#images").append("<iframe allowtransparency='true' style='margin:0px 0 0 227px;' src ='content/animation/samurai/index.html' frameborder='0' scrolling='no' width='550px' height='413px'></iframe>").fadeIn("fast");
    });
  });