<?php

if (!defined("IN_FUSION")) { die("Access Denied"); }
define("THEME_BULLET", "<span class='bullet'>·</span>");
require_once INCLUDES."theme_functions_include.php";

function render_page($license=false) {
global $theme_width,$userdata,$settings,$locale,$data,$db_prefix,$lookup,$msg_count,$aidlink;

	echo "<table align='center' cellpadding='0' cellspacing='0' class='decolor'>\n<tr>
	<td align='right' width='970'>";
	echo "</td>
	</tr>
	</table>";
	echo "<table align='center' cellpadding='0' cellspacing='0' class='decolor2'>\n<tr>
	<td align='right' width='20'>";
	echo "</td>
	<td align='right' width='320'>";
	if (!defined("IN_FUSION")) { die("Access Denied"); }
	if (iMEMBER) {
	$msg_count = dbcount("(message_id)", DB_MESSAGES, "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");
	echo "<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
	<tr>
	<td align='left' width='125' >
	<span style='padding-left:10px;'><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."'>Mano profilis</a></span><br>
	<span style='padding-left:10px;'><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."edit_profile.php'>".$locale['global_120']."</a></span>
	</td>
	<td align='left' width='120' >
	<img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."members.php'>".$locale['global_122']."</a><br>
	<img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."messages.php'>&#381;inut&#279;s [nauj&#371;: ".sprintf($msg_count)."]</a>
	</td>
	<td align='left' width='120'>\n";
	if (iADMIN && (iUSER_RIGHTS != "" || iUSER_RIGHTS != "C")) {
	echo "<img src='".THEME."images/bullet.gif'> <a href='".ADMIN."index.php".$aidlink."'>Administracija</a><br>\n";
	}
	echo "<img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."setuser.php?logout=yes'>".$locale['global_124']."</a>
	</td>
	</tr>
	</table>";
	} else {
	echo "<div align='left' height='25' width='510'>
	<form name='loginform' method='post' action='".FUSION_SELF."'>
	<input type='text' name='user_name' class='id' value='vardas' onBlur=\"if(this.value=='') this.value='vardas';\" onFocus=\"if(this.value=='vardas') this.value='';\" >
	<input type='password' name='user_pass' class='pass' value='slapta&#382;odis' onBlur=\"if(this.value=='') this.value='slapta&#382;odis';\" onFocus=\"if(this.value=='slapta&#382;odis') this.value='';\" >
	<input type='submit' name='login' value='' class='inne'><br>
	<center><a href='".BASEDIR."register.php' ><span style='font-size: 11px; font-weight: bold; font-family: Tahoma; color:#868686;'> Dar nesate narys ? <span style='color:#0094ff;'>U&#382;siregistruokite!</span></a></span></center>
	<center><a href='".BASEDIR."lostpassword.php' ><span style='font-size: 11px; font-weight: bold; font-family: Tahoma; color:#868686;'>Prisiminkite slapta&#382;od&#303;! <span style='color:#0094ff;'>Gaukite nauj&#261;!</span></a></span></center>
	</form></div>";
	}
	echo "</td>
	<td align='right' width='185'>";
	echo "</td>
	<td align='right' width='350'>";

	echo "<a href='http://www.cancel.lt' target='_blank'><img src='http://monitors.cancel.lt/server_info/mano ip:portas:cs/350x20.png' border='0' alt='CANCEL.LT' width='350' height='20' /></a>";
	echo "<a href='http://www.cancel.lt' target='_blank'><img src='http://monitors.cancel.lt/server_info/mano ip:portas:cs/350x20.png' border='0' alt='CANCEL.LT' width='350' height='20' /></a>";

	echo "</td>
	<td align='right' width='94'>";
	echo "</td>
	</tr>
	</table>";
	echo "<table align='center' cellpadding='0' cellspacing='0' class='decolor3'>\n<tr>
	<td align='right' width='470'>";
	echo "</td>
	<td align='right' width='468'>";

	echo "<a href='#' target=''>
	<img src='http://svetaine.tt.lt/images/baneris.gif' width='468' height='60' border='0' title='svetaine.tt.lt' alt=''></a >\n";

	echo "</td>
	<td align='right' width='37'>";
	echo "</td>
	</tr>
	</table>";
	echo "<table align='center' cellpadding='0' cellspacing='0' width='100%'>\n
	<td>
	<div id='containe'>
	<div id='sub-nav'>
	<a href='".BASEDIR."index.php'></a>
	<ul>
	<li><a href='".BASEDIR."index.php'><i>Pagrindinis</i></a></li>
	<li><a href='".FORUM."index.php'><i>Forumas</i></a></li>
	<li><a href='".BASEDIR."viewpage.php?page_id=1'><i>Serveriai</i></a></li>
	<li><a href='".BASEDIR."viewpage.php?page_id=4'><i>Taisykl&#279;s</i></a></li>
	<li><a href='".BASEDIR."viewpage.php?page_id=7'><i>Admin&#371 komandos</i></a></li>
	<li><a href='".BASEDIR."viewpage.php?page_id=9'><i>Reklama</i></a></li>
	<li><a href='".BASEDIR."viewpage.php?page_id=8'><i>Kontaktai</i></a></li>
	</ul>
	</div>
	</td>
	</table>\n";
	echo "<table align='center' cellpadding='0' cellspacing='0' class='decolor5'>\n<tr>
	<td align='right' width='970'>";
	echo "</td>
	</tr>
	</table>";
	echo "<table cellpadding='0' cellspacing='0' width='970' align='center' class='content'><tr>\n";
	if (LEFT) { echo "<td class='side-border-left' valign='top' width='200'>".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' width='200'>".RIGHT."</td>"; }
	echo "</tr>\n</table>\n";
	echo "<table width='970' height='87' border='0' cellpadding='0' cellspacing='0' align='center' class='footer'>
	<tr>
	<td align='left'><br><br><br>
	<span style='padding-left:20px; font-family: Tahoma; font-size: 11px;'> Administracijos skype: <a href='skype:tomox11?chat'>Tomox</a></span><br>
	<span style='padding-left:20px; font-family: Tahoma; font-size: 11px;'> Visos teis&#279;s saugomos: <a href='http://www.csnet.tt.lt/' target='_blank'>www.CSnet.tt.lt</a></span>
	</td>
	<td align='center'><br><br><br>
	<span style='padding-left: 75px;'><a target='_blank' href='http://www.hey.lt/details.php?id=chabas'>
	<center><img width=88 height=31 border=0 src='//www.hey.lt/count.php?id=chabas' alt='Hey.lt - Nemokamas lankytoju skaitliukas'></center></a></span>
	</td>
	<td align='right'><br><br><br>
	<span style='padding-right:65px; font-family: Tahoma; font-size: 11px;'> Dizaino &#303;d&#279;ja: <a href='skype:decolor.?chat'>decolor. </a></span><br>
	<span style='padding-right:65px; font-family: Tahoma; font-size: 11px;'> Studijos svetain&#279;: <a href='http://www.decolor.lt/' target='_blank'>www.decolor.lt </a></span>
	</td>
	</tr>
	</table>\n";
}

function render_news($subject, $news, $info) {

	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='panel-left3'><img src='".THEME."images/blank.gif' width='10' height='40' alt='' style='display:block'></td>";
	echo "<td width='100%' class='panel-main3'><div class='panel-title-main'>$subject</div></td>";
	echo "<td class='panel-right3'><img src='".THEME."images/blank.gif' width='10' height='40' alt='' style='display:block'></td>";
	echo "</tr></table>";
	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='border-left3'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td>";
	echo "<td class='main-body'><div style='width:100%;vertical-align:top;'>$news</div>";
	echo "<div style='margin-top:5px'>";
	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><br>";
	echo "<td align='left' class='infobar'>
	<a href='".BASEDIR."profile.php?lookup=".$info['user_id']."'>
	<img src='".THEME."images/bullet.gif' alt=''> <b>".$info['user_name']."</b></a> &nbsp;
	<img src='".THEME."images/bullet.gif' alt=''> ".showdate("%Y - %m - %d", $info['news_date'])." &nbsp;
	<a href='".BASEDIR."news.php?readmore=".$info['news_id']."'>
	<img src='".THEME."images/bullet.gif' alt=''> <b> Skaityti daugiau... </b></a>&nbsp;
	<img src='".THEME."images/bullet.gif' alt=''> ".$info['news_reads']." Per&#382;i&#363;ros &nbsp;
	<img src='".THEME."images/bullet.gif' alt=''> ".$info['news_comments']." Komentarai</div></td>";
	echo "</td></tr></table></div></td>";
	echo "<td class='border-right3'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'>";
	echo "</td></tr><tr>";
	echo "<td class='border-bleft3'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bmain3'><img src='".THEME."images/blank.gif' width='1' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bright3'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "</tr></table><div style='margin-top:5px'></div>\n";
}

function render_article($subject, $article, $info) {

	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='panel-left3'><img src='".THEME."images/blank.gif' width='10' height='40' alt='' style='display:block'></td>";
	echo "<td width='100%' class='panel-main3'><div class='panel-title-main'>$subject</div></td>";
	echo "<td class='panel-right3'><img src='".THEME."images/blank.gif' width='10' height='40' alt='' style='display:block'></td>";
	echo "</tr></table>";
	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='border-left3'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td>";
	echo "<td class='article-body'><div style='width:100%;vertical-align:top;'>".($info['article_breaks'] == "y" ? nl2br($article) : $article)."</div><br>";
	echo "<div style='margin-top:5px'>";
	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr><br>";
	echo "<td class='infobar2'>".articleposter($info," ·")."</td>";
	echo "<td align='right' class='infobar2'>";
 	echo articleopts($info,"·").itemoptions("A",$info['article_id']);
	echo "</td></tr></table></div></td>";
	echo "<td class='border-right3'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td>";
	echo "</tr><tr>";
	echo "<td class='border-bleft3'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bmain3'><img src='".THEME."images/blank.gif' width='1' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bright3'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "</tr></table><div style='margin-top:5px'></div>\n";
}

function opentable($title) {

	echo "<table width='100%' cellpadding='0' cellspacing='0'>";
	echo "<tr><td class='panel-left2'><img src='".THEME."images/blank.gif' width='10' height='38' alt='' style='display:block'></td>";
	echo "<td width='100%' class='panel-main2'><div class='panel-title-table'>$title</div></td>";
	echo "<td class='panel-right2'><img src='".THEME."images/blank.gif' width='10' height='38' alt='' style='display:block'></td>";
	echo "</tr></table>";
	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='border-left2'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td>";
	echo "<td class='table-body'><br>\n";
}

function closetable() {

	echo "</td>";
	echo "<td class='border-right2'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td></tr>";
	echo "<tr>";
	echo "<td class='border-bleft2'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bmain2'><img src='".THEME."images/blank.gif' width='1' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bright2'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "</tr></table><div style='margin-top:5px'></div>\n";
}

function openside($title) {

	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='panel-left'><img src='".THEME."images/blank.gif' width='10' height='36' alt='' style='display:block'></td>";
	echo "<td width='100%' class='panel-main'>$title</td>";
	echo "<td class='panel-right'><img src='".THEME."images/blank.gif' width='10' height='36' alt='' style='display:block'></td>";
	echo "</tr></table>";
	echo "<table width='100%' cellpadding='0' cellspacing='0'><tr>";
	echo "<td class='border-left'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td>";
	echo "<td class='side-body'><br>\n";
}

function closeside() {

	global $panel_collapse;
	if ($panel_collapse == true) { echo "</div>\n"; }
	echo "</td>";
	echo "<td class='border-right'><img src='".THEME."images/blank.gif' width='10' height='10' alt='' style='display:block'></td></tr>";
	echo "<tr>";
	echo "<td class='border-bleft'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bmain'><img src='".THEME."images/blank.gif' width='1' height='16' alt='' style='display:block'></td>";
	echo "<td class='border-bright'><img src='".THEME."images/blank.gif' width='10' height='16' alt='' style='display:block'></td>";
	echo "</tr></table><div style='margin-top:5px'></div>\n";
}

?>