
$(document).ready(function() {

// The Tabs

$("ul.tabnav").tabs("div.tabdiv > div", {
		
		effect: 'fade',
		// start from the beginning after the last tab
	rotate: true,
		
		onBeforeClick: function(event, i) {
	
			// get the pane to be opened
			var pane = this.getPanes().eq(i);
	
			// only load once. remove the if ( ... ){ } clause if you want the page to be loaded every time
			if (pane.is(":empty")) {
	
				// load it with a page specified in the tab's href attribute
				pane.load(this.getTabs().eq(i).attr("href"));
			}	
		}
		
		
		
	}).slideshow({interval: 9000, autoplay:true, clickable:false});
    
   
     
// Stop the auto play when clikced
$('ul.tabnav > li').click(function() {
		$('ul.tabnav').data("slideshow").stop();
  });
  
  
  
  // FreeTrial Tooltip
  $("div.boxOutline img[title]").tooltip({
   // tweak the position
   offset: [15, 25],
   effect: 'slide'
}).dynamic({ bottom: { direction: 'down', bounce: true } });  




// FreeTrial Tooltip (Final)
  $("#freeTrialTooltip").tooltip({
   // tweak the position
   offset: [15, 0],
   effect: 'slide'
}).dynamic({ bottom: { direction: 'down', bounce: true } }); 







 // Flexible Spending Dollars (on Shop page left side (Secondary page for purchase)) Tooltip
 $("div.shopSideBarCont2 img[title]").tooltip({
   // tweak the position
   offset: [20, 0],
   effect: 'slide'
}).dynamic({ bottom: { direction: 'down', bounce: true } });  


  

//The rounded corners
$('#panelsWrapper li a').each(function() {
              var q = $(this).corner("rounded 12px");
              eval(q);
                    
    });
      
      
  
   
      
      
});



// slideshow for image switch on the gere character
function slideSwitch() {
    var $active = $('#slideshow .active');
    if ( $active.length == 0 ) $active = $('#slideshow img:last');
	    var $next =  $active.next().length ? $active.next()
	    : $('#slideshow img:first');

	    $active.addClass('last-active');

	    $next.css({opacity: 0})
		    .addClass('active')
        //adjust value to change the time taken to fade between images
		    .animate({opacity: 1}, 1800, function() {
		    $active.removeClass('active last-active');
	    });
    }

 setInterval( "slideSwitch()", 5000 );

