/*
 * jQuery Custom Site 
 * http://www.lostpropaganda.net
 * Copyright (c) 2010 Brian Gebel
 * Version: 1.0 (09/21/2010)
 * Requires: jQuery v1.2.6 or later and jQuery Cycle Plugin v2.88 or later
 */

// Stops Conflicts from forming with in jQuery
jQuery.noConflict();

/* --------------------------------------------------------------
	General Functions
-------------------------------------------------------------- */
// Driver Function
function mainCustom() {
	startCycleScript(); // Function call
	startFancyBox(); // Function call
}

/* --------------------------------------------------------------
	JQuery Cycle Functions
-------------------------------------------------------------- */
// Dynamic CSS and and HTML
function startCycleScript() {
	
	// Dynamic Div control
	jQuery('#loading-animation').remove();
	jQuery(".slideshow").css('display','block');
	jQuery(".slideshow-controls").css('display','block');
	
	// Function Call
	cycleControls();
	
	// Starts Cycle Script
	jQuery(document).ready(function() {
		jQuery('.slideshow').cycle({
			fx: 'fade',
			speed: 700,
			pauseOnPagerHover: true,
		});
	});
}
// Cycle Controls
function cycleControls() {
	jQuery('#home-feature').css('display','block'); // Displays Div
	jQuery('#home-feature').hover(
		function(){jQuery('.slideshow').cycle('pause')},
		function(){jQuery('.slideshow').cycle('resume')});
}
/* --------------------------------------------------------------
	JQuery FancyBox Functions
-------------------------------------------------------------- */
function startFancyBox() {
		jQuery(document).ready(function() {
			jQuery("a[rel=img-group]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
		});
}
/* --------------------------------------------------------------
	THE END
-------------------------------------------------------------- */
