/**
 * Call jQuery using a special handler to avoid namespaces difficulties
 *
 * @link http://api.jquery.com/ready/ - "Aliasing the jQuery Namespace"
 */
jQuery(document).ready( function($) {
	// Fancybox settings
	$( 'a.popup' ).fancybox({
		'transitionIn': 'elastic'
	});

	// Make videos use Fancybox too
	$( '.youtube_video' ).click( function( event ) {
		$.fancybox({
				'autoScale':    false,
				'href':         this.href.replace( new RegExp( "watch\\?v=", 'i' ), 'v/' ),
				'padding':      0,
				'swf':          { 'wmode': 'transparent', 'allowfullscreen': 'true' },
		    	'transitionIn': 'elastic',
				'type':         'swf',
				'height':       410,
				'width':        680
		});

		event.preventDefault();
	});
	
});


