jQuery.fn.center = function () {
	
	if(this.height() < $(window).height())
	{
		this.css("position","absolute");
		this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
		this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
	}
    return this;
}


$(document).ready( function(){ 
							
	$("#root").center();


	$('.menu a').hover(
		function() {
			cl=$(this).attr('class');
			$('.icons .'+cl).addClass(cl+'-active');
		},
		function() {
			cl=$(this).attr('class');
			$('.icons .'+cl).removeClass(cl+'-active');
		}
	);


	$('.icons a').hover(
		function() {
			cl=$(this).attr('class');
			$('#'+cl).addClass('active');
		},
		function() {
			cl=$(this).attr('class');
			$('#'+cl).removeClass('active');
		}
	);



 } );	
