$()

in js/custom.js [38:542]


$(document).ready(function() {
    /***** form placeholder for IE *****/
    if(!Modernizr.input.placeholder){

        $('[placeholder]').focus(function() {
            var input = $(this);
            if (input.val() == input.attr('placeholder')) {
                input.val('');
                input.removeClass('placeholder');
            }
        }).blur(function() {
            var input = $(this);
            if (input.val() == '' || input.val() == input.attr('placeholder')) {
                input.addClass('placeholder');
                input.val(input.attr('placeholder'));
            }
        }).blur();
        $('[placeholder]').parents('form').submit(function() {
            $(this).find('[placeholder]').each(function() {
                var input = $(this);
                if (input.val() == input.attr('placeholder')) {
                    input.val('');
                }
            })
        });

    }									






    /*
    |--------------------------------------------------------------------------
    | BOOTSTRAP ELEMENTS 
    |--------------------------------------------------------------------------
    */ 


   


    /*
    |--------------------------------------------------------------------------
    | PRETTY PHOTOS
    |--------------------------------------------------------------------------
    */      
    if( $("a.prettyPhoto").length){
        $("a.prettyPhoto").prettyPhoto({
            animation_speed:'fast',
            slideshow:10000, 
            hideflash: true,
            social_tools:false
        });
    }

    /*
    |--------------------------------------------------------------------------
    | TOOLTIP
    |--------------------------------------------------------------------------
    */
    $('.tips').tooltip();
    
    /*
    |--------------------------------------------------------------------------
    | COLLAPSE
    |--------------------------------------------------------------------------
    */
    

    $('.accordion').on('show hide', function(e){
        $(e.target).siblings('.accordion-heading').find('.accordion-toggle i').toggleClass('icon-right-circle icon-down-circle', 200);
    });

    /*
    |--------------------------------------------------------------------------
    | CONTACT
    |--------------------------------------------------------------------------
    */   
    $('.slideContact').click(function(e){

        if ( $(window).width() >= 800){

            $('#contact').slideToggle('normal', 'easeInQuad',function(){

                $('#contactinfoWrapper').css('margin-left', 0);
                $('#mapSlideWrapper').css('margin-left', 3000);
                $('#contactinfoWrapper').fadeToggle();
                

            });
            $('#closeContact').fadeToggle(); 
            return false;
            
        }else{

            return true;
            
        }
    });
    
    
    $('#closeContact').click(function(e){


        $('#contactinfoWrapper').fadeOut('normal', 'easeInQuad',function(){
            $('#contactinfoWrapper').css('margin-left', 0);
            $('#mapSlideWrapper').css('margin-left', 3000);
        });
        
        $('#contact').slideUp('normal', 'easeOutQuad');

        $(this).fadeOut();

        e.preventDefault();
        
    });
    



    
    
    /* MAP */
    $('#mapTrigger').click(function(e){


        $('#mapSlideWrapper').css('display', 'block');
        initialize('mapWrapper');
        
        $('#contactinfoWrapper, #contactinfoWrapperPage').animate({
            marginLeft:'-2000px' 
        }, 400, function() {}); 
        
        
        $('#mapSlideWrapper').animate({
            marginLeft:'15px' 
        }, 400, function() {});  
        
        appendBootstrap();

        e.preventDefault();
    });
    
    
    $('#mapTriggerLoader').click(function(e){


        $('#mapSlideWrapper, #contactinfoWrapperPage').css('display', 'block');

        $('#contactinfoWrapper, #contactinfoWrapperPage').animate({
            marginLeft:'-2000px' 
        }, 400, function() {}); 
        
        
        $('#mapSlideWrapper').animate({
            marginLeft:'15px' 
        }, 400, function() {});  

        
        appendBootstrap();
        
        e.preventDefault();
    });
    
    
    $('#mapReturn').click(function(e){
        //$('#mapWrapper').css('margin-bottom', '3em');
        

        $('#mapSlideWrapper').animate({
            marginLeft:'3000px' 
        }, 400, function() {});       
        

        $('#contactinfoWrapper, #contactinfoWrapperPage').animate({
            marginLeft:'0' 
        }, 400, function() {
            $('#mapSlideWrapper').css('display', 'none');
        }); 

        e.preventDefault();
    }); 


    /*
    |--------------------------------------------------------------------------
    | SCROLL (portfolio horizontal)
    |--------------------------------------------------------------------------
    */    
    if($("div#makeMeScrollable").length){
        $("div#makeMeScrollable").smoothDivScroll({

            touchScrolling:true,
            mousewheelScrolling: "vertical"
        });


        $('.showInfo').click(function(e){

            $('.pInfo').find('h3').css('margin-top' , '-400px');
            $('.pInfo').css('display', 'none');
            $(this).next('div').slideDown(300);
            $('.showInfo').not($(this)).animate({
                marginTop:0
            });
            $(this).animate({
                marginTop:$(this).width()
            }, 300);
            $(this).next('div').slideDown(300);
            $(this).next('div').children('h3').animate({
                marginTop:-5
            }, 300);

            e.preventDefault();

        });
        
        $('.closeInfo').click(function(e){

            $(this).parent().slideUp('normal');
            $(this).parent().children('h3').animate({
                marginTop:-400
            }, 200, function() {
                $(this).parent().css('display', 'none');
            });
            $(this).parent().parent().find('img').animate({
                marginTop:0
            });
            
            e.preventDefault();

        });

    }

    /*
    |--------------------------------------------------------------------------
    | FLEXSLIDER
    |--------------------------------------------------------------------------
    */ 
    if($('.flexslider').length){
        $('.flexslider').flexslider({
            animation: "slide",
            controlNav: true,
            directionNav: true,
            slideshow: true,
            start: function(slider){

                setTimeout("animateTxt("+slider.currentSlide+", 'off')", 300);    
            },
            before: function(slider){

                animateTxt(slider.currentSlide, 'on');

            },
            after: function(slider){
                setTimeout("animateTxt("+slider.currentSlide+", 'off')", 300);  

            }

        });
        
        
        /* SILDER OVERLAY ON RESIZE */
        $(window).resize(function() {
            $('.tramOverlay').height($('.slides li img').height());
        });

    }
	    /*
    |--------------------------------------------------------------------------
    | SEQUENCE SLIDER
    |--------------------------------------------------------------------------
    */

    if($('#sequence').length){
        var options = {
            nextButton: true,
            prevButton: true,
            pagination: true,
            animateStartingFrameIn: true,
            autoPlayDelay: 3000,
            preloader: true,
            preloadTheseFrames: [1],
            preloadTheseImages: [
            "images/slider/sequence/tn-model1.png",
            "images/slider/sequence/tn-model2.png",
            "images/slider/sequence/tn-model3.png"
            ]
        };

        var mySequence = $("#sequence").sequence(options).data("sequence");
    }


    /*
    |--------------------------------------------------------------------------
    | DIRECTIONAL ROLLOVER AND HOVER EFFECTS
    |--------------------------------------------------------------------------
    */     

    if($('.da-thumbs').length){
        $('.da-thumbs article a').hoverdir();
    }
    
    
    if($('.da-thumbs ').length){

        $('article a').hover(
            function () {

                /*var centerArticle = ($('a section', this).height()/2 - $('a div span', this).outerHeight(true)/2) + 4; 
                $('a div', this).css('padding-top', centerArticle+'px');*/

                var fromTop = ($('section img', this).height()/2 - $('.iconLink', this).outerHeight()/2) ;
                $('.iconLink', this).css('margin-top', fromTop);


                if ($.browser.chrome || $.browser.webkit ) {

                    $(this).find('section img').css('-webkit-transform', 'scale(1.5) ');
                }
                else if ($.browser.mozilla){

                    $(this).find('section img').css('-moz-transform', 'scale(1.5) rotate(0.1deg)');

                }else if($.browser.opera){

                    $(this).find('section img').css('-o-transform', 'scale(1.5)'); 
                    
                }else if($.browser.msie){

                    $(this).find('section img').css('-ms-transform', 'scale(1.5)'); 

                } 



            }, 
            function () {

                if ($.browser.chrome || $.browser.webkit) {

                    $(this).find('section img').css('-webkit-transform', 'scale(1) ');

                } else if ($.browser.mozilla){

                    $(this).find('section img').css('-moz-transform', 'scale(1) rotate(0deg)');

                } else if($.browser.opera){

                    $(this).find('section img').css('-o-transform', 'scale(1)'); 
                    
                } else if($.browser.msie){

                    $(this).find('section img').css('-ms-transform', 'scale(1)'); 

                }    
            }
            );
}



    /*
    |--------------------------------------------------------------------------
    | ROLLOVER BTN
    |--------------------------------------------------------------------------
    */ 

    $('.socialIcon').hover(
        function () {
            $(this).stop(true, true).addClass('socialHoverClass', 300);
        },
        function () {
            $(this).removeClass('socialHoverClass', 300);
        });





    $('.tabs li, .accordion h2').hover(
        function () {
            $(this).stop(true, true).addClass('speBtnHover', 300);
        },
        function () {
            $(this).stop(true, true).removeClass('speBtnHover', 100);
        });



    

    /*
    |--------------------------------------------------------------------------
    | ALERT
    |--------------------------------------------------------------------------
    */ 
    $('.alert').delegate('button', 'click', function() {
        $(this).parent().fadeOut('fast');
    });
    
    
    /*
    |--------------------------------------------------------------------------
    | CLIENT
    |--------------------------------------------------------------------------
    */   
    
    if($('.colorHover').length){
        var array =[];
        $('.colorHover').hover(

            function () {

                array[0] = $(this).attr('src');
                $(this).attr('src', $(this).attr('src').replace('-off', ''));

            }, 

            function () {

                $(this).attr('src', array[0]);

            });
    }


    /*
    |--------------------------------------------------------------------------
    | UP AND DOWN & MENU BTNS PORTFOLIO STATIC
    |--------------------------------------------------------------------------
    */ 

    $('.goDown').click(function(e){

        var offset = $(this).parents().next('section').offset();
        var variation = ($('.navbar-fixed-top').length)?$('.navbar-fixed-top').outerHeight(true) +20 :90;
        var finalPos  = offset.top - variation;
        
        scrollTo(finalPos, 500);
        e.preventDefault();
        
    });


    $('.goUp').click(function(e){

        var offset = $(this).parents().prev('section').offset();
        var variation = ($('.navbar-fixed-top').length)?$('.navbar-fixed-top').outerHeight(true) +20:90;
        var finalPos  = offset.top - variation;
        
        scrollTo(finalPos, 500);
        e.preventDefault();
    }); 
    

    $('.PortfolioStickyMenu ul li a').click(function(e){


        var targetId =  $(this).attr('href');
        var offset = $(targetId).offset() ;
        var variation = ($('.navbar-fixed-top').length)?$('.navbar-fixed-top').outerHeight(true) +20:90;
        var finalPos  = offset.top - variation;

        scrollTo(finalPos , 500); 
        e.preventDefault();

        
    });

/*
|--------------------------------------------------------------------------
| SHARRRE
|--------------------------------------------------------------------------
*/
if($('#shareme').length){
    $('#shareme').sharrre({
      share: {
        googlePlus: true,
        facebook: true,
        twitter: true
    },
    buttons: {
        googlePlus: {size: 'tall', annotation:'bubble'},
        facebook: {layout: 'box_count'},
        twitter: {count: 'vertical'},    
    },
    enableHover: false,
    enableCounter: false,
    enableTracking: true,
    url:document.location.href
});
}

//INCLUDE HTML file
$('[data-load]').each(function() {
  $(this).load($(this).data("load"));
});

//END DOCUMENT READY   
});