
var content_div_bottom = null;
var original_height = null;

function heightResize( )
{ 
	
	
    var content_div = YAHOO.util.Dom.getElementsByClassName('content_area');    
    var page_height = YAHOO.util.Dom.getViewportHeight( );
   
    if( content_div_bottom == null )
    {
        content_div_bottom = YAHOO.util.Dom.getRegion( content_div[0] ).bottom;
    }    
    
    if( original_height == null )
    {
		original_height = YAHOO.util.Dom.getRegion(content_div[0]).bottom - YAHOO.util.Dom.getRegion(content_div[0]).top;
		
		
		//original_height = YAHOO.util.Dom.getDocumentHeight() - YAHOO.util.Dom.getRegion(content_div[0]).top;
		
    }
    
    var content_div_top = YAHOO.util.Dom.getRegion( content_div[0] ).top;
    var content_div_height = content_div_bottom - content_div_top - parseInt(YAHOO.util.Dom.getStyle( content_div[0], "paddingTop" ));                              
   
   
    if( content_div_bottom < page_height ) 
    {      
		
        var new_height = (page_height-content_div_bottom)+content_div_height;
        var footer_div = YAHOO.util.Dom.getElementsByClassName('page_footer');
        
        if( YAHOO.env.ua.ie == 7 ) {
            new_height += 2;   
        }
        
        YAHOO.util.Dom.setStyle( content_div[0], "height", new_height+"px" );        
        
        YAHOO.util.Dom.setStyle( footer_div[0], "position", "absolute" );
        YAHOO.util.Dom.setStyle( footer_div[0], "bottom", "0" );
        YAHOO.util.Dom.setStyle( footer_div[0], "left", "0" );    
    }  
	/*
    else if(content_div_bottom > page_height) {
		return;
        var new_height = original_height;
        var footer_div = YAHOO.util.Dom.getElementsByClassName('page_footer');
        
        if( YAHOO.env.ua.ie == 7 ) {
            new_height += 2;   
        }
        
        YAHOO.util.Dom.setStyle( content_div[0], "height", new_height+"px" );        
     
        YAHOO.util.Dom.setStyle( footer_div[0], "position", "absolute" );
        YAHOO.util.Dom.setStyle( footer_div[0], "bottom", "0" );
        YAHOO.util.Dom.setStyle( footer_div[0], "left", "0" ); 
	
    }
	*/
	
    
}

YAHOO.util.Event.onDOMReady( heightResize);
YAHOO.util.Event.addListener(window, "resize", heightResize);


/*
    position:absolute;
    bottom:0;
    left:0;*/

