/***************************************************************************
 * @Copyright: CSSJockey - Unique & Practical Web Presence
 * @Website: http://www.cssjockey.com/
 * @Portfolio: http://www.cssjockey.com/portfolio
 * @Contact: http://www.cssjockey.com/get-in-touch
 * @Privacy Policy & Terms of Use: http://www.cssjockey.com/terms-of-use
 ***************************************************************************/

jQuery.noConflict();


jQuery(document).ready(function(){

    // Main Navigation
    jQuery("#sidebar-control-open").fadeIn(600);
    jQuery("#sidebar-control-open").bind('click', function(){
        jQuery("#sidebar").animate( { width:"200px" }, { queue:false, duration:500 })
        jQuery(this).hide(0);
        jQuery("#sidebar-control-close").show(0);
    })
    jQuery("#sidebar-control-close").bind('click', function(){
        jQuery("#sidebar").animate( { width:"0px" }, { queue:false, duration:500 })
        jQuery(this).hide(0);
        jQuery("#sidebar-control-open").show(0);
    })


    jQuery("#sidebar ul li a").hover(function(){
        jQuery(this).animate( { marginLeft: "10px" }, { queue:false, duration:200 })
    },function(){
        jQuery(this).animate( { marginLeft: "0px" }, { queue:false, duration:200 })
    })

    //Scroll
    jQuery(".scroll").click(function(event){
        event.preventDefault();
        var full_url = this.href;
        var parts = full_url.split("#");
        var trgt = parts[1];
        var target_offset = jQuery("#"+trgt).offset();
        var target_top = target_offset.top;
        jQuery('html, body').animate({
            scrollTop:target_top
        }, 1000);
    });

    

})
