/**
 * Javascript: Scripts
 * 
 * Rapid Javascript development.
 * 
 * @package Morx Media
 * @subpackage JS
 */
/** Top Graphic **/
(function($) {
    $(document).ready(function() {
        $('#clouds').pan({
            fps: 30,
            speed: 0.5,
            dir: 'right'
        });
    });
})(jQuery); /** END Top Graphic **/



/** Facebook Like Button **/
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {
        return;
    }
    js = d.createElement(s);
    js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk')); /** END Facebook Like Button **/


/*digg digg*/
jQuery(document).ready(function($) {

    var $postShare = $('#social-float');

    if ($('.dd_content_wrap').length > 0) {

        var descripY = parseInt($('.dd_content_wrap').offset().top) - 20;
        var pullX = $postShare.css('margin-left');

        $(window).scroll(function() {

            var scrollY = $(window).scrollTop();
            var fixedShare = $postShare.css('position') == 'fixed';

            if ($('#social-float').length > 0) {

                if (scrollY > descripY && !fixedShare) {
                    $postShare.stop().css({
                        position: 'fixed',
                        top: 16
                    });
                } else if (scrollY < descripY && fixedShare) {
                    $postShare.css({
                        position: 'absolute',
                        top: descripY,
                        marginLeft: pullX
                    });
                }

            }

        });
    }
});




$(document).ready(function(){
    $('#menu-item-797').hover(function(){
        $('#menu-item-797 a').css('backgroundPosition', '95px -41px');
    }, function(){
        $('#menu-item-797 a').css('backgroundPosition', '95px 23px');
    });
});

/*colorbox*/
		$(document).ready(function(){
			$(".Portfolio-Link, .value a").colorbox({iframe:true, width:"80%", height:"80%"});
			$(".inline").colorbox({inline:true, width:"50%"});
		});


