	Cufon.replace('.cufon',{hover: true});
	var overlay = '';
	function loadFeatureOverlay(id) {

		$("#feature_content").hide();
		$("#feature_content").flashembed({src: "", wmode: 'opaque'});
		overlay.load();
		$("#overlay_flash").show();
		$("#overlay_flash").flashembed({src: "/swf/overlayFeature_static.swf", wmode: 'opaque'}, {idNum: id });
		//$("#overlay").css('top', $(window).height() / 2 - 278);
	}
	function loadFeatureVideoOverlay(vid) {

		$("#feature_content").hide();
		$("#feature_content").flashembed({src: "", wmode: 'opaque'});
		overlay.load();
		// 		$("#overlay_flash").flashembed({src: "/swf/dekora_video.swf", wmode: 'opaque'}, {featureVideo: vid });
		$("#overlay_flash").show();
		$("#overlay_flash").flashembed({src: "/swf/overlayFeature_static.swf", wmode: 'opaque'}, {idNum: vid });
		
	}	

	function loadImageOverlay(id) {
		overlay.load();
		$("#overlay_flash").show();
		$("#overlay_flash").flashembed({src: "/swf/dekora_image.swf", wmode: 'opaque'}, {idNum: id });
	}
	function loadVideoOverlay(id) {
		overlay.load();
		$("#overlay_flash").show();
		$("#overlay_flash").flashembed({src: "/swf/dekora_video.swf", wmode: 'opaque'}, {idNum: id });
	}

	$(document).ready(function() {
		
		// jBox (c) Owen Ingraham
		$('#jBox a').click(function() {
			$('#jBox .clicked').removeClass('clicked');
			temp = $(this);
			temp.addClass('clicked');
			$("#jBox_content").find("div:visible").hide();
			$("#" + temp.attr('id') + '_content').show();
			return false;
		});
		
		// about people
		$('#about_box a').click(function() {
			// hide the current person's information
			$(".vcard:visible").hide();
			$('#' + $(this).attr("href")).show();
			// show the selected person's information
			$(this).parent().find(".about_selected").removeClass("about_selected");
			$(this).addClass("about_selected");			
			return false;
		});
		
		// flash - using jquery tools
		$("#gallery_flash").flashembed({src: "/swf/dekora_gallery_v1.swf", wmode: 'opaque'}); 
		$("#feature_content").flashembed({src: "/swf/basics1.swf", wmode: 'opaque'});
		
		// overlay - using jquery tools
		overlay = $("#overlay").overlay({ expose:{ color:'#373831', loadSpeed:150, opacity:0.62, onClose: function(){
				//$("#overlay_flash").flashembed({src: ""});
				// $("#overlay_flash").hide();
				$("#overlay_flash").flashembed({src: ""});
				$("#overlay_flash").hide();
				$("#feature_content").show();
				$("#feature_content").flashembed({src: "/swf/basics1.swf", wmode: 'opaque'});
				
				// $("#overlay").css('height',557);
				// $("#overlay_flash").css('height',557);
			} }, api:true });
		
		
		$(".play_dekora_video").click(function() {
			//$("#feature_content").unload();								   
			$("#feature_content").hide();
			$("#feature_content").flashembed({src: "", wmode: 'opaque'});
			overlay.load();
			$("#overlay").css('height',499);
			$("#overlay_flash").css('height',499);
			$("#overlay_flash").show();
			$("#overlay_flash").flashembed({src: "/swf/dekora_video_wide.swf", wmode: 'opaque'}, {featureVideo: '/content/videos/dekora_cut09_1080p_H264.flv' });
			return false;
			//$("#overlay").css('top', $(window).height() / 2 - 278);
		});
		
		
		$(".first_btn").click(function() {
			$(this).next().removeClass("current");
			$(this).addClass("current");
			$(this).parent().find(".second").hide();
			$(this).parent().find(".first").show();
			
			
			return false;
		});
		$(".second_btn").click(function() {
			$(this).prev().removeClass("current");
			$(this).addClass("current");
			$(this).parent().find(".first").hide();
			$(this).parent().find(".second").show();

			
			return false;
		});
		
		
	});
	
	$(window).resize(function() {
		$("#overlay").css('top', $(window).height() / 2 - 278);
		$("#overlay").css('left', $(window).width() / 2 - 421);	
	});
