<?php

defined( '_VALID_MOS' ) or die( 'Restricted access' );
// needed to seperate the ISO number from the language file constant _ISO
$iso = explode( '=', _ISO );
// xml prolog
echo '<?xml version="1.0" encoding="'. $iso[1] .'"?' .'>';
?>
<!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 
require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/dropline.php"); 
require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/template_config.php"); 
require($mosConfig_absolute_path."/templates/" . $mainframe->getTemplate() . "/tab.php");
?> 
<?php mosShowHead(); ?>
<?php 
if ( $my->id ) { initEditor(); }
 ?>
<script type="text/javascript" src="templates/times_plazza/js/match.js"></script> 
<link rel="stylesheet" href="templates/times_plazza/css/<?php echo $templatestyle; ?>/tab_static.css" type="text/css" />
	<?php $browser = strtolower(getenv("HTTP_USER_AGENT"));
	if (preg_match("/.*msie (\d{1,2})\.(\d{1,2}).*/",$browser,$match)) {
	echo "<link rel=\"stylesheet\" href=\"templates/times_plazza/css/"."$templatestyle"."/tab_ie.css\" type=\"text/css\" />";
	}?>
	<script type="text/javascript" src="templates/times_plazza/js/tabc.js"></script>
	<script type="text/javascript" src="templates/times_plazza/js/tab.js"></script> 
 
<?php 
$templatewidth_content = $templatewidth - 6; 

// top section modules width calculation 
if ( mosCountModules('user6') >= 1 ) $cw1_1 = 1; 
	else $cw1_1 = 0; 
if (mosCountModules( 'user9' ) >= 1 ) $cw1_2 = 1; 
	else $cw1_2 = 0; 
if (( mosCountModules('user7')) + ( mosCountModules('user1')) + ( mosCountModules('user2')) + ( mosCountModules('user4')) + ( mosCountModules('user5'))  >= 1 ) $cw1_3 = 1; 
	else $cw1_3 = 0;
	
if ($cw1_1 + $cw1_2  + $cw1_3  >= 3 ) { 
	$cw1_width = $templatewidth_content/3-12;
	$cw1_margin = 10;
 } 
if ($cw1_1 + $cw1_2  + $cw1_3  == 2 ) { 
	$cw1_width = $templatewidth_content/2-14;
	$cw1_margin = 10;
 } 
if ($cw1_1 + $cw1_2  + $cw1_3  == 1 ) { 
	$cw1_width = $templatewidth_content - 16;
	$cw1_margin = 10;
 }

//mainbody section width calculation
if ( mosCountModules('left')) {
	$cw3_right_wrapper_width = $templatewidth_content - $body_left_width - 26;
} else {
	$cw3_right_wrapper_width = $templatewidth_content - 16;
}
if (( mosCountModules ('right')) ||  ( mosCountModules ('user21')) ||  ( mosCountModules ('user22')) ||  ( mosCountModules ('user23')) ||  ( mosCountModules ('user24'))) {
	$mainbody_width = $cw3_right_wrapper_width - $body_right_width - 10; 
	}else {
	$mainbody_width = $cw3_right_wrapper_width ; 
}
// 4 bottom mod width calculation 
$botmod_section_width = $templatewidth-10;

if ( mosCountModules('user31') >= 1 ) $botmod_1 = 1; 
	else $botmod_1 = 0; 
if ( mosCountModules('user32') >= 1 ) $botmod_2 = 1; 
	else $botmod_2 = 0; 
if ( mosCountModules('user33') >= 1 ) $botmod_3 = 1; 
	else $botmod_3 = 0;
if ( mosCountModules('user34') >= 1 ) $botmod_4 = 1; 
	else $botmod_4 = 0;

if ($botmod_1 + $botmod_2  + $botmod_3 + $botmod_4 == 4 ) { 
	$botmodwidth = $botmod_section_width/4-2; } 
if ($botmod_1 + $botmod_2  + $botmod_3 + $botmod_4 == 3 ) { 
	$botmodwidth = $botmod_section_width/3-2; } 
if ($botmod_1 + $botmod_2  + $botmod_3 + $botmod_4 == 2 ) { 
	$botmodwidth = $botmod_section_width/2-2; } 
if ($botmod_1 + $botmod_2  + $botmod_3 + $botmod_4 == 1 ) { 
	$botmodwidth = $botmod_section_width - 2;
 }

?> 

<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<link rel="stylesheet" href="templates/times_plazza/css/<?php echo $templatestyle; ?>/template_css.css" type="text/css" />
<link rel="stylesheet" href="templates/times_plazza/css/<?php echo $templatestyle; ?>/sfish.css" type="text/css" />
<link rel="stylesheet" href="templates/times_plazza/css/<?php echo $templatestyle; ?>/dropline.css" type="text/css" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="templates/times_plazza/css/<?php echo $templatestyle; ?>/ie6.css" type="text/css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" href="templates/times_plazza/css/<?php echo $templatestyle; ?>/ie7.css" type="text/css"  type="text/css" />
<![endif]-->

</head>
<body class="bodies">
<div id="wrapper" align="center">
	<div id="pagewrapper" style="width:<?php echo $templatewidth; ?>px;">
		<div id="toproundwrapper">
			<div id="topround_left">
			</div>
			<div id="topround_mid" style="width:<?php echo $templatewidth - 40; ?>px">
				<div id="drop_top">
					<?php echo $mycssPSPLITmenu_content; ?>
				</div>
				<div>
					<div id="logos"><img src="templates/times_plazza/images/<?php echo $templatestyle; ?>/logo.gif" alt=""  /></div>
					<div id="topbanner"><?php mosLoadModules( "banner", -1 ); ?></div>
				</div>
				<div style="clear:both;"></div>
			</div>
			<div id="topround_right">
			</div>
		</div> <!-- end toproundwrapper -->
		<!--     ######################################################## -->	
		<div id="xtd_wrapper">
			<div id="xtd_menu">
				<?php mosLoadModules ( 'user8',-2); ?>
			</div>
		</div>	 <!-- end xtd_wrapper -->
		<div style="clear:both"></div>
		<!--     ######################################################## -->		
		<div id="path_wrapper">
			<div>
				<div id="path1"><?php echo mosCurrentDate(); ?></div>
				<div id="path2" style="width:<?php echo $templatewidth - 360 ?>px;">
					<?php if ($option != 'com_frontpage'){ ?>
						<div class="pathie6"><?php mosPathWay(); ?></div> 
					<?php } else {?> Home <?php } ?>
				</div>
				<div id="path3"><?php mosLoadModules ( 'inset',-2 ); ?></div>
			</div>
		</div>
		
		<div id="content_wrapper" style="width:<?php echo $templatewidth; ?>px;">
			<!--  ########  TOP MODULE POSITION ######### -->
			<div id="content_wrapper1">
				<?php if (mosCountModules( 'user6' )){ ?>
				<div id="cw1_left" style="width:<?php echo $cw1_width; ?>px; margin-right:<?php echo $cw1_margin; ?>px;">
					<?php mosLoadModules ( 'user6',-3); ?>	
				</div>
				<?php } ?>	
				<?php if ((mosCountModules( 'user7' )) || (mosCountModules( 'user1' )) || (mosCountModules( 'user2' )) || (mosCountModules( 'user4' )) || (mosCountModules( 'user5' ))) { ?>
				<div id="cw1_mid" style="width:<?php echo $cw1_width; ?>px; margin-right:<?php echo $cw1_margin; ?>px;">
					<div id="cw1_mid_inner">
					<?php echo tptabstatic1(); ?>
					<?php mosLoadModules ( 'user7',-3); ?>
					</div>
				</div>
				<?php } ?>
				<?php if (mosCountModules( 'user9' )){ ?>
				<div id="cw1_right" style="width:<?php echo $cw1_width; ?>px;">
					<div id="cw1_right_inner">
					<?php mosLoadModules ( 'user9',-3); ?>
					</div>
				</div>
				<?php } ?>
				<div style="clear:both"></div>
			</div> <!-- end of content_wrapper1 -->
			<div style="clear:both"></div>
			<!--  #######  CONTENT WRAPPER 2 ######## -->
			<?php if (mosCountModules( 'user10' )){ ?>
			<div id="content_wrapper2">
				<div id="roundwrapper">	<!-- starting rounded left -->				
					<div class="roundtopleft">
						<span class="sfix">&nbsp;</span>
					</div>
					<div class="roundcontent">	
						<?php mosLoadModules ( 'user10',-2); ?>			
					</div>	
					<div class="roundbottomleft" style="margin-top:-10px;">
						<span class="sfix">&nbsp;</span>
					</div>
				</div>			
			</div>
			<div style="clear:both"></div>
			<?php } ?>		
			<!-- ########  BODY SECTION ######## -->
			<div id="content_wrapper3">
				<div id="content_wrapper3_inner">
					<div id="cw3_right_wrapper" style="width:<?php echo $cw3_right_wrapper_width; ?>px;">
						<div id="mainbody" style="width:<?php echo $mainbody_width; ?>px;">
							<?php echo tptabstatic2(); ?>
							<?php mosMainBody(); ?>
							<?php mosLoadModules( 'advert1', -2 ); ?>
						</div>
						<?php if ((mosCountModules( 'right' )) || (mosCountModules( 'user21' )) || (mosCountModules( 'user22' )) || (mosCountModules( 'user23' )) || (mosCountModules( 'user24' ))) { ?>
						<div id="rightsection"  style=" width:<?php echo $body_right_width; ?>px">
							<?php mosLoadModules ( 'right',-3 ); ?>	
							<?php echo tptabstatic3(); ?>				
						</div>
						<?php } ?>
					</div>
					<?php if (mosCountModules( 'left' )){ ?>
					<div id="cw3_left_wrapper" style=" width:<?php echo $body_left_width; ?>px">
						<?php mosLoadModules ( 'left',-3 ); ?>
					</div>
					<?php } ?>
				</div>
			</div>			
			<div style="clear:both"></div>
		</div>  <!-- end content_wrapper -->		
		<!-- ########## BOTTOM MODULE POSITION ########## -->
		<?php if(mosCountModules('user31') || mosCountModules('user32') || mosCountModules('user33') || mosCountModules('user34')) { ?>
		<div id="botmodsection" style="width:<?php echo $templatewidth; ?>px;">
			<div id="botmodsection_inner">
				<div class="botmodsection_inner_c">
					<?php if (mosCountModules('user31')) { ?>
					<div id="botmodsection_1" class="column" style="width:<?php echo $botmodwidth; ?>px;"><?php mosLoadModules ( 'user31',-3 ); ?></div>
					<?php } ?>								
					<?php if (mosCountModules('user32')) { ?>
					<div id="botmodsection_2" class="column" style="width:<?php echo $botmodwidth; ?>px;"><?php mosLoadModules ( 'user32',-3 ); ?></div>
					<?php } ?>								
					<?php if (mosCountModules('user33')) { ?>
					<div id="botmodsection_3" class="column" style="width:<?php echo $botmodwidth; ?>px;"><?php mosLoadModules ( 'user33',-3 ); ?></div>
					<?php } ?>								
					<?php if (mosCountModules('user34')) { ?>
					<div id="botmodsection_4" class="column" style="width:<?php echo $botmodwidth; ?>px;"><?php mosLoadModules ( 'user34',-3 ); ?></div>
					<?php } ?>
					<div style="clear:both; line-height:1px;">&nbsp;</div>
				</div>
			</div>				
		</div>
		<?php } ?>		
<!-- ####### FOOTER ####### -->		
		<div id="footer_wrapper">
			<div id="footer_left"><?php include_once('includes/footer.php'); ?></div>
			<?php if (mosCountModules('user3')) { ?>
			<div id="footer_right"><?php mosLoadModules ( 'user3',-2); ?></div>
			<?php } ?>
			<div style="clear:both; line-height:1px;">&nbsp;</div>		
		</div>			
	</div> <!-- end pagewrapper -->
</div> <!-- end wrapper -->
</body>
</html>