<div id="cloud_header">
        
            <div id="cloud_logo"><a href="<?php echo CLOUD_PAGE;?>" <?php echo ($custom_logo = get_cOption('framework', 'logo')) ? 'style="background-image: url(\''.esc_html($custom_logo).'\');"' : ''; ?>></a></div>
            
            <ul id="cloud_nav">                
                
             <?php 
		
			
			if ( is_array($nav_pages) ) {
				
				ksort($nav_pages);
				foreach ($nav_pages as $nav_page ) {
					
					echo '<li', ($nav_page["page_slug"]==$tab)? ' class="cloud_nav_active"':'' ,'><a href="'.CLOUD_PAGE.'&amp;tab='.$nav_page["page_slug"].'" class="cl_nav" ><span id="'.$nav_page["page_css_id"].'" class="cloud_nav_icon">'.$nav_page["page_title"].'</span></a></li>';
					
				};
				
			}
		global $page;
		?>
            
    
            </ul>
            
            <div id="cloud_nav_desc"><span></span></div>
        
            <div class="clear"></div>
    </div>   
    <div id="appandtohere-nags"></div>
            <div id="cloud_sub_bc"><?php echo $header_title; ?></div>
            
            <div id="cloud_sub_nav" class="pages pages_<?php echo $page.'_'.$tab?>">
            
            <span class="cloud_sub_nav_items">
            <?php
			
			if (!is_array($header_subnavigation)){
				echo $header_subnavigation;
			} else {
				echo '<ul>';
				
				ksort($header_subnavigation);
				$first_tab = reset(array_keys($header_subnavigation));
				$last_tab =  end(array_keys($header_subnavigation));
				$header_subnavigation_count = count($header_subnavigation);
				
				foreach($header_subnavigation as $tab_id => $tab_):
					if ($first_tab == $tab_id) {
						$tab_class = "firsttab";}
					elseif ($last_tab == $tab_id) {
						$tab_class = "lasttab";}
					else {unset($tab_class);}
					
					if ( $header_subnavigation_count == 1 )
						$tab_class = "onetab";
					
					echo '<li class="'.$tab_class.'"><a href="#'.$tab_["id"].'">'.$tab_["title"].'</a></li>';
				
				endforeach;
				
				echo '</ul><div class="clear"></div>';
				
			}
			
			 ?>
            
            </span>
            
            <div class="clear"></div>

        

    		
            <?php 
			if (!empty($header_subnavigation)) {
			$jump = $_GET['jump'];
			if ( get_bloginfo('version') >= 3.1 ) { 
			
				$onloadscript .= ' jQuery(".pages_'.$page.'_'.$tab.'").tabs({'; 
				
				} else { 
			
				$onloadscript .= ' jQuery(".pages_'.$page.'_'.$tab.' > .cloud_sub_nav_items").tabs({';}
				 if (isset($jump))
				 $onloadscript .= ' selected: '.$jump.', '; 
			$onloadscript .= 'cookie: { expires: 60, name: "name_'.$page.'_'.$tab.'"}});
    		';
			}
			
			
			if ($onloadscript) echo '
			<script type="text/javascript">
			jQuery(document).ready(function() {'.$onloadscript.'});
            </script>
			';
			
						
?>