
	$(document).ready(function(){
		
		var hH	= ( ( $("#header").size() <= 0 ) ? 0 : 179 );
		
		if( $("#content").height() < 600 ){
			if($(window).height() > 600){
				$("#content").height($(window).height()-33-hH);
			} else {
				$("#content").height(600);
			}
		}
		
		$("#header .bill").simpleSlide();
		$("#inner-bill").simpleSlide();
		
		$(document).pngFix();
		
	});
	
	jQuery.fn.simpleSlide = function(a){
		
		a				= a || {};
		a.duration		= a.duration || 5000;
		a.transition	= a.transition || 1000;
		
		var	c	= $(this);
		
		$(c).css("position","relative");
		
		$("img",$(c))
			.css({
				'position'	: 'absolute',
				'top'		: '0px',
				'left'		: '0px',
				'z-index'	: '8'
				})
			.find(":first")
				.addClass("slide-active")
				.css('z-index','10');
		
		setInterval(function(){
				
				var $active = $("img.slide-active",$(c));
		
				if($active.length == 0) $active = $("img:last",$(c));
		
				var $next	= $active.next().length ? $active.next() : $("img:first",$(c));
		
				$active
					.addClass("slide-last-active")
					.css('z-index','9');
		
				$next
					.css({opacity: 0.0})
					.addClass("slide-active")
					.css('z-index','10')
					.animate({opacity: 1.0}, a.transition, function(){
						$active
							.removeClass('slide-active slide-last-active')
							.css('z-index','8');
					});
			}, a.duration);
		
	}