$(document).ready(function() {

		/**** jQuery Cycle based slideshow ****/
		
		$('.cycle').cycle({ 
			timeout: 5000,
			speed:  1000, 
			before: onBefore 
		}); 
		 
		function onBefore() { 
			/// nothing just yet.
		}; 
	
		//call simple spy
		// $('ul.spy').simpleSpy(3, 10000);

	
	
	var speeds = [1000, 500, 250];
		var $sectionLinks = $('div.sectionLinks ul li');
		
		$sectionLinks.find('p').css({ opacity: 0 });
		
		$sectionLinks.hover(function(e)
		{
			var $this = $(this);
			$this.find('p').stop(true,false).animate({ opacity: 1 }, speeds[1]);
			$(this).parent().find('li').not(this).stop(true,false).animate({ opacity: 0.6 }, speeds[1]);
		}, 
		
		function()
		{	
			$sectionLinks.stop(true,false).animate({ opacity: 1 }, speeds[2]).find('p').stop(true,false).animate({ opacity: 0 }, speeds[2]);
		});

		
		
		//labels
		
		$('input[title]').each(function(){
		
		
				if($(this).val() === '') 
				{
					$(this).val($(this).attr('title'));	
				}
				
				
				$(this).focus(function()
				{
				
					if($(this).val() == $(this).attr('title')) 
					{
						$(this).val('').addClass('focused');	
					}
				
				});
				
				
				$(this).blur(function()
				{
				
					if($(this).val() === '') 
					{
						$(this).val($(this).attr('title')).removeClass('focused');	
					}
					
				});
				
		});
		
		/* =========== BASIC ACCORDIAN TOOL ====================================================
		====================================================================================== */
		
		var $accordianHeadings = $('.accordian h3 a');
		if($accordianHeadings.length) {
			
			var $accDivs = $('.accordian div');
			
			$accDivs.hide();
			
			$accordianHeadings.click(function() {
				
				$accDivs.hide();
				$div = $(this).parent().find('+ div'); // Get the adjacent piece of content.
				$div.slideDown();
			
				return false;
			
			});
			$('.accordian div:first').show();
		}
		
		/* =========== SYSTEMS.php -- SECTION FADE & INFO ACTIONS ====================================================
		========================================================================================================= */
		
		
		
$('.productSelect div').css({'display':'none'});
		
		
		$('.productSelect ul li').hover(function(){
		
			if($(this).attr('id') == 'nextHero')
			{  
				$('#nextInfo').css({'display':'block', 'opacity':'0'}).stop(true,false).animate({'opacity':'1'},speeds[1]);
			//	$('#pharmacyMan').stop(true,false).animate({'opacity':'0.3'}, speeds[1]);
			}
			
				else {
					$('#pharmaInfo').css({'display':'block', 'opacity':'0'}).stop(true,false).animate({'opacity':'1'},speeds[1]);
				//	$('#nextPhase').stop(true,false).animate({'opacity':'0.3'},speeds[1]);
				}
		
			}, 
				
		function(){

				$('.productSelect div').stop(true,false).animate({'opacity':'0'},speeds[1], function(){$(this).css({'display':'none'});});
			//	$('.addons').stop(true,false).animate({'opacity':'1'},speeds[1]);
			
		});		

		
		
});//end document ready
