var twtStatus = 0;

$(document).ready(function(){
    $('.our-clients .clienthover').hide();
    $('.our-people-pics li a img:last').hide();
    $('#twittercont').hide();
    initPeople();  
    //initClients();  
    
    $('#followbtn').click(function(){    
    
        $(".twittercont").toggle("fast");
        $(this).toggleClass("active");       
      
       if(twtStatus == 0){           
           $(this).stop(true).animate({right: '200px'},'fast');
       }else{          
           $(this).stop(true).animate({right: '0'},'fast');
       }
       twtStatus = (twtStatus==1) ? 0 : 1; 
       return false; 
    });    
});

function initPeople(){
    
    if (supportsTransform()) {
        $('#simon').animate({rotate: '-60deg'}, 500);
         $('.our-people-pics li a').hover(function(){
             $(this).children('img:last').show();
             $(this).children('img').animate({rotate: '-6deg', top: '5px'}, 500);   
         },function(){
            $(this).children('img:last').hide();
            $(this).children('img').animate({rotate: '0deg', top: '-5px'}, 500);       
         });
    }else{
        $('.our-people-pics li a').hover(function(){
             $(this).children('img:last').show();             
         },function(){
            $(this).children('img:last').hide();         
         });    
    }
}

function initClients(){
    $('.our-clients .clientcont a').mouseenter(function(){
        var anc = $(this).parent().children('div.clienthover');                
        anc.show();
    });
    
    $('.our-clients .clientcont .clienthover').mouseleave(function(){        
        $(this).hide();            
    });
}

function supportsTransform(){
    var p,
        properties = ['transform', 'WebkitTransform', 'MozTransform'],
        el = document.getElementsByTagName('body')[0];
    p = properties.shift();
    while (p) {
        if (typeof el.style[p] != 'undefined') {
            return true;
        }
        p = properties.shift();
    }
    return false;
}
