(function($) {
			$.fn.fullBg = function(){
				var bgImg = $(this);
				
				bgImg.addClass('fullBg');
				
				function resizeImg() {
					var imgwidth = bgImg.width();
					var imgheight = bgImg.height();
					
					var winwidth = $(window).width();
					var winheight = $(window).height();
					
					var widthratio = winwidth / imgwidth;
					var heightratio = winheight / imgheight;
					
					var widthdiff = heightratio * imgwidth;
					var heightdiff = widthratio * imgheight;
				
					if(heightdiff>winheight) {
						bgImg.css({
							width: winwidth+'px',
							height: heightdiff+'px'
						});
					} else {
						bgImg.css({
							width: widthdiff+'px',
							height: winheight+'px'
						});		
					}
				} 
				resizeImg();
				$(window).resize(function() {
					resizeImg();
				}); 
			};
		})(jQuery)
		
jQuery(function($) {
	$("#bg").fullBg();
});

$(document).ready(function() {
/*
	$("#menu li a").mouseenter(function(){
		var randomNum = String.fromCharCode(97 + Math.round(Math.random() * 5));
		randomNum = "#" + randomNum;
		
		
		$("#test").html(randomNum);

		$(".cc").fadeOut("slow");
		$('img').removeClass("cc");
		$(randomNum).fadeIn("slow");
		$(randomNum).addClass("cc");				
	});

	$("#menu li a").mouseleave(function(){
		$(".cc").fadeOut("slow").stop();		
		$(".f").fadeIn("slow");	
	});
*/

	$(".logo").delay(2000).fadeIn("1000");

});


