$(document).ready(function () {
    $('#basic-modal input.basic, #basic-modal a.basic').click(function (e) {
        e.preventDefault();
        $('#basic-modal-content').modal();
    });
    /* plugin */
    jQuery.fn.dwFadingLinks = function (settings) {
        settings = jQuery.extend({
            color: '#eeeeee',
            duration: 500
        }, settings);
        return this.each(function () {
            var original = $(this).css('color');
            $(this).mouseover(function () {
                $(this).animate({
                    color: settings.color
                }, settings.duration);
            });
            $(this).mouseleave(function() { $(this).stop(settings.duration); });
            $(this).mouseout(function () {
                $(this).animate({
                    color: original
                }, settings.duration);
            });
        });
    };

    /* usage */

    $('.fade').dwFadingLinks({
        color: '#fff',
        duration: 300
    });

    $('a.mastersp_th').click(function (e) {
        $('#mastersp_details').modal({
            opacity: 75,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
    $('a.insight_th').click(function (e) {
        $('#insight_details').modal({
            opacity: 75,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });
    $('a.melani_th').click(function (e) {
        $('#melani_details').modal({
            opacity: 75,
            overlayClose: 'true',
            onOpen: function (dialog) {
                dialog.overlay.fadeIn('slow', function () {
                    dialog.data.hide();
                    dialog.container.fadeIn('slow', function () {
                        dialog.data.slideDown('slow');
                    });
                });
            }
        });
    });


    $(".pf_img").hover(function () { //On hover...
        var thumbOver = $(this).find("img").attr("src");
        $(this).find("a.thumb").css({
            'background': 'url(' + thumbOver + ') no-repeat center bottom'
        });
        $(this).find("span").stop().animate({
            opacity: 0
        }, 300);
    }, function () {
        $(this).find("span").stop().animate({
            opacity: 1
        }, 300);
    });


    $('#social a').each(function () {
        $('<div class="fader" style="cursor: pointer"/>').css('opacity', 0).prependTo(this);
    }).hover(function () {
        $('img', this).stop().animate({
            marginLeft: 5
        }, 250);
        $('.fader', this).stop().animate({
            opacity: 0.15
        });
    }, function () {
        $('img', this).stop().animate({
            marginLeft: 10
        }, 250);

        $('.fader', this).stop().animate({
            opacity: 0
        });
    }).find('img').css('marginLeft', 10);

    $('#contacts a').each(function () {
        $('<div class="fader" style="cursor: pointer"/>').css('opacity', 0).prependTo(this);
    }).hover(function () {
        $('img', this).stop().animate({
            marginLeft: 5
        }, 250);
        $('.fader', this).stop().animate({
            opacity: 0.15
        });
    }, function () {
        $('img', this).stop().animate({
            marginLeft: 10
        }, 250);

        $('.fader', this).stop().animate({
            opacity: 0
        });
    }).find('img').css('marginLeft', 10);




  
});
