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

/*$j(function()
			{
			$j('#section').jScrollPane({showArrows:true});
});*/
    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
    });
});

$j(document).ready(function(){
				$j(".heroFade").show();	
				$j(".homeBanner").show();		
    		$j('.heroFade, .homeBanner').click(function(){
      		$j('.heroFade, .homeBanner').fadeOut('1000');
      	return false;
    });
  }); 

/*$j(document).ready(function(){
	$j(window).load( function () {
	$j('.collFade').delay(4000).fadeOut(1000);
	})
.end();
});*/

$j(function(){
				$j(".nextArrow").hide();
				$j(".collFade").show();	
				$j("body.pod-page-shoes .collFade").hide();
				$j("body.pod-page-footwear-aw12 .collFade").remove();
				$j("body.pod-page-footwear-ss11-12 .collFade").remove();
				$j("body.pod-page-footwear-aw11 .collFade").remove();
				$j('.collFade').click(function(){
      	$j('.collFade').fadeOut('1000');
				$j(".nextArrow").fadeIn('1000');
      	return false;
    });
  });

$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.pod-page-spirit ul#sideNav li.collection ul").show();
		$j("body.pod-page-love ul#sideNav li.collection ul").show();
		$j("body.pod-page-sleepwalking ul#sideNav li.collection ul").show();
		$j("body.pod-page-untitled ul#sideNav li.collection ul").show();
		$j("body.pod-page-cosmic-poetry ul#sideNav li.collection ul").show();
		$j("body.pod-page-near-the-light ul#sideNav li.collection ul").show();
		$j("body.pod-page-footwear-aw12 ul#sideNav li.shoes ul").show();
		$j("body.pod-page-footwear-ss11-12 ul#sideNav li.shoes ul").show();
		$j("body.pod-page-footwear-aw11 ul#sideNav li.shoes ul").show();
		$j("body.page-id-17 ul#sideNav li.collection ul").show();
		$j("body.wpsc ul#sideNav li.shop ul").show();
		/*$j("body.wpsc-category-5 ul#sideNav li.shop ul").show();
		$j("body.wpsc-category-4 ul#sideNav li.shop ul").show();
		$j("body.wpsc-category-3 ul#sideNav li.shop 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(function() { 
			$j('.heroFade').cycle({
				fx:	'fade',
				speed: 1000,
				timeout: 4000
				});
		});


$j('div.producttext').hover(function() {
  $j(this).addClass('display');
}, function() {
  $j(this).removeClass('display');
});

			
Cufon.replace('.post h2')('.post h3')('span#caption')('.collBtn')('h2#respond')('.blog-menu a')('.blog-tagline span')('.posted')('.post-nav')('.widget_archive')('body.archive #section h3');
$j(function() {
    $j('.sizing').click(function(){
        $j('.sizeChart').fadeIn('slow');
    return false;
    });
});
$j(function() {
    $j('.sizeClose').click(function(){
        $j('.sizeChart').fadeOut('slow');
    return false;
    });
});

$j(function(){
    //Header search remove text
		$j('#mc_mv_EMAIL').val('Join the KUWAII Mailing List');		
    $j('#mc_mv_EMAIL').focus(function(){
        if($j(this).val() == 'Join the KUWAII Mailing List'){
            $j(this).val('');
        } 
    });
});
jQuery(function(){
	jQuery('.widget_archive').append("<h2 class='site-link'><a href=''>Back to Site</a></h2>");
});

