// Resolve noConflict Mode
(function($) {

	// Make sure console is defined
	if(!window.console)
	window.console = {log: function(){}};

	$(document).ready(function() {

		$(".left:empty + .right:empty").parent().remove();
		
		$("a[href$='\\#fancybox']").click(function(){
			var self = this;
			$.fancybox({
				'href'	: self.href.replace('#fancybox',''),
				'type'	: 'iframe',
			});
			
			return false;
		});
		
		$(".fancybox a[href^='\\#'], a[href^='\\#'].fancybox").click(function(){
			var href = $(this).attr('href');
			$.fancybox({
				'scrolling'		: 'no',
				'titleShow'		: false,
				'href'			: this.href,
				'onStart'		: function() {
					$(href).show();
				},
				'onClosed'		: function() {
					$(href).hide();
				}
			});
			
			return false;
		});
		
		$('.fancybox-video').click(function() {
			$.fancybox({
				'padding'		: 0,
				'autoScale'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none',
				'overlayColor'	: '#000',
				'overlayOpacity': '0.7',
				'title'			: this.title,
				'width'			: 760,
				'height'		: 500,
				'href'			: this.href,
				'type'			: 'swf',
				'swf'			: {
					'wmode'		: 'transparent',
					'allowfullscreen'	: 'true'
				}
			});

			return false;
		});


	});

//Complete closure
})(jQuery)