<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: theme.php
| Theme: Energize
| Author: Matthew
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

define("THEME_BULLET", "<span class='bullet'>×</span>");

require_once INCLUDES."theme_functions_include.php";
require_once THEME."theme_inc.php";

function render_page($license=false)
 {
  global $settings, $main_style, $locale, $userdata, $aidlink;
	
  //Main Table
  echo "<table width='920' border='0' cellpadding='0' cellspacing='0' align='center'>\n";
  echo "<tr>\n";
  echo "<td class='full-header' valign='bottom'>";
  // Here is place for banner
  //echo "<img src='".IMAGES."banner.png' border='0' title='".$settings['sitename']."' alt='".$settings['sitename']."'>";
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td>\n";
  // Subheader
  echo "<table width='100%' border='0' cellpadding='0' cellpadding='0' class='sub-header'>\n";
  echo "<tr>\n";
  echo "<td>".EnergizeSubMenu()."</td>\n";
  echo "</tr>\n";
  echo "</table>\n";
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td>\n";
  // Footer
	echo "<table width='600' height='65' border='0' cellpadding='0' cellspacing='0' align='center' class='footer'>
	<tr>
	<td align='left'><br><br><br>
	<span style='padding-left:50px; font-family: Tahoma; font-size: 13px;'> Administracijos skype: <a href='skype:cswip?chat'>*****.lt</a></span><br>
	<span style='padding-left:50px; font-family: Tahoma; font-size: 13px;'> Visos teis&#279;s saugomos: <a href='http://www.*****.lt/' target='_blank'>www.*****.lt</a></span>
	</td>
	<td align='right'>
	<span style='padding-right:50px; font-family: Tahoma; font-size: 13px;'> Dizaino &#303;d&#279;ja: <a href='skype:*****?chat'>*****.lt </a></span><br>
	<span style='padding-right:50px; font-family: Tahoma; font-size: 13px;'> *****.lt © 2011 <a href='http://*****.lt/' target='_blank'>www.*****.lt </a></span>
	</td>
	</tr>
	</table>\n";
  // Body
  echo "<table width='100%' border='0' cellpadding='0' cellspacing='0' align='center'>\n";
  echo "<tr>\n";
  if(LEFT)
   {
    echo "<td class='side-border-left' valign='top'>".LEFT."</td>";
   }
  echo "<td class='main-bg' valign='top'>".U_CENTER.CONTENT.L_CENTER."</td>";
  if(RIGHT)
   {
    echo "<td class='side-border-right' valign='top'>".RIGHT."</td>";
   }
  echo "</tr>\n";
  echo "</table>\n";
  echo "</td>\n";
  echo "</tr>\n";
  echo "</table>\n";
 }

function render_news($subject, $news, $info)
 {
  echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
  echo "<tr>\n";
  echo "<td class='capmain-left'></td>\n";
  echo "<td class='capmain'>".$subject."</td>\n";
  echo "<td class='capmain-right'></td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td colspan='3' class='main-body'>".$news."</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td align='center' colspan='3' class='news-footer'>\n";
  echo newsposter($info," ·").newsopts($info,"·").itemoptions("N",$info['news_id']);
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td class='bottom-left'></td>\n";
  echo "<td class='bottom'>&nbsp;</td>\n";
  echo "<td class='bottom-right'></td>\n";
  echo "</tr>\n";
  echo "</table>\n";
 }

function render_article($subject, $article, $info)
 {
  echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
  echo "<tr>\n";
  echo "<td class='capmain-left'></td>\n";
  echo "<td class='capmain'>".$subject."</td>\n";
  echo "<td class='capmain-right'></td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td colspan='3' class='main-body'>\n";
  echo ($info['article_breaks'] == "y" ? nl2br($article) : $article);
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td align='center' colspan='3' class='news-footer'>\n";
  echo articleposter($info," ·").articleopts($info,"·").itemoptions("A",$info['article_id']);
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td class='bottom-left'></td>\n";
  echo "<td class='bottom'>&nbsp;</td>\n";
  echo "<td class='bottom-right'></td>\n";
  echo "</tr>\n";
  echo "</table>\n";
 }

function opentable($title)
 {
  echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
  echo "<tr>\n";
  echo "<td class='capmain-left'></td>\n";
  echo "<td class='capmain'>".$title."</td>\n";
  echo "<td class='capmain-right'></td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td colspan='3' class='main-body middle-border'>\n";
 }

function closetable()
 {
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td class='bottom-left'></td>\n";
  echo "<td class='bottom'>&nbsp;</td>\n";
  echo "<td class='bottom-right'></td>\n";
  echo "</tr>\n";
  echo "</table>\n";
 }

function openside($title, $collapse = false, $state = "on")
 {
  global $panel_collapse; $panel_collapse = $collapse;
  
  echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
  echo "<tr>\n";
  echo "<td class='capmain-left'></td>\n";
  echo "<td class='capmain'>".$title."</td>\n";
  if($collapse == true)
   {
	$boxname = str_replace(" ", "", $title);
	echo "<td class='capmain' align='right'>".panelbutton($state, $boxname)."</td>\n";
   }
  echo "<td class='capmain-right'></td>\n";
  echo "</tr>\n";
  echo "</table>\n";
  echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
  echo "<tr>\n";
  echo "<td class='side-body' colspan='3'>\n";	
  if($collapse == true)
   {
    echo panelstate($state, $boxname);
   }
 }

function closeside()
 {
  global $panel_collapse;

  if($panel_collapse == true)
   {
    echo "</div>\n";
   }	
  echo "</td>\n";
  echo "</tr>\n";
  echo "<tr>\n";
  echo "<td class='bottom-left'></td>\n";
  echo "<td class='bottom'>&nbsp;</td>\n";
  echo "<td class='bottom-right'></td>\n";
  echo "</tr>\n";
  echo "</table>\n";
 }
?>