function socialUrl (serviceName)
{
	var url = encodeURI(document.location);
	var title = encodeURI(document.title);
	var socialurl = '';
	switch (serviceName) {
		case 'facebook':
			socialurl = 'http://www.facebook.com/sharer.php?u='+url+'&t='+title;
			break;
		case 'twitter':
			socialurl = 'http://twitter.com/home?status='+title+' - '+url;
			break;
		case 'technorati':
			socialurl = 'http://technorati.com/faves/?add='+url;
			break;
		case 'gbookmarks':
			socialurl = 'http://www.google.com/bookmarks/mark?op=add&title='+title+'&bkmk='+url;
			break;
		case 'netvibes':
			socialurl = 'http://www.netvibes.com/share?autoclose=1&title='+title+'&url='+url;
			break;
		case 'digg':
			socialurl = 'http://digg.com/submit?phase=2&partner=[partner]&title='+title+'&url='+url;
			break;
		default:
			break;
	}

	var width = 800;
	var height = 600;
	var left = parseInt((jQuery(window).width()/2)-(width/2));
	var top = parseInt((jQuery(window).height()/2)-(height/2));
	window.open(socialurl, serviceName, 'resizable=yes, location=yes, width='+width+', height='+height+', left='+left+', top='+top);

	return false;
}
jQuery(document).ready(function() {
var src, src2;
    jQuery(".team").hover(function () {
		src = jQuery(this).attr('src');
		src2 = src.substring(0,src.lastIndexOf('.'));
        jQuery(".team:not(.polaroid)").not(this).stop().fadeTo(500, 0.5);
        jQuery(this).attr('src', src2+'-2'+'.png' );
    }, function () {
        jQuery(".team:not(.polaroid)").not(this).stop().fadeTo(500, 1);
        jQuery(this).attr('src',src);
    });

	//right menu animation
    jQuery(window).scroll(function() {
        jQuery('#menu').stop().animate({ 'top': ((jQuery(this).scrollTop() > 250 ) ? jQuery(this).scrollTop()+30 : 250  )+'px'},2000);
        jQuery('#right').stop().animate({ 'top': ((jQuery(this).scrollTop() > 250 ) ? jQuery(this).scrollTop()+280 : 500  )+'px'},2000);
    });
	
	jQuery('#menu, #right').localScroll();
	jQuery('#menu a').click(function(){
		if( ! jQuery(this).hasClass('current') ){
			jQuery('.current').removeClass('current');
			jQuery(this).addClass('current');
		}
	});
});
