/**
 * @author Daniel Noormohamed
 */

$(document).ready(function () {
	
	$('.w300 .W940rightContent .tabmenu').css('display', 'block');
	$('.tab_text ul .tab_content').css({'position':'relative','display':'none'})
								.each(function () {
								//	$('h2:first', this).hide();
								});
	
	$('.tabContainer').css('height','27px')
		.find('.tabmenu').css('display','block')
		.find('li').live('click', function () {
				$('.tabContainer .tabmenu li').removeClass('selected');
				$(this).addClass('selected');
				var getContainer = $(this).attr('get');
				$('.tab_text ul li.selected').css('display','none').removeClass('selected');
				$('.tab_text ul li.' + getContainer).css('display','block').addClass('selected');
		});	

	//$('.slpContentArea .thumbnailslider').jcarousel({'scroll': 2});	
	/*
	$('body').Sleep(500, function () {
		$('.tabContainer .tabmenu li:first').trigger('click');
	});
	*/
	
	if($('.slpContentArea .w380 .wrapper').size() == 1) {
			
			var slp = {
				width : $('.slider_list li').width(),
				elements : $('.slider_list li').size()
			};
			
			//$('.slpContentArea .w380 .wrapper').width(slp.elements*slp.width);
			if(slp.elements > 1) {
				$('.slpContentArea .w380 .content').anythingSlider({
			        easing: "easeInOutBack",                // Anything other than "linear" or "swing" requires the easing plugin
			        autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
			        startStopped: false,            // If autoPlay is on, this can force it to start stopped
			        delay: 15000,                    // How long between slide transitions in AutoPlay mode
			        animationTime: 1000,             // How long the slide transition takes
			        hashTags: false,                 // Should links change the hashtag in the URL?
			        buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
			        pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
			        startText: "",             // Start text
			        stopText: "",               // Stop text
			        navigationFormatter: null       // Details at the top of the file on this use (advanced use)
				});			
			}
			
	}
	
});