// JavaScript Document
var $j = jQuery.noConflict();

$j(document).ready(function(){
		//at first hide the sub lists (if javascript is disabled all sublists remain usable)
		$j("#sideNav>li>ul").hide();		
		//Open the subnav for pages needed
		$j("body.page-id-113 ul#sideNav li ul").show();
		$j("body.page-id-12 ul#sideNav li ul").show();
		$j("body.page-id-115 ul#sideNav li ul").show();
		$j("body.page-id-222 ul#sideNav li ul").show();
		//when a link (that is a child of #vnav) is clicked call a function
		$j("#sideNav a").click(function(){
			//if the clicked link has a sibling ul, stop following the link and slide open (or close) the ul
			if($j(this).next("ul").length > 0) {
				$j(this).next("ul").slideToggle();
				return false;
			}
		});
	});			
		$j(document).ready(function(){
				$j(".page-id-3 #leftCol").css(/*"visibility","hidden", */"width","0px");												
				$j(".heroFade").show();	
				$j(".homeBanner").show();		
    		$j('.homeBanner').click(function(){
      		$j('.heroFade, .homeBanner, .heroFadeWrap').fadeOut('500');
					$j(".page-id-3 #leftCol").css("width","280px");
					//$j(".page-id-3 #leftCol").fadeIn('1000');	
					//$j('#leftCol').css("display","inline-block");
      	return false;
				
    });
  }); 
		
	$j(document).ready(function() { 
			$j('.heroFade').cycle({
				fx:	'fade',
				speed: 1500,
				timeout: 4000
				});
		});		
	
$j(function()
			{
			$j('#section').jScrollPane({showArrows:false});
		});

 
 
function mycarousel_initCallback(carousel) {
    $j('.jcarousel-control a').bind('click', function() {
        carousel.scroll($j.jcarousel.intval($j(this).text()));
        return false;
    });

    $j('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = $j.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    $j('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    $j('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

// Ride the carousel...
$j(document).ready(function() {
    $j("#mycarousel").jcarousel({
        scroll: 3,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});


// Shopping cart
// Hide Shipping and Order panels
$j(document).ready(function() {
	$j('.shipDetails, .yourOrder').hide();
	// Show Shipping details and hide Cart details
	$j('.checkOutBtn').click(function(){
			$j('.shipDetails').show();
			$j('.yourCart').hide();
			return false;
	});
	$j('.backCartBtn').click(function(){
			$j('.yourCart').show();
			$j('.shipDetails').hide();
			return false;
	});
	$j('.FinalOrderBtn').click(function(){
			$j('.yourOrder').show();
			$j('.shipDetails').hide();
			return false;
	});
	$j('.backShipBtn').click(function(){
			$j('.yourOrder').hide();
			$j('.shipDetails').show();
			return false;
	});
});	

									 