<?php 
	
	# Load Render Functions
	require_once(TEMPLATEPATH . '/cloudfw/inc/core/core.render.php');
	
	
	$tab = isset($_GET['tab']) ? $_GET['tab'] : NULL;
	$this_page = CLOUD_PAGE;
	if ($tab) $this_page .= '&tab='.$tab ;
	
	# Call Theme Options
	global $_opt;

	# Set Arguments
	$args = array(
		'current_page'	=> $current_page,
		'this_page' 	=> $this_page,
		'lastID'		=> $lastID,
		'_opt'			=> $_opt
	);
	
	cloudfw_render_page( isset($current_page_data['load_file']) ? $current_page_data['load_file'] : NULL, $args );
	
	$load_header = isset($current_page_data["load_header"]) ? $current_page_data["load_header"] : NULL;
	$load_footer = isset($current_page_data["load_footer"]) ? $current_page_data["load_footer"] : NULL;
	
	if ( ! (isset($load_header) && !$load_header) ):
?>
            
<div id="framework">

<?php 
		
	$header_title = _isso( isset( $current_page_data['page_nice_title'] ), $current_page_data['page_nice_title'], $current_page_data['page_title'] ); 
	$sector_id = $current_page_data['page_css_id'];
	$header_subnavigation = isset($current_page_data['tab_nav']) && $current_page_data['tab_nav'] ? cloudfw_render_filters( $current_page_data['tab_nav'], $the_data, $args ) : cloudfw_prepare_tabs( $the_data );

	if (isset($current_page_data["onload"]))
		$onloadscript	= $current_page_data["onload"];
	else
		$onloadscript = 'jQuery(".tabs").tabs({ cookie: { expires: 60, name: "CloudFW_PG_'.$sector_id.'" }});';

	require (TMP_ADMIN_PATH.'/inc/cloud_header.php'); 
	general_page_operations($tab);
	
	
	endif;
	
	
	
	cloudfw_render_form_header(isset($current_page["form"]) ? $current_page["form"] : NULL, $args);
		cloudfw_render_page( $the_data, $args );
	cloudfw_render_form_footer(isset($current_page["form"]) ? $current_page["form"] : NULL, $args);
	
?>
        
</div>

<?php 
	if ( ! (isset($load_footer) && !$load_footer) )
		require (TMP_ADMIN_PATH.'/inc/cloud_footer.php');

?>