$(document).ready(function() {
	$(".screens a").fancybox({
		hideOnContentClick: true,
		zoomSpeedIn: 300,
		zoomSpeedOut: 300,
		padding: 10,
		overlayShow: false
	});
	$(".videolink a").fancybox({
		hideOnContentClick: false,
		frameWidth: 853,
		frameHeight: 505,
		padding: 10,
		zoomOpacity: false,
		overlayShow: false
	});
	$(document).pngFix();
	$(".fancy a").click(function(){
		$(".demovid embed").hide();	
	});
	$("#fancy_content").click(function(){
		$(".demovid embed").show();
	});
	$("#fancy_close").click(function(){
		$(".demovid embed").show();
	});
	$(document).keyup(function(e) {
		if(e.keyCode == 27) {
			$(".demovid embed").toggle();
		}
	});		
	/*$(document).keydown(function(event) {
		if (event.keyCode == 27) {
        	$(".demovid embed").show();
        else
        	return;
	});*/
}); 


$(function() {
	//$.fn.media.mapFormat('avi','quicktime');
	// this one liner handles all the examples on this page
    $("a.demovid").media({
    	autoplay: 1,
    	bgColor: '#000',
    	width: '240',
    	height: '360',
    	params: { controller: 'false', loop: 'true', wmode: 'transparent' },
    	attrs: { controller: 'false', loop: 'true', wmode: 'transparent' }
    	});
    
});
