<?php 
defined( '_VALID_MOS' ) or die( 'Restricted access' );
$iso = split( '=', _ISO );
//echo "<?xml version=\"1.0\" encoding=\"'. $iso[1] .'\"?' .'>";

# TEMPLATE CONFIGURATIONS ##########
# Choose your prefer Menu Type
$ja_menutype = "2"; // 1: Split Menu; 2: Son of Suckerfish Dropdown Menu; 3: Transmenu;
# END: TEMPLATE CONFIGURATIONS ##########

if ($ja_menutype == 1) {
	require($mosConfig_absolute_path."/templates/ja_avior/ja_submenu.php");
	$topnav = ja_topNav('mainmenu', array('default'));
	$subnav = ja_subNav('mainmenu');
}

# Auto Collapse Divs Functions ##########
$ja_right = mosCountModules( 'right' );
$ja_left = mosCountModules( 'left' ) || ($subnav) || mosCountModules( 'user4' ) || mosCountModules( 'user4' );

if ( $ja_left && $ja_right ) {
	$divid = 'content';
	} elseif ( $ja_left ) { 
	$divid = 'content-full-right';
	} elseif ( $ja_right ) {
	$divid = 'content-full-left';
	} else {
	$divid = 'content-full';
}

if ( mosCountModules( 'user1' ) && mosCountModules( 'user2' ) ) {
	$divwidth = '48%';
	} else {
	$divwidth = '100%';
}

# Define the template path ##########
$ja_template_path = $mosConfig_live_site.'/templates/ja_avior';
?>
<!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>
<?php mosShowHead(); ?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="<?php echo $ja_template_path;?>/css/template_css.css" rel="stylesheet" type="text/css" />
<?php if ($ja_menutype == 1) { ?>
<link href="<?php echo $ja_template_path;?>/ja_submenu/ja-submenu.css" rel="stylesheet" type="text/css" />
<?php } else if ($ja_menutype == 2) { ?>
<link href="<?php echo $ja_template_path;?>/ja_cssmenu/ja-sosdmenu.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="<?php echo $ja_template_path;?>/ja_cssmenu/ja.cssmenu.js"></script>
<?php } else if ($ja_menutype == 3) { ?>
<link href="<?php echo $ja_template_path;?>/ja_transmenu/ja-transmenuh.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="<?php echo $ja_template_path;?>/ja_transmenu/ja-transmenu.js"></script>
<?php }
if ( $my->id ) { initEditor(); } ?>
<script language="javascript" type="text/javascript" src="<?php echo $ja_template_path;?>/scripts/ja.script.js"></script>
<script language="javascript" type="text/javascript">
	preloadimages(
		"<?php echo $ja_template_path;?>/images/arrow-on.gif",
		"<?php echo $ja_template_path;?>/images/arrow-off.gif",
		"<?php echo $ja_template_path;?>/ja_cssmenu/img/nav-on-bg.gif",
		"<?php echo $ja_template_path;?>/ja_cssmenu/img/arrow-on.gif",
		"<?php echo $ja_template_path;?>/ja_cssmenu/img/arrow-off.gif"
	);
</script>
</head>
<body id="bd">
<div id="ja-container-shadow">
  <div id="ja-container-outer">
    <div id="ja-container"> <a name="Top" id="Top"></a> <a title="Skip to content" href="#Content" style="display: none;">Skip to content</a>
      <!-- BEGIN: HEADER -->
      <div id="ja-header">
        <?php mosLoadModules ( 'top',-2 ); ?>
      </div>
      <div style="height:5px;"></div>
      <!-- END: HEADER -->
      <!-- BEGIN: MAIN MENU -->
      <div id="ja-topnav">
        <?php
			switch ($ja_menutype) {
				case 1: echo $topnav;
				break;
				case 2:
				include("ja_cssmenu.php");
				break;
				case 3: include("ja_transmenu.php");
				break;
			}
		?>
      </div>
      <div style="height:5px;"></div>
      <!-- END: MAIN MENU -->
      <div class="ja-contentwrap-outer">
        <div class="ja-contentwrap-inner">
          <div id="ja-contentwrap" class="clearfix">
            <?php if ( mosCountModules( 'left' ) || ($subnav) || mosCountModules( 'user4' ) ) { ?>
            <!-- BEGIN: LEFT SIDE -->
            <div id="ja-leftcol">
              <?php echo mosLoadModules ( 'left',-2 );?>
            </div>
            <!-- END: LEFT SIDE -->
            <?php } ?>
            <!-- BEGIN: CONTENT -->
            <div id="ja-<?php echo $divid ?>"> <a name="Content" id="Content"></a>             
              <?php mosMainBody(); ?>
              <!-- BEGIN: CONTENT SPOTLIGHT -->
              <?php if ( mosCountModules( 'user1') || mosCountModules( 'user2') ) { ?>
              <div style="position: relative; margin: 10px 0;" class="clearfix">
                <?php if ( mosCountModules( 'user1') ) { ?>
                <div id="ja-spotlight-1" style="width: <?php echo $divwidth ?>; float: left;">
                  <?php mosLoadModules('user1',-2); ?>
                </div>
                <?php }
			if ( mosCountModules( 'user2') ) { ?>
                <div id="ja-spotlight-2" style="width: <?php echo $divwidth ?>; float: right;">
                  <?php mosLoadModules('user2',-2); ?>
                </div>
                <?php } ?>
              </div>
              <?php } ?>
              <!-- END: CONTENT SPOTLIGHT -->
            </div>
            <!-- END: CONTENT -->
            <?php if ( mosCountModules( 'right' ) || mosCountModules( 'top' ) ) { ?>
            <!-- BEGIN: RIGHT SIDE -->
            <div id="ja-rightcol">
              <?php mosLoadModules ( 'right',-2 ); ?>
            </div>
            <!-- END: RIGHT SIDE -->
            <?php } ?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<?php mosLoadModules( 'debug', -1 );?>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-13263716-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
