/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function removeElementAnimated(element) {
    element
        .delay(1000)
        .animate({
            'background-color' : 'red',
            'color' : 'white'
        },2000,'easeOutBounce',function() {
            element.remove();
        }
    );
}

/* Delete tr row */
function deleteRow(row) {
    row.toggleClass('delete',1000, function() {
        var tr = row;
        tr.children("td").each(function() {
            $(this).wrapInner('<div style="overflow:hidden"></div>').children("div").slideUp(500,function() {
                tr.remove();
            });
        });
    });
}
if (typeof jQuery != 'undefined') { 
    $(document).ready(function() {
        /* Social buttons */
        $("div.pro div.social a")
            .css('opacity', 0.4)
            .mouseover(function(){$(this).fadeTo('fast',1);})
            .mouseout(function(){$(this).fadeTo('fast',0.4);})
            .click(function(){
                _gaq.push(['_trackEvent', 'Social','share',$(this).attr('class'),window.location.href]);
            });
            /* Social follow bar */
        $('div.pro div.socialfollow').delay(3000).animate({right:'0'},1000,'easeInBounce',function(){ $(this).find('a').delay(3000).fadeTo('fast', 0.4); });
        /* Social follow buttons */
        $('div.pro div.socialfollow a')
            .mouseover(function(){$(this).fadeTo('fast',1);})
            .mouseout(function(){$(this).fadeTo('fast',0.4);})
            .click(function(){
                _gaq.push(['_trackEvent', 'Social','follow',$(this).attr('class')]);
            });
            
        $.extend($.fn.disableTextSelect = function() {
                return this.each(function(){
                        if($.browser.mozilla){//Firefox
                                $(this).css('MozUserSelect','none');
                        }else if($.browser.msie){//IE
                                $(this).bind('selectstart',function(){return false;});
                        }else{//Opera, etc.
                               // $(this).mousedown(function(){return false;});
                                 $(this).bind('selectstart',function(){return false;});
                       }
                });
        });
        $('.noSelect').disableTextSelect();//No text selection on elements with a class of 'noSelect'
    });
}

