// benefits nav

$(function(){
	
		$('div.benefit_buttons a').click (function(){
	
			//get the id of benefit to fade in
			var targetID = $(this).attr('id').replace('hide_','show_');
			
			// if there are active img
			if ($('div#benefits img.active_img').length > 0) {
								
				//fade them out
				$('div#benefits p img.active_img').fadeOut(1000, function(){
				
					//when fade out is complete, fade in new content and flag it
					$('#'+targetID).fadeIn(1000).addClass('active_img');
				
					
				}).removeClass('active_img');
				
			}else{
			
			//fade in target ID and flag it 
			$('#'+targetID).fadeIn(1000).addClass('active_img');
			};
	
		
		
		// if there are active text
			if ($('div#benefit_text div.active_text').length > 0) {		
			
				//fade them out
				$('div#benefit_text div.active_text').fadeOut(1000, function(){
				
					//when fade out is complete, fade in new content and flag it		
					$('#text_'+targetID).fadeIn(1000).addClass('active_text');
					
				}).removeClass('active_text');
				
			}else{
			
			//fade in target ID and flag it 
			$('#text_'+targetID).fadeIn(1000).addClass('active_text');
			
			};
	
		});
	
	});
	
	
	
	
// benefits nav hover	
	
 $(function() {
            $('div.benefit_buttons img').animate({"opacity": .7 });

            $('div.benefit_buttons img').hover(function() {
                $(this).stop().animate({ "opacity": 1 });
            }, function() {
                $(this).stop().animate({ "opacity": .7 });
            });
        });



//Offers rollovers

$(function() {
        $('a.offerLinks').hover(function() {  
            $(this).children('.front').stop().animate({"opacity": .2 });
        }, function() {
            $(this).children('.front').stop().animate({"opacity": 1 });       
        });
    });
    

    
//striptease

$(function() {
       
        $('#stripImg').cycle({timeout:2000}).cycle('pause');
        
       	$('#pauseButton').click(function() { 
   		$('#stripImg').cycle('pause'); 
		});

		$('#resumeButton').click(function() { 
   		$('#stripImg').cycle('resume'); 
		});
        
        
});

         
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    