// jQuery Manual Cycle Version 1.0

// #### Created by Krishan Veerappa & NX - Studio 29/04/2010 ####
// www.nx-studio.net/

// Manually cycles an element associated with an class ('elementClass') when the appropriate trigger ('cycleLink') is clicked
// The jQuery uses the name attribute from the trigger to associate with the correct element

$(document).ready(function(){
	activeElement = activeElementClass;
	activeElementClass = '.'+activeElementClass;

	$('.'+elementClass).css({'opacity' : '0.0'});
	$(activeElementClass).css({'opacity' : '1.0'});
	$(cycleLink).hover(		
		function (){
			var getReqElement = $(this).attr('name');
			var getCurrentid = $(activeElementClass).attr('id');
			
			if (getReqElement == getCurrentid) {return false;}
				else{
					if (!getReqElement) {return false;}
						else{
							fadeElementOut(activeElementClass),
							$(activeElementClass).removeClass(activeElement);
							$('#'+getReqElement).addClass(activeElement);
							fadeElementIn('#'+getReqElement), $(activeElementClass).show();
							return false;
						};				
					}
		}
	);
});

function fadeElementOut(selected){$(selected).fadeTo(fadeSpeed, 0.0);}
function fadeElementIn(selected){$(selected).fadeTo(fadeSpeed, 1.0);}


//###### The Script Below Needs to be Placed in the HTML or a Separate .js file to Enable this Function to Work ######
/*

<script type="text/javascript">
	// Manual Cycle Varibles
	var elementClass = '####'; // Class Assiociated Elements to Cycle Through
	var cycleLink = '####'; // Link to Trigger Manual Cycle
	var fadeSpeed = 300; // Fade Speed (Select 0 for instant cycle)
	var activeElementClass = '####'; // Choose a Unique Class (without the '.') to use for the Default Element that will show first when loaded
</script>

*/
