function heightBlock() 
{
    if (jQuery.browser.msie) 
    {
        jQuery( '#root_div' ).css( 'height', '25px' );    
    }
    else
    {
        jQuery( '#root_div' ).css( 'height', '20px' );
    }
}

jQuery( document ).ready( function(){
    if( block_name == 'new_block') 
    {
        var parent = jQuery( '#begunRoot' ).parent().parent().parent().parent();
  
        parent.attr( 'id' , 'root_div' );
        
        if( block_float == 'left' ) 
        {
            jQuery( '#root_div' ).css( 'float', 'left' );
        }
        else
        {
            if( block_float == 'right' ) 
            {
                jQuery( '#root_div' ).css( 'float', 'right' );
            }
            else
            {
                if( block_float == 'center' ) 
                {
                    jQuery( '#root_div' ).css( 'margin', '0px auto' );
                    jQuery( '#root_div' ).css( 'float', 'none' );
                    //jQuery( '#root_div' ).css( 'display', 'block' );
                }
            }
        }
    
        var old_bg    =  jQuery( '#begunRoot' ).css( 'background-color' );
        var old_width =  jQuery( '#begunRoot' ).css( 'width' );
        //jQuery( '#root_div' ).css( 'width', old_width + '!important' );
        jQuery( '#root_div' ).css( 'width', begun_auto_width );
        jQuery( '#root_div' ).css( 'background-color', old_bg );
        jQuery( '#root_div' ).css( 'padding', '5px' );
    }
    else
    {
        if( block_name == 'hover' ) 
        {
            var parent = jQuery( '#begunRoot' ).parent();

            parent.attr( 'id' , 'root_div' );
            
            if( block_float == 'left' ) 
            {
                jQuery( '#root_div' ).css( 'float', 'left' );
            }
            else
            {
                if( block_float == 'right' ) 
                {
                    jQuery( '#root_div' ).css( 'float', 'right' );
                }
                else
                {
                    if( block_float == 'center' ) 
                    {
                        jQuery( '#root_div' ).css( 'margin', '0px auto' );
                        jQuery( '#root_div' ).css( 'float', 'none' );
                        jQuery( '#root_div' ).css( 'display', 'block' );
                    }
                }
            }
            heightBlock();
            
        
            var old_bg    =  jQuery( '#begunRoot' ).css( 'background-color' );
            var old_width =  jQuery( '#begunRoot' ).css( 'width' );
            jQuery( '#root_div' ).css( 'width', old_width );
            jQuery( '#root_div' ).css( 'background-color', old_bg );
            jQuery( '#root_div' ).css( 'overflow', 'hidden' );
            jQuery( '#root_div' ).css( 'border', '4px solid #ccc' );
            jQuery( '#root_div' ).css( 'padding', '5px' );
            
            jQuery( '#root_div' ).hover( 
                function(){
                    jQuery( '#root_div' ).slideDown( function(){
                        jQuery(this).css("height", "auto");
                    });
                },
                function(){
                    heightBlock();      
            });
        }
        else
        {
            if( block_name == 'rotator' ) 
            {
                var block_child =  jQuery( '#rotator_block' ).children();

                var old_bg      =  block_child.css( 'background-color' );
                var old_width   =  block_child.css( 'width' );
                
                jQuery( '#rotator_block' ).css( 'width', old_width );
                jQuery( '#rotator_block' ).css( 'background-color', old_bg );
                jQuery( '#rotator_block' ).css( 'padding', '5px' );     
                             
                if( block_float == 'left' ) 
                {
                    jQuery( '#rotator_block' ).css( 'float', 'left' );
                }
                else
                {
                    if( block_float == 'right' ) 
                    {
                        jQuery( '#rotator_block' ).css( 'float', 'right' );
                    }
                    else
                    {
                        if( block_float == 'center' ) 
                        {
                            jQuery( '#rotator_block' ).css( 'margin', '0px auto' );
                            jQuery( '#rotator_block' ).css( 'float', 'none' );
                            jQuery( '#rotator_block' ).css( 'display', 'block' );
                        }
                    }
                }
            
                
            }
            else
            {
                var parent = jQuery( '#begunRoot' ).parent();
  
                parent.attr( 'id' , 'root_div' );
            
                if( block_float == 'center' ) 
                {
                    jQuery( '#root_div' ).css( 'margin', '0px auto' );
                    jQuery( '#root_div' ).css( 'float', 'none' );
                }
            
                
            
                var old_bg    =  jQuery( '#begunRoot' ).css( 'background-color' );
                var old_width =  jQuery( '#begunRoot' ).css( 'width' );
                jQuery( '#root_div' ).css( 'width', old_width );
                jQuery( '#root_div' ).css( 'background-color', old_bg );
                jQuery( '#root_div' ).css( 'padding', '5px' );   
            }
        }
    }
    
});

