// JavaScript Document
// main menu
$(document).ready(function () {

		jQuery('#main-nav').accordion({
		  selectedClass: "active",
			active: false,
			header: '.header',
			navigation: true,
			event: '',
			autoheight: false,
			fillSpace: false,
			animated: 'easeslide'
		});
		
		 
		 
		 
	 $("#portfolio-list li img").css("margin-top", "0px");
	 $("#slideshow li img").css("margin-top", "0px");
	 $("#slideshowTwo li img").css("margin-top", "0px");
	 
	 $("#portfolio-buttons").css("display", "block");
	 $("#secondlabel, #thirdlabel, #fourthlabel, #fifthlabel, #sixthlabel").css("display", "none");
	 $("#secondImg, #thirdImg, #fourthImg, #fifthImg, #sixthImg").css("display", "none");
	 $("ul#portfolio-label").css("overflow", "hidden");
	 $("#portfolio-buttons li").css("display", "inline");



	//disjointed rollover function starting point
	$("ul#portfolio-buttons li a").hover(function(){
	//make a variable and assign the hovered id to it
	var elid = $(this).attr('id');
	//hide the image currently there
	$("ul#portfolio-label li").hide();
	//fade in the image with the same id as the selected buttom
	$("ul#portfolio-label li#" + elid + "label").fadeIn("slow");
	});
	$("ul#portfolio-buttons li a").click(function(){
	// for personal stationery
	var elidp = $(this).attr('id');
	$("div#portfolio li").hide();
	$("div#portfolio  li#" + elidp + "Img").fadeIn("slow");
	$("div#portfolio li ul li").show(); // show nest list within content on info li item

	});

$("#main-nav li ul li a").click(function(){
	//make a variable and assign the click id to it
	var elidmn = $(this).attr('class');
	//hide the image and lable currently there
	$("div#portfolio li").hide();
	
	$("ul#portfolio-label li").hide();
	//fade in the image and lable with the same id as the selected buttom
	$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
	$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	$("div#portfolio li ul li").show();// show nest list within content on info li item
	});


	//Toggle all elements using main nav links
	$("#main-nav a.first").click(function(){
		$(this).addClass("active");
		$("a#first").addClass("active");
		$("a#second, a#third, a#fourth, a#fifth, a#sixth").removeClass("active")
		$("a.second, a.third, a.fourth, a.fifth, a.sixth").removeClass("active")
		$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
		$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	});
	$("#main-nav a.second").click(function(){
		$(this).addClass("active");
		$("a#second").addClass("active");
		$("a#first, a#third, a#fourth, a#fifth, a#sixth").removeClass("active")
		$("a.first, a.third, a.fourth, a.fifth, a.sixth").removeClass("active")
		$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
		$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	});
	$("#main-nav a.third").click(function(){
		$(this).addClass("active");
		$("a#third").addClass("active");
		$("a#first, a#second, a#fourth, a#fifth, a#sixth").removeClass("active")
		$("a.first, a.second, a.fourth, a.fifth, a.sixth").removeClass("active")
		$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
		$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	});
	$("#main-nav a.fourth").click(function(){
		$(this).addClass("active");
		$("a#fourth").addClass("active");
		$("a#first, a#second, a#third, a#fifth, a#sixth").removeClass("active")
		$("a.first, a.second, a.third, a.fifth, a.sixth").removeClass("active")
		$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
		$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	});
	$("#main-nav a.fifth").click(function(){
		$(this).addClass("active");
		$("a#fifth").addClass("active");
		$("a#first, a#second, a#third, a#fourth, a#sixth").removeClass("active")
		$("a.first, a.second, a.third, a.fourth, a.sixth").removeClass("active")
		$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
		$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	});
	$("#main-nav a.sixth").click(function(){
		$(this).addClass("active");
		$("a#sixth").addClass("active");
		$("a#first, a#second, a#third, a#fourth, a#fifth").removeClass("active")
		$("a.first, a.second, a.third, a.fourth, a.fifth").removeClass("active")
		$("div#portfolio  li#" + elidmn + "Img").fadeIn("slow");
		$("ul#portfolio-label li#" + elidmn + "label").fadeIn("slow");
	});
	

	
	//Toggle all elements using portfolio nav
	$("ul#portfolio-buttons li a#first").click(function(){
		$(this).addClass("active");
		$("a#second, a#third, a#fourth, a#fifth, a#sixth").removeClass("active")
		$("#main-nav a.first").addClass("active");
		$("#main-nav a.second, #main-nav a.third, #main-nav a.fourth, #main-nav a.fifth, #main-nav a.sixth").removeClass("active")
	});
	$("ul#portfolio-buttons li a#second").click(function(){
		$(this).addClass("active");
		$("a#first, a#third, a#fourth, a#fifth, a#sixth").removeClass("active")
		$("#main-nav a.second").addClass("active");
		$("#main-nav a.first, #main-nav a.third, #main-nav a.fourth, #main-nav a.fifth, #main-nav a.sixth").removeClass("active")
	});
	$("ul#portfolio-buttons li a#third").click(function(){
		$(this).addClass("active");
		$("a#first, a#second, a#fourth, a#fifth, a#sixth").removeClass("active")
		$("#main-nav a.third").addClass("active");
		$("#main-nav a.first, #main-nav a.second, #main-nav a.fourth, #main-nav a.fifth, #main-nav a.sixth").removeClass("active")
	});
	$("ul#portfolio-buttons li a#fourth").click(function(){
		$(this).addClass("active");
		$("a#first, a#second, a#third, a#fifth, a#sixth").removeClass("active")
		$("#main-nav a.fourth").addClass("active");
		$("#main-nav a.first, #main-nav a.second, #main-nav a.third, #main-nav a.fifth, #main-nav a.sixth").removeClass("active")
	});
	$("ul#portfolio-buttons li a#fifth").click(function(){
		$(this).addClass("active");
		$("a#first, a#second, a#third, a#fourth, a#sixth").removeClass("active")
		$("#main-nav a.fifth").addClass("active");
		$("#main-nav a.first, #main-nav a.second, #main-nav a.third, #main-nav a.fourth, #main-nav a.sixth").removeClass("active")
	});
	$("ul#portfolio-buttons li a#sixth").click(function(){
		$(this).addClass("active");
		$("a#first, a#second, a#third, a#fourth, a#fifth").removeClass("active")
		$("#main-nav a.sixth").addClass("active");
		$("#main-nav a.first, #main-nav a.second, #main-nav a.third, #main-nav a.fourth, #main-nav a.fifth").removeClass("active")
	});

		$('#expandlist dd div').hide();				  
       $('#expandlist dd div.open').show();
       $('#expandlist dd a').click(function(){
               $('#expandlist dd div').slideUp('slow');
			   $('#expandlist dd a').removeClass('active');
			   $(this).addClass('active');
               $(this).parent().next().slideDown();
               return false;
       });
});




// Flash header SWF Object
var flashvars = {};
var params = {
  wmode: "opaque",
  swliveconnect: "true"
};
var attributes = {};
	swfobject.embedSWF("flash/copycat-intro.swf", "flash-intro", "1000", "747", "8.0.0", "flash/expressInstall.swf", flashvars, params, attributes);
	
// Contact map popup
$().ready(function() {
  $('#map').jqm();
  	$('a.map').click(function(){
	});
});





