<?php
/**
* @copyright Copyright (C) 2009 JoomlaPraise. All rights reserved.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!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" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<?php // Detecting Home
$menu = & JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
$siteHome = 1;
}

// Detecting Active Component
$pageOption = JRequest::getVar('option', '');

// set custom template theme for user
$user = &JFactory::getUser();
if( !is_null( JRequest::getCmd('templateTheme', NULL) ) ) {
$user->setParam($this->template.'_theme', JRequest::getCmd('templateTheme'));
$user->save(true);
}

if($user->getParam($this->template.'_theme')) {
$this->params->set('templateTheme', $user->getParam($this->template.'_theme'));
}
?>
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/k2.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/fpss.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/<?php echo $this->params->get('templateTheme'); ?>.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/k2/<?php echo $this->params->get('templateTheme'); ?>.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/fpss/<?php echo $this->params->get('templateTheme'); ?>.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/sb/<?php echo $this->params->get('templateTheme'); ?>.css" type="text/css" />
<!--[if IE 6]>
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/ie6.css" type="text/css" />
<![endif]-->
<!-- PNG FIX -->
<!--[if IE 6]>
<style type="text/css"> img { behavior: url(<?php echo $this->baseurl; ?>/templates/<?php echo $this->template ?>/css/iepngfix.htc); } </style>
<![endif]-->
<style type="text/css">
<?php if($this->params->get('fontFamily') == "times") { ?>
body{font-family:"Times New Roman", Times, serif;}
<?php } elseif($this->params->get('fontFamily') == "courier") { ?>
body{font-family:"Courier New", Courier, monospace;}
<?php } elseif($this->params->get('fontFamily') == "georgia") { ?>
body{font-family:Georgia,"Times New Roman", Times, serif;}
<?php } ?>
<?php if($this->params->get('headingFontFamily') == "arial") { ?>
h1, h2, h3, h4, h5, h6, .componentheading, .contentheading{font-family:Arial, Helvetica, sans-serif;}
<?php } elseif($this->params->get('headingFontFamily') == "times") { ?>
h1, h2, h3, h4, h5, h6, .componentheading, .contentheading{font-family:"Times New Roman", Times, serif;}
<?php } elseif($this->params->get('headingFontFamily') == "courier") { ?>
h1, h2, h3, h4, h5, h6, .componentheading, .contentheading{font-family:"Courier New", Courier, monospace;}
<?php } ?>
<?php if($this->params->get('switchSidebar')=="right") { ?>
#content{float:left;} #sidebar{float:right;}
<?php } ?>
<?php if($this->params->get('switchSidebar')=="left") { ?>
#mainbody{float:right;}  #content{float:right;} #sidebar{float:left;} #sidebar2{float:left;}
<?php } ?>
<?php if(($this->countModules('left') == 0) && ($this->countModules('right') == 0)) { ?>
#mainbody {width:100%;} #content {width:100%;}
<?php } ?>
<?php if(($this->countModules('left') >= 1) && ($this->countModules('right') == 0)) { ?>
#mainbody {width:100%;} #content{width:74.681%;} #sidebar{width:23.404%;}
<?php } ?>
<?php if(($this->countModules('left') == 0) && ($this->countModules('right') >= 1)) { ?>
#content {width:100%;}
<?php } ?>
<?php if($this->params->get('customWidth')) { ?>
.width {width:<?php echo $this->params->get('customWidth');?>;}
<?php } ?>
<?php if($this->params->get('fontColor')){ ?>
body{color:<?php echo $this->params->get('fontColor'); ?>}
<?php } ?>
<?php if($this->params->get('headingColor')){ ?>
h1, h2, h3, h4, h5, h6, .componentheading, .contentheading{color:<?php echo $this->params->get('headingColor'); ?>}
<?php } ?>
<?php if($this->params->get('linkColor')){ ?>
a:link, a:active, a:visited{color:<?php echo $this->params->get('linkColor'); ?>}
<?php } ?>
<?php if($this->params->get('linkHoverColor')){ ?>
a:hover{color:<?php echo $this->params->get('linkHoverColor'); ?>}
<?php } ?>
<?php if($this->params->get('elementsHeight')){ ?>
.elements
.moduletable, .elements .moduletable_menu, .elements .moduletable_text,
.elements .moduletable-ms1, .elements .moduletable-ms2, .elements
.moduletable-ms3, .elements .moduletable-ms4{height:<?php echo $this->params->get('elementsHeight'); ?>}
<?php } ?>
<?php if($this->params->get('advertHeight')){ ?>
.advert
.module div div div, .advert .module_menu div div div, .advert
.module_text div div div, .advert .module-ms1 div div div, .advert
.module-ms2 div div div, .advert .module-ms3 div div div, .advert
.module-ms4 div div div{height:<?php echo $this->params->get('advertHeight'); ?>}
<?php } ?>
</style>
</head>

<body>
<div id="header">
	<div id="header-inner">
        <div class="width">
            <div class="inside">
                <div id="toolbar">
                    <a href="<?php echo $mainframe->getCfg('live_site'); ?>" id="logo" title="<?php echo $mainframe->getCfg('sitename'); ?>"><?php echo $mainframe->getCfg('sitename'); ?></a>
                    <?php if ($this->countModules('user1')) { ?>
                    <div id="mainmenu">
                        <jdoc:include type="modules" name="user1" />
                        <div class="clr"></div>
                    </div>
                    <?php } ?>
                    <div class="clr"></div>
                </div>
                <div class="clr"></div>
                <?php if (($this->countModules('user2')) || ($this->countModules('user3'))) { ?>
                <div id="inset">
                	<?php if ($this->countModules('user2')) { ?>
                    <div id="inset-left">
                        <jdoc:include type="modules" name="user2" style="xhtml" />
                    </div>
                    <?php } ?>
                    <?php if ($this->countModules('user3')) { ?>
                    <div id="inset-right">
                        <jdoc:include type="modules" name="user3" style="xhtml" />
                    </div>
                    <?php } ?>
                    <div class="clr"></div>
                </div>
                <?php } ?>
                <div class="clr"></div>
            </div>
        </div>
    </div>
</div>
<div id="wrapper">
	<div class="width">
    	<div class="inside">
        	<?php if (($this->countModules('advert1')) || ($this->countModules('advert2')) || ($this->countModules('advert3'))) { ?>
        	<div id="advert">
            	<?php if (($this->countModules('advert1')) || ($this->countModules('advert2'))) { ?>
                <div id="advert-left">
                	<?php if ($this->countModules('advert1')) { ?>
                    <div id="advert-left-1">
                        <jdoc:include type="modules" name="advert1" style="xhtml" />
                    </div>
                    <?php } ?>
                    <?php if ($this->countModules('advert2')) { ?>
                    <div id="advert-left-2">
                        <jdoc:include type="modules" name="advert2" style="xhtml" />
                    </div>
                    <?php } ?>
                    <div class="clr"></div>
                </div>
                <?php } ?>
                <?php if ($this->countModules('advert3')) { ?>
                <div id="advert-right">
                    <jdoc:include type="modules" name="advert3" style="xhtml" />
                </div>
                <?php } ?>
                <div class="clr"></div>
			</div>
            <?php } ?>
            <div id="container">
            	<div id="mainbody">
                	<div id="content">
                    	<jdoc:include type="message" />
                        <jdoc:include type="modules" name="top" style="xhtml" />
                        <jdoc:include type="component" />
                        <jdoc:include type="modules" name="bottom" style="xhtml" />
                    </div>
                    <?php if ($this->countModules('left')) { ?>
                    <div id="sidebar">
                      <jdoc:include type="modules" name="left" style="xhtml" />
                    </div>
                    <?php } ?>
                	<div class="clr"></div>
                </div>
                <?php if ($this->countModules('right')) { ?>
                <div id="sidebar2">
                  <jdoc:include type="modules" name="right" style="xhtml" />
                </div>
                <?php } ?>
            	<div class="clr"></div>
            </div>
        </div>
    </div>
</div>
<?php if (($this->countModules('user4')) || ($this->countModules('user5')) || ($this->countModules('user6'))) { ?>
<div id="bottom">
	<div class="width">
    	<div class="inside">
        	<?php if (($this->countModules('user4')) || ($this->countModules('user5'))) { ?>
            <div id="bottom-left">
                <?php if ($this->countModules('user4')) { ?>
                <div id="bottom-left-1">
                    <jdoc:include type="modules" name="user4" style="xhtml" />
                </div>
                <?php } ?>
                <?php if ($this->countModules('user5')) { ?>
                <div id="bottom-left-2">
                    <jdoc:include type="modules" name="user5" style="xhtml" />
                </div>
                <?php } ?>
                <div class="clr"></div>
            </div>
            <?php } ?>
            <?php if ($this->countModules('user6')) { ?>
            <div id="bottom-right">
                <jdoc:include type="modules" name="user6" style="xhtml" />
            </div>
            <?php } ?>
            <div class="clr"></div>
        </div>
    </div>
</div>
<?php } ?>
<?php if (($this->countModules('footer')) || ($this->countModules('user7')) || ($this->countModules('user8')) || ($this->countModules('user9'))) { ?>
<div id="footer">
	<div class="width">
    	<div class="inside">
        <?php if (($this->countModules('footer')) || ($this->countModules('user7'))) { ?>
        	<div id="footer-left">
            	<?php if ($this->countModules('footer')) { ?>
            	<div id="footer-left-1">
                	<jdoc:include type="modules" name="footer" />
                </div>
                <?php } ?>
                <?php if ($this->countModules('user7')) { ?>
                <div id="footer-left-2">
                	<jdoc:include type="modules" name="user7" style="xhtml" />
                </div>
                <?php } ?>
            	<div class="clr"></div>
            </div>
            <?php } ?>
            <?php if (($this->countModules('user8')) || ($this->countModules('user9'))) { ?>
            <div id="footer-right">
            	<?php if ($this->countModules('user8')) { ?>
            	<div id="footer-right-1">
                	<jdoc:include type="modules" name="user8" style="xhtml" />
                </div>
                <?php } ?>
                <?php if ($this->countModules('user9')) { ?>
                <div id="footer-right-2">
                	<jdoc:include type="modules" name="user9" style="xhtml" />
                </div>
                <?php } ?>
            	<div class="clr"></div>
            </div>
            <?php } ?>
            <div class="clr"></div>
        </div>
    </div>
</div>
<?php } ?>
</body>
</html>
