//Before Page Load
Cufon.replace('#topNav ul li a', {hover:true});
Cufon.replace('.fakeHeader', {hover:true});
Cufon.replace('.toggle p', {hover:true});
Cufon.replace('.smallToggle p', {hover:true});
Cufon.replace('.smallToggle a', {hover:true});
Cufon.replace('a.sizing', {hover:true});
Cufon.replace('h1', {hover:true});
Cufon.replace('h2', {hover:true});
Cufon.replace('h3', {hover:true});
Cufon.replace('#headerQuote', {hover:true});

$(document).ready(function() {
    
    //On Page Load
    $('#sideBarBrands').hide();
    $('#sideBarSizes').hide();
    $('#sideBarTypes').hide();
    $('#sideBarFootProblem').hide();
    $('#sideBarSizeGuide').hide();
    $('#sideBarStyle').hide();
    $('#sideBarLength').hide();
    
    //Check current page and see what nav to expand
    var slug = document.location.pathname;
    if(slug.match(/dresses\/designers/)){
        $('#sideBarBrands').show();
    }
    if(slug.match(/dresses\/size/)){
        $('#sideBarSizes').show();
    }
    if(slug.match(/dresses\/occasion/)){
        $('#sideBarTypes').show();
    }
    
    if(slug.match(/foot-problem-advice/)){
        $('#sideBarFootProblem').show();
    }  
     
    if(slug.match(/size-guide/)){
        $('#sideBarSizeGuide').show();
    }
    
    if(slug.match(/advice-guides/)){
        $('#sideBarFootProblem').show();
    }
    
    if(slug.match(/dresses\/styles/)){
        $('#sideBarStyle').show();
    }    
    
    if(slug.match(/dresses\/length/)){
        $('#sideBarLength').show();
    }
    
    //On Click
    $('#sizes').click(function() {
        $('#sideBarSizes').toggle('slow');
    });

    $('#brands').click(function() {
        $('#sideBarBrands').toggle('slow');
    });
    
    $('#types').click(function() {
        $('#sideBarTypes').toggle('slow');
    });
    
    $('#footProblem').click(function() {
        $('#sideBarFootProblem').toggle('slow');
    });
    
    $('#sizeGuide').click(function() {
        $('#sideBarSizeGuide').toggle('slow');
    });
    
    $('#style').click(function() {
        $('#sideBarStyle').toggle('slow');
    });
    
    $('#length').click(function() {
        $('#sideBarLength').toggle('slow');
    });
});

$(window).load( function() {
    $("#viewerWrap").jCarouselLite({
        btnNext: "#imgNext",
        btnPrev: "#imgPrev"
    });
    $("#viewerWrapBrandMain").jCarouselLite({
        btnNext: "#imgNext",
        btnPrev: "#imgPrev"
    });
});
