function scaleHomeSliderImages() {
	$("img.fullscreen")
			.each(function(index) {
				// Get height of original image
					$imgHeight = $(this).height();
					// Get width of original image
					$imgWidth = $(this).width();
					// Calculate ratio
					$ratio = $imgHeight / $imgWidth;
					// Get browser window size
					$browserwidth = $(window).width();
					$browserheight = $(window).height();
					// Scale the image
					if (($browserheight / $browserwidth) > $ratio) {
						$(this).height($browserheight);
						$(this).width($browserheight / $ratio);
					} else {
						$(this).width($browserwidth);
						$(this).height($browserwidth * $ratio);
					}
					$left = ($browserwidth - $(this).width()) / 2;
					$top = (($browserheight - $(this).height()) / 2);
					if (index > 0) {
						homeSliderTopPositions[index] = Math.floor(Math
								.abs($top))
								* -1;
						$top = Math.abs($prevImg.height())
								- (Math.abs(Math.floor($prevImg.css("top")
										.split('px')[0])));
					}
					$prevImg = $(this);
					// Center the image
					// $(this).css('left', $left);
					$(this).css('top', $top);
					// $(this).animate({ top: index*visibleHeight
					// -((activeImage-1)*visibleHeight) + 'px' });
					return this;
				});
}
Cufon.replace('ul li#copyright');
Cufon.replace('ul li a', {
	hover : true
});
Cufon.replace('h1');
Cufon.replace('h2.screen');
Cufon.replace('h3');
Cufon.replace('span.footer');

$(document).ready(function() {
	var ua = navigator.userAgent;
	if (ua.indexOf("MSIE") >= 0) {
		$("ul#navi li.main").mouseenter(function() {
			$("div#overlay").css('visibility', 'visible');
			$(this).find('ul').show();
			//$(this).find('ul').slideDown(300);
		});
	} else {
		$("ul#navi li.main").mouseenter(function() {
			$("div#overlay").css('visibility', 'visible');
			$(this).find('ul').slideDown(300);
		});
	}
	$("ul#navi li.main").mouseleave(function() {
		$(this).find('ul').hide();
		$("div#overlay").css('visibility', 'hidden');
	});
	scaleHomeSliderImages();
	$(window).resize(function() {
		scaleHomeSliderImages();
	});
});

