$(document).ready( function(){
	$('#b-mainmenu').flash({
		'src'			:	'/images/menu.swf',
		'width'			:	'380',
		'height'		:	'350',
		'wmode'			:	'opaque'
	});
	
	$("a.fancybox").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayOpacity': 	'0.5',
		'overlayColor'	:	'#222'
	});
	$("a.video").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	400, 
		'speedOut'		:	200, 
		'padding'		: 10,
		'autoScale'		: false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'title'			: this.title,
		'width'			: 575,
		'height'		: 425,
		//'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
		'type'			: 'swf',
		'swf'			: {
		    'wmode'				: 'transparent',
			'allowfullscreen'	: 'true'
		}
	});
	
	$("p.video").corner('10px');
	$("#online-email").validate();
	$('#submenu').superfish(); 
	
});


(function ($) {
	// VERTICALLY ALIGN FUNCTION
	$.fn.vAlign = function() {
		return this.each(function(i){
		var ah = $(this).height();
		var ph = $(this).parent().height();
		var mh = (ph - ah) / 2 - 29;
		$(this).css('margin-top', mh);
		});
	};
})(jQuery);
