//var $j = jQuery.noConflict();
$('document').ready(function(){
$('a.video_popup').fancybox({
	'titleShow': false,
    'width': 850,
    'height': 450,
    'margin': 10,
    'padding': 20,
    'scrolling':'no',
    'type': 'iframe',
    'autoScale':false,
    'autoDimensions':false
});
});
$(document).ready(function() {
 $('a.fancybox').fancybox({
 'hideOnContentClick': false,
 //'imageScale': false,
 'centerOnScroll': false,
 'frameWidth': 867,
 'frameHeight': 1038,
 'zoomSpeedIn': 300,
 'zoomSpeedOut': 300,
 'overlayShow': true
   });  
}); 
$(document).ready(function() { 
	$("a#directions").fancybox({ 
	'hideOnContentClick': true,
	'type': 'ajax',
	'centerOnScroll': false,
	'zoomSpeedIn': 300,
	'zoomSpeedOut': 300,
	'frameWidth': 443,
	'frameHeight': 453,
	'imageScale': true,
	'overlayShow': true,
	'hideOnContentClick': false
	}); 
});
$(document).ready(function($){			
	$('.preloadsummary').fadeIn('slow');
	
	/**
	 * All the functions below, are used to update the summary div
	 * That is not the objective of the plugin, the really important part 
	 * is the one right below. The option placeholder, and threshold.
	 */
	$.preload('.slideshow li img', {//the first argument is a selector to the images
		onRequest:request,
		onComplete:complete,
		onFinish:finish,
		//placeholder:'../img/placeholder.jpg',//this is the really important option
		//notFound:'../img/notfound.jpg',//optional image if an image wasn't found
		threshold: 1 //'2' is the default, how many at a time, to load.
	});
	
	function update( data ){
		$('.total').html(''+data.total );
		$('.loaded').html(''+data.loaded );
	};
	function complete( data ){
		update( data );
		$('#image-next').html( 'none' );//reset the "loading: xxxx"
		$('#image-loaded').html( data.image );
	};
	function request( data ){
		update( data );
		$('#image-next').html( data.image );//set the "loading: xxxx"
	};
	function finish(){//hide the summary
	if ($('#slideshowNav') != null){
		$('.preloader').fadeOut('slow');
		if ($('.slideshow') != null){
		$(function() {
		$('.slideshow').cycle({
		fx: 'fade',
		speed: 2000,
		timeout: 10000,
		pause: 1,
		random: 1,
		pager: '#slideshowNav',
		delay: -4000,
		pauseOnPagerHover: true 
		});
		});
}
}
	};

});
	

