$(document).ready(function()
{
		
	// Video Resize
    //set the originals
    var originalWinWidth = $(window).width();

 
    //set the original video size
    var originalVideoWidth = Math.round(parseInt(originalWinWidth * 100, 10) * .4) / 100;

	
    //set the width & height sizes using jquery
	$("video").attr("width", originalVideoWidth);
	
    $(window).resize(function()
    {
        //get the width and height as the window resizes
        var winWidth = $(window).width();

        //get the difference in width
        var widthDiff = winWidth - originalWinWidth;
 
        //check if the window is larger or smaller than the original
        if(widthDiff > 0)
        {

             //calculate the new font size
            var newWindowWidth = Math.round(parseInt(winWidth * 100, 10) * .4) / 100;
 
            //set new font size
			$("video").attr("width", newWindowWidth);
			$("object").attr("width", newWindowWidth);
			$("param[name=type]").attr("width", newWindowWidth);
        }
        else
        {
            //calculate the new font size
            var newWindowWidth = Math.round(parseInt(winWidth * 100, 10) * .4) / 100;
 
            //set the new font size
            $("video").attr("width", newWindowWidth);
			$("object").attr("width", newWindowWidth);
			$("param[name=type]").attr("width", newWindowWidth);
        }
		

    })

	// FancyBox
	var fancyWidth = $(window).width();
	var fancyHeight = $(window).height();
	
	var originalFancyWidth = Math.round(parseInt(fancyWidth * 100, 10) * .6) / 100;
	var originalFancyHeight = Math.round(parseInt(fancyHeight * 100, 10) * .7) / 100;
	
	$("li.fancy a").addClass("fancybox");
	
	$("a.fancybox").fancybox({
		'autoDimensions': false,
		'width'         : originalFancyWidth,
		'height'        : originalFancyHeight,
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	800, 
		'speedOut'		:	800, 
		'overlayShow'	:	true,
		'overlayOpacity':	0.5,
		'overlayColor'	: 	'#000',
		'showCloseButton':	false
		
	});
	$("li.fancyg a").addClass("fancyboxg");
	
	$("a.fancyboxg").fancybox({
		'autoDimensions': true,
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	800, 
		'speedOut'		:	800, 
		'overlayShow'	:	true,
		'overlayOpacity':	0.5,
		'overlayColor'	: 	'#000',
		'showCloseButton':	false
		
	});
	var n = $("#menu-contact___ li").size();
	$("#menu-contact___").addClass("menu" + n);
	var n = $("#menu-links___ li").size();
	$("#menu-links___").addClass("menu" + n);
	
	// for iframes vimeo
	$(".iframe").fancybox({
		'padding'		: 0,
		'autoScale'		: false,
		'transitionIn'	:	'fade',
		'transitionOut'	:	'fade',
		'speedIn'		:	800, 
		'speedOut'		:	800, 
		'overlayShow'	:	true,
		'overlayOpacity':	0.5,
		'overlayColor'	: 	'#000',
		'showCloseButton':	false
	});
});
