function getHeight() {
	if (jQuery.browser.safari) return this.innerHeight;
	if (window.opera) return document.body.clientHeight;
	return document.documentElement.clientHeight;
}

$(document).ready( function() {
	
	var window_height = getHeight();
	var wrapp_a_height = $('.wrapp_a')[0].offsetHeight;
	var wrapp_b_height = $('.wrapp_b')[0].offsetHeight;
	//alert(window_height+'=w'+wrapp_a_height+'=a'+wrapp_b_height+'=b');
	if (base_url == window.location) {
		//do not put the footer down 
		$('body').css('background-color', '#CCCFC5');
		if (jQuery.browser.msie)
		{
			$('.wrapp_b').css('position', 'relative');
		}
		return true;
	} else {
		if( window_height > ( wrapp_a_height + wrapp_b_height ) ) {
			var add_height = window_height - ( wrapp_a_height + wrapp_b_height );
			$('.wrapp_a').css( "height", add_height + wrapp_a_height );
		}else if(window_height == wrapp_a_height)
		{
			
			if(window_height < 437)
			{
				window_height = 436;
				var add_height =  ( window_height + parseInt(window_height / 2) );
				$('.wrapp_a').css( "height", add_height);
			}
			$('body').css('background-color', '#CCCFC5');
			if (jQuery.browser.msie)
			{
				$('.wrapp_b').css('position', 'relative');
			}
			return true;
		}
	}
	
	/*
	if (base_url == window.location)
	{
		//do not put the footer down 
		$('body').css('background-color', '#CCCFC5');
		if (jQuery.browser.msie)
		{
			$('.wrapp_b').css('position', 'relative');
		}
		return true;
	}
	
	if( jQuery.browser.mozilla || jQuery.browser.safari || jQuery.browser.opera ) 
	{
		
		var win_h = parseInt( window.innerHeight );
		var min_h = parseInt( $('.wrapp_a').css('min-height') );

		if (min_h > win_h)
		{
			$('.wrapp_b').css('top', min_h);
		}
		else
		{
			$('.wrapp_b').css('bottom', 0);
		}
		
	}
	else if (jQuery.browser.msie)
	{
		var win_h = parseInt( document.documentElement.clientHeight );
		var min_h = parseInt( $('.wrapp_a').css('min-height') );
		
		$('.wrapp_a').each( function(ctr, obj) {
			min_h = obj.offsetHeight;
		});
		
		if (min_h > win_h)
		{
			$('.wrapp_b').css('top', min_h);
		}
		else
		{
			$('.wrapp_b').css('bottom', 0);
		}
	}
	*/
});