<?php if(!$_GET["webapp"]) : ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <link rel="apple-touch-icon" href="<?php echo get_option("mobile_app_icon"); ?>" />
    <link rel="apple-touch-startup-image" href="<?php echo OCMXMOBILEURL."/admin/images/web-app-splash.png"; ?>">  
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    
    <?php mobile_site_title();
        mobile_meta_keywords();
        mobile_meta_description(); ?>
      
    <?php if(get_option("ocmx_rss_url")) : ?>
        <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php echo get_option("ocmx_rss_url"); ?>" />
    <?php else : ?>
        <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <?php endif; ?>
    <?php wp_head() ?>    
    <?php mobile_custom_bg(); ?>
    </head>
    <body class="show_normal">
<?php endif; ?>

<div id="header-container">
	<div id="header">
		<div class="logo">
        	<?php if(get_option("mobile_custom_logo") != "") : ?>
                <a href="<?php bloginfo('url'); ?>" class="logo-mark">
                    <img src="<?php echo get_option("mobile_custom_logo"); ?>" alt="<?php bloginfo('name'); ?>" />
                </a>
			<?php endif; ?>
			<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
		</div>
		<a href="<?php if(!$_GET['menu']) : ?>?menu=cats<?php else : bloginfo("wpurl").$_SERVER['REQUEST_URI']; endif; ?>" class="drop-down">Menu</a>
	</div>
</div>

<?php $categories = get_categories(); ?>
<?php $pages = get_pages(); ?>
<?php $tag_arg = array("number"=>"10"); $tags = get_tags($tag_arg); ?>
<div id="menu-container">
    <div class="search slide <?php if($_GET['menu'] == "search") : ?>active<?php endif; ?>" id="search">
        <form action="<?php bloginfo('url'); ?>" method="get">
            <input type="text" name="s" id="s" class="search-input" maxlength="50" value="<?php if(is_search()):  the_search_query(); endif; ?>" />
            <input value="<?php _e("Search"); ?>" type="submit">
        </form>
    </div>
    <ul id="menu-types" class="menu-types slide <?php if($_GET['menu']) : ?>current<?php endif; ?>">
        <li <?php if($_GET['menu'] == "cats") : ?>class="active"<?php endif; ?>><a href="?menu=cats" class="categories" rel="#cats">Categories</a></li>
        <li <?php if($_GET['menu'] == "pages") : ?>class="active"<?php endif; ?>><a href="?menu=pages" class="pages" rel="#pages">Pages</a></li>
        <li <?php if($_GET['menu'] == "tags") : ?>class="active"<?php endif; ?>><a href="?menu=tags" class="tags" rel="#tags">Tags</a></li>
		<li class="search-button" <?php if($_GET['menu'] == "search") : ?>class="active"<?php endif; ?>><a href="?menu=tags" rel="#search">Search</a></li>
    </ul>
    <ul class="navigation slide <?php if($_GET['menu'] == "cats") : ?>current<?php endif; ?>" id="cats">
    	<?php foreach($categories as $cat) : ?>
        	<li><a href="<?php echo get_category_link($cat->term_id); ?>"><?php echo $cat->name; ?></a></li>
        <?php endforeach; ?>
	</ul>      
    <ul class="navigation slide <?php if($_GET['menu'] == "pages") : ?>current<?php endif; ?>" id="pages">
    	<?php if (function_exists("wp_nav_menu")) :	wp_nav_menu(array('menu' => 'Mobile Nav', 'sort_column' => 'menu_order', 'theme_location' => 'mobile', 'container' => '', 'depth' => '1')); endif; ?>
	</ul>        
    <ul class="navigation slide <?php if($_GET['menu'] == "tags") : ?>current<?php endif; ?>" id="tags">
    	<?php foreach($tags  as $tag) : ?>
        	<li><a href="<?php echo get_tag_link($tag->term_id); ?>"><?php echo $tag->name; ?></a></li>
        <?php endforeach; ?>
	</ul>        
</div>