var IE5 	= (navigator.userAgent.indexOf('MSIE')!=-1) && (navigator.userAgent.indexOf('Opera')==-1)
var Opera7 	= (navigator.userAgent.indexOf('Opera')!=-1) && (navigator.userAgent.charAt(navigator.userAgent.indexOf('Opera')+6)>=7)
var strReturnPage = ''

function o2(id){
window.open('/?go=ttx&item='+id,'Описание','');
}

function codes(){
window.open('forum_codes.aspx','Коды','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=600,height=540');
}

function Set_Cookie(name,value,expires,path,domain,secure){
var today=new Date()
today.setTime(today.getTime())
if (expires) expires=expires*1000*60*60*24
var expires_date=new Date(today.getTime()+(expires))
document.cookie=name+"="+escape(value)+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"")+ 
((domain)?";domain="+domain:"")+
((secure)?";secure":"")
}

function Get_Cookie(name){
var start=document.cookie.indexOf(name+"=")
var len=start+name.length+1
if ((!start)&&(name!=document.cookie.substring(0,name.length))) return null
if (start==-1) return null
var end=document.cookie.indexOf(";",len)
if (end==-1) end=document.cookie.length
return unescape(document.cookie.substring(len,end))
}

function getcookievalue(name)
{
var temp=document.cookie+";"
var Pos=temp.indexOf("=",temp.indexOf(name+"="))
if (temp.indexOf(name+"=")==-1) return ""
return temp.substring(Pos+1,temp.indexOf(";",Pos))
}

function set_style(obj,style){
if(typeof obj.style.cssText=='string')obj.style.cssText=style;else obj.setAttribute('style',style)
}

function getById(id){
return document.getElementById(id)
}

function FTM(){
w('<br/><table width="98%"  border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="' + BorderColour + '"><tr><td>');
w('<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="' + TitleColour + '">');
w('<tr><td><table height="7" width="100%" border="0" cellspacing="0" cellpadding="0" background="/img/m_top.gif"><tr><td></td></tr></table></td></tr>');
w('<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"><tr>');
if (UID!=0){
  w('<td class="text">&nbsp;' + strTxtWelcome + '&nbsp;<b>' + UN + '</b>');
  if ((blnUA==1) && (blnUL==0) && (blnUB==0)) {
     w('&nbsp;&nbsp;&nbsp;<a class=f href="?go=forum&p=profile" target="_self">' + strTxtEditProfile + '</a>&nbsp;&nbsp;<a class=f href="?go=login&mode=off" target="_self">' + strTxtLogOff + '</a></td>');
     w('<td align="right">');
     w('<a class=f href="?go=forum&p=search' + ((ForumID != -1)?'&fid='+ForumID:'') + ((TopicID != -1)?'&tid='+TopicID:'') + '" target="_self">' + strTxtSearchTheForum + '</a>&nbsp;&nbsp;');
     w('<a class=f href="?go=forum&p=members" target="_self">' + strTxtMembersList + '</a>&nbsp;&nbsp;</td>');
  } else {
     w('<img src="/forum_images/lock.gif" width=11 height=14 align=baseline alt="' + strTxtUserBlocked + '">&nbsp;</td>');
  }
} else {
  w('<td class="text">&nbsp;' + strTxtWelcomeGuest + '&nbsp;&nbsp;&nbsp;<a class=f href="?go=forum&p=profile" target="_self">' + strTxtRegister + '</a>&nbsp;&nbsp;<a class=f href="?go=login" target="_self">' + strTxtLogin + '</a></td>');
}
w('</tr></table></td></tr>');
w('<tr><td><table height="7" width="100%" border="0" cellspacing="0" cellpadding="0" background="/img/m_down.gif"><tr><td></td></tr></table></td></tr></table></td></tr>');
w('</table>');
}

function FTree() {
w('<br/><table width="525" border="0" cellspacing="0" cellpadding="1" align="center">');
w('<tr><td align="left" width="712">');
w('<img src="/forum_images/folder_icon.gif" width="15" height="15" border="0" align="bottom">&nbsp;<a href="?go=forum" target="_self"><span class="text">' + strTxtAllForums + '</span></a><br/>');
w('<img src="/forum_images/folder_line.gif" width="20" height="20">&nbsp;<img src="/forum_images/open_folder_icon.gif" width="15" height="15">&nbsp;');
if ((ForumID==-1) && (blnPV == 0)){
 w('<span class="text">' + strTxtNoForums + '</span>');
} else {
 if (blnFL){w('<img src="/forum_images/lock.gif" width=11 height=14 align=baseline alt="' + strTxtForumLocked + '">&nbsp;');}
 if (blnPrvt == 0) 
 {
    w('<a href="?go=forum&p=topic&id=' + ForumID +'" target="_self"><span class="text">' + ForumName + '</span></a>');
 }
 else
 {
    w('<a href="?go=forum&p=pv" target="_self"><span class="text">' + ForumName + '</span></a>');
 }
 w('<span class="text">&nbsp;(' + ((blnFA)?strTxtAnonymousForum:strTxtRegisteredForum) + ')</span><br/>');
}
w('</td></tr></table><br/>');
}

function FRowH(TimeNowIs) {
w('<table width="98%" border="0" cellspacing="1" cellpadding="4" align="center">');
w('<tr><td width="68%" class="text">');
w(TimeNowIs);
w('</td></tr></table>');
w('<table width=98% border=0 cellspacing=1 cellpadding=4 align="center"><tr><td>');
w('<table width="100%" border="0" cellspacing="1" cellpadding="4" align="center">');
w('<tr><td bgcolor="' + TitleColour + '" width="56%" class="bold">' + strTxtForum + '</td><td bgcolor="' + TitleColour + '" width="7%" align="center" class="bold">' + strTxtTopics + '</td><td bgcolor="' + TitleColour + '" width="6%" align="center" class="bold">' + strTxtPosts + '</td><td bgcolor="' + TitleColour + '" width="31%" class="bold">' + strTxtLastPost + '</td></tr>');
}

function FRowM(){
w('</table></td></tr></table>');
w('<table width=98% border=0 cellspacing=1 cellpadding=4 align=center><tr><td>');
w('<table width="100%" border="0" cellspacing="1" cellpadding="4">');
w('<tr><td bgcolor="' + TitleColour + '" class="bold">' + strTxtLatestForumPosts + '</td></tr>');
}
/*
function FRowM(ForumTheads, ForumTopics, Forums, Users, LastUser, LastUID) {
w('</table></td></tr></table>');
w('<table width=98% border=0 cellspacing=1 cellpadding=4 align=center><tr><td>');
w('<table width="100%" border="0" cellspacing="1" cellpadding="4">');
w('<tr><td bgcolor="' + TitleColour + '" class="bold">' + strTxtForumStatistics + '</td></tr>');
var odd = 1;
w('<tr class=t' + odd + '><td class="text">' + strTxtThereAre + ':&nbsp;' + strTxtPostsIn + '&nbsp;-&nbsp;' + ForumTheads + ';&nbsp;&nbsp;</td></tr>');odd=1-odd;
w('<tr class=t' + odd + '><td class="text">' + strTxtTopicsIn + '&nbsp;-&nbsp;' + ForumTopics + ';</td></tr>');odd=1-odd;
w('<tr class=t' + odd + '><td class="text">' + strTxtForumsIn + '&nbsp;-&nbsp;' + Forums + ';</td></tr>');odd=1-odd;
w('<tr class=t' + odd + '><td class="text">' + strTxtThereAre + '&nbsp;' + Users + '&nbsp;' + strTxtForumMembers + '</td></tr>');odd=1-odd;
w('<tr class=t' + odd + '><td class="text">' + strTxtTheNewestForumMember + '&nbsp;');odd=1-odd;
if ((UID != 0) && (blnUA==1) && (blnUL==0) && (blnUB==0)) {
if (LastUID!=0) {
w('<a class=f href="?go=forum&p=user&id=' +  LastUID + '">' + LastUser + '</a>');
} else {
w(LastUser);
}
} else {
w(LastUser);
}
w('</td></tr></table></td></tr></table>');
w('<table width=98% border=0 cellspacing=1 cellpadding=4 align=center><tr><td>');
w('<table width="100%" border="0" cellspacing="1" cellpadding="4">');
w('<tr><td bgcolor="' + TitleColour + '" class="bold">' + strTxtLatestForumPosts + '</td></tr>');
}
*/

function FRowE() {
w('</td></tr></table></td></tr></table>');
}

function FTh(TpID,ThID,SortOrder,UserID,UserName,LastEntry,Subj,Message)
{
w('<NOBR><b>'+strTxtAuthor+':</b>&nbsp;');
if (UID != 0)
{((UserID>0) && (blnUA==1) && (blnUL==0) && (blnUB==0)) ?w('<a class=f href="?go=forum&p=user&id='+UserID+((strReturnPage!='')?'&r='+strReturnPage:'') + '">' + UserName + '</a>'):w(UserName);}
else
{w(UserName);}
w('&nbsp;'+LastEntry+'</NOBR>');
w('<br/><b>'+strTxtTopic+':</b>&nbsp;<a class=f href="?go=forum&p=thread&tid='+TpID+((SortOrder==1)?'&page=last':'')+'">'+Subj+'</a>');
w('<br/><b>'+strTxtMessageBody+':</b>&nbsp;<a class=f href="?go=forum&p=thread&id='+ThID+'#'+ThID+'">'+Message+'</a>');
}
function FThR(odd,TpID,ThID,SortOrder,UserID,UserName,LastEntry,Subj,Message)
{
w('<tr class=t'+odd+'><td class="text">');
FTh(TpID,ThID,SortOrder,UserID,UserName,LastEntry,Subj,Message);
w('</td></tr>');
}
function FRow(odd,ID,Name,Lock,SortOrder,Anon,Desc,TpC,ThC,ThNC,TpID,ThID,UserID,UserName,LastEntry,Subj,Message)
{
w('<tr class=t' + odd + '><td height="41" class="text">');
if (Lock != 0) {w('<img src="/forum_images/lock.gif" align="baseline" alt="'+strTxtForumLocked+'">&nbsp;');}
w('<a class=f href="?go=forum&p=topic&id=' + ID + '" target="_self"><b>'+Name+'</b></a><span class="text">&nbsp;(');
(Anon != 0) ? w(strTxtAnonymousForum) : w(strTxtRegisteredForum);
w(')</span><br/>' + Desc + '</td>');
w('<td align="center" height="41" class="text">');
(TpC>0)?w(TpC):w('&nbsp;');
w('</td><td align="center" height="41" class="text">');
(ThC>0)?w(ThC):w('&nbsp;');
(ThNC>0)?w('<br>Новые: '+ThNC):w('');
w('</td><td height="41" class="text">');
if (LastEntry != ''){ FTh(TpID,ThID,SortOrder,UserID,UserName,LastEntry,Subj,Message); } else {w(strTxtNoTopics);}
w('</td></tr>');
}
function FThPV(ThID,UserID,UserName,LastEntry,Message)
{
w('<NOBR><b>'+strTxtAuthor+':</b>&nbsp;');
if (UID != 0)
{((UserID>0) && (blnUA==1) && (blnUL==0) && (blnUB==0)) ?w('<a class=f href="?go=forum&p=user&id='+UserID+((strReturnPage!='')?'&r='+strReturnPage:'') + '">' + UserName + '</a>'):w(UserName);}
else
{w(UserName);}
w('&nbsp;'+LastEntry+'</NOBR>');
w('<br/><b>'+strTxtMessageBody+':</b>&nbsp;<a class=f href="?go=forum&p=pv&id='+ThID+'#'+ThID+'">'+Message+'</a>');
}
function FRowPV(odd,Name,Anon,ThC,NonR,ThID,UserID,UserName,LastEntry,Message)
{
w('<tr class=t' + odd + '>');
w('<td height="41" class="text"><a class=f href="?go=forum&p=pv" target="_self"><b>'+Name+'</b></a><span class="text">&nbsp;(');
(Anon != 0) ? w(strTxtAnonymousForum) : w(strTxtRegisteredForum);
w(')</span></td>');
w('<td align="center" height="41" class="text"></td>');
w('<td align="center" height="41" class="text">');
(ThC>0)?w(ThC):w('&nbsp;');
(NonR>0)?w('<br>Новых: '+NonR):w('');
w('</td><td height="41" class="text">');
if (LastEntry != ''){ FThPV(ThID,UserID,UserName,LastEntry,Message); } else {w(strTxtNoTopics);}
w('</td></tr>');
}
function ConfirmDelTopic() {
return confirm(strTxtDeleteTopicAlert);
}

function CloseTopics(ID)
{
   	element = document.getElementById("CloseTopicHField");
    if (element != null) { 
       element.setAttribute("value",ID);
       return true;
	} else {
	   return false;
	}
}

function TpListLinks(TpID,ThC)
{
var Pages = Math.ceil(ThC / ThreadPageSize);
if (Pages > 1) {
w('&nbsp;(');
for (i = 1; i <= Pages; i++){
w(' <a href="?go=forum&p=thread&tid='+TpID+'&page='+i+'">'+i+'</a>');
if ((i>5) & ((Pages-i) > 5)) { i = Pages - 5; w(' ... '); }
}
w(' )');
}
}

function ShowTopics(Show,ForumID)
{
   	strShow = escape(Show.options[Show.selectedIndex].value);
   	document.cookie = "TopicsPeriod=" + strShow;
   	if (Show != "") self.location.href = "?go=forum&p=topic&id="+ForumID;
	return true;
}

function ForumJump(URL) 
{ 
if (URL.options[URL.selectedIndex].value != "") 
{ 
  self.location.href = URL.options[URL.selectedIndex].value; 
}
return true; 
}

function TpH(strForums,Period){
w('<input type="hidden" id="CloseTopicHField" name="CloseTopicHField" value="">');
w('<table width="98%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="' + BorderColour + '">');
w('<tr><td>');
w('<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="' + TitleColour + '">');
w('<tr><td width="50%">');
if (ForumID != -1) {
if ((strForums != null) && (strForums != '')) {
 w('&nbsp;<span class="text">' + strTxtForumJump + '</span>&nbsp;');
 w('<select onChange="ForumJump(this)" name="SelectJumpForum"><option value="" selected>-- ' + strTxtSelectForum + ' --</option>');
 var strForumsArr = strForums.split('||');
 for (i=0; i<strForumsArr.length; i=i+2) {
    if (strForumsArr[i] == -1) 
    {
       w('<option value="?go=forum&p=pv" ');
    }
    else
    {
       w('<option value="?go=forum&p=topic&id=' + strForumsArr[i] + '" ');
    }
    w(((ForumID == strForumsArr[i])?'selected':'') + '>' + strForumsArr[i+1] + '</option>' );
 }
 w('</select>&nbsp;');
}
w('<span class="text">' + strTxtShowTopics + '</span>&nbsp;');
w('<select name="show" onChange=ShowTopics(this,ForumID)>');
w('<option value="0" '+ ((Period == 0)?'selected':'') + '>' + strTxtAllTime + '</option>');
w('<option value="7" ' + ((Period == 7)?'selected':'') + '>' + strTxtLastWeek + '</option>');
w('<option value="14" ' + ((Period == 14)?'selected':'') + '>' + strTxtLastTwoWeeks + '</option>');
w('<option value="31" ' + ((Period == 31)?'selected':'') + '>' + strTxtLastMonth + '</option>');
w('<option value="62" ' + ((Period == 62)?'selected':'') + '>' + strTxtLastTwoMonths + '</option>');
w('<option value="182" ' + ((Period == 182)?'selected':'') + '>' + strTxtLastSixMonths + '</option>');
w('<option value="365" ' + ((Period == 365)?'selected':'') + '>' + strTxtLastYear + '</option>');
w('</select>');
} else { w('&nbsp;') }
w('</td>');
if ((blnUL == 0) && (blnUB==0) && (blnUA==1) && (blnFL==0) && !((blnFLT!=0) && (blnAdmin==0)) & !((UID == 0) & (blnFA==0))) {
w('<td align="right"><a class=f href="?go=forum&p=post&mode=new&id='+ForumID+'">' + strTxtNewTopic + '</a>&nbsp;</td>');
}
w('</tr></table></td></tr></table>');
}//TpH

function TpH2(blnNTP,strShowTopicsFrom) {
w('<table width=98% border=0 cellspacing=1 cellpadding=4 align="center"><tr><td>');
w('<table width="100%" border="0" cellspacing="1" cellpadding="4" align="center">');
w('<tr>');
w('<td bgcolor="' + TitleColour + '" width="0%" class="bold"></td>');
w('<td bgcolor="' + TitleColour + '" width="47%" class="bold">' + strTxtTopic + '</td>');
w('<td bgcolor="' + TitleColour + '" width="14%" class="bold">' + strTxtThreadStarter + '</td>');
w('<td bgcolor="' + TitleColour + '" width="6%" align="center" class="bold">' + strTxtReplies + '</td>');
w('<td bgcolor="' + TitleColour + '" width="6%" align="center" class="bold">' + strTxtViews + '</td>');
w('<td bgcolor="' + TitleColour + '" width="27%" class="bold">' + strTxtLastPost + '</td></tr>');
if (blnNTP){
 w('<tr><td bgcolor="' + TableColour + '" colspan="5" class="text">' + strTxtNoTopicsToDisplay + '&nbsp;' + strShowTopicsFrom + '</td></tr>');
}
}//TpH2

function TpTh(ID,ThID,Closed,SortOrder,UserID,UserName,LastEntry,Message,FirstUserID)
{
w('<NOBR>' + LastEntry + '&nbsp;');
if ((UID != 0) && (blnUA==1) && (blnUL==0) && (blnUB==0) && ((blnAdmin == 1)||(UID == FirstUserID))) {
 w('&nbsp;<input type="submit" name="CloseTopic" value="'+((Closed == 1)?'Открыть':'Закрыть')+'" class="M" OnClick="CloseTopics('+ID+')">&nbsp;');
}
((UserID>0) && (blnUA==1) && (blnUL==0) && (blnUB==0) && (UID!=0))?w('<a class=f href="?go=forum&p=user&id=' + UserID + '">' + UserName + '</a>'):w(UserName);
w('</NOBR><br/><b>'+strTxtMessageBody+':</b>&nbsp;<a class=f href="?go=forum&p=thread&id='+ThID+'#'+ThID+'">'+Message+'</a>');
}

function TpRow(odd,ID,Name,Closed,SortOrder,ThC,ThNC,ViewC,FirstUserID,FirstUserName,FirstEntry,LastUserID,LastUserName,ThID,LastEntry,Message,ForumName)
{
w('<tr class=t' + odd + '><td height="41">');
if (Closed != 0) {w('<img src="/forum_images/lock.gif" align="baseline" alt="закрыто">');}
w('</td><td height="41">');
if ((ForumName != null) && (ForumName != "")) {w('<b>' + strTxtForum + '</b> ' + ForumName+'<hr size=1 color=#999999>');}
if ((blnAdmin == 1) || ((UID !=0 ) && (blnUA==1) && (blnUL==0) && (blnUB==0) && (UID == FirstUserID) && (blnFLT != 1) && (blnFL != 1) && (Closed != 1))) {w('<a href="?go=forum&p=topic&tid='+ID+'&mode=del" OnClick="return ConfirmDelTopic();" target="_self"><img src="/forum_images/delete_icon.gif" border="0" alt="'+strTxtDeleteTopic+'"></a>&nbsp;')}
w('<a class=f href="?go=forum&p=thread&tid=' + ID + '" target="_self"><b>'+Name+'</b></a>');
TpListLinks(ID,ThC);
w('</td>');
w('<td class="text" align="center">');
((FirstUserID>0) && (blnUA==1) && (blnUL==0) && (blnUB==0) && (UID != 0))?w('<a class=f href="?go=forum&p=user&id=' + FirstUserID + '">' + FirstUserName + '</a>'):w(FirstUserName);
w('&nbsp;'+FirstEntry+'</td>');
w('<td align="center" height="41" class="text">');
(ThC>0)?w(ThC):w('');
(ThNC>0)?w('<br/>Новых: '+ThNC):w('');
w('</td>');
w('<td align="center" height="41" class="text">'+ViewC+'</td>');
w('<td height="41" class="text">');
if (LastEntry != ''){ TpTh(ID,ThID,Closed,SortOrder,LastUserID,LastUserName,LastEntry,Message,FirstUserID); } else {w(strTxtNoTopics);}
w('</td></tr>');
}//TpRow

function TpF() {
w('</table></td></tr></table><br/>');
}

function ThH(strForums,blnNoThread) {
w('<table width="98%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="' + BorderColour + '">');
w('<tr><td>');
w('<table width="100%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="' + TitleColour + '">');
w('<tr>');
if ((ForumID != -1) || (blnPV == 1)) {
if ((strForums != null) && (strForums != '')) {
 w('<td width="50%">&nbsp;<span class="text">' + strTxtForumJump + '</span>&nbsp;');
 w('<select onChange="ForumJump(this)" name="SelectJumpForum"><option value="" selected>-- ' + strTxtSelectForum + ' --</option>');
 var strForumsArr = strForums.split('||');
 for (i=0; i<strForumsArr.length; i=i+2) {
    if (strForumsArr[i] == -1) {
    w('<option value="?go=forum&p=pv" ')
    } else {
    w('<option value="?go=forum&p=topic&id=' + strForumsArr[i] + '" ');
    }
    w(((ForumID == strForumsArr[i])?'selected':'') + '>' + strForumsArr[i+1] + '</option>' );
 }
 w('</select></td>');
}
}
w('<td align="right">');
if (blnPV == 0) 
{
   if ((blnUL == 0) && (blnUB == 0) && (blnUA == 1) && ((UID != 0) || (blnFA == 1)) && (blnFL == 0) && (blnTC == 0) && (blnNoThread == 0)) 
   {
      w('<a class=f href="#reply" target="_self">' + strTxtPostReply + '</a>&nbsp;');
   } 
   if ((blnUL == 0) && (blnUB == 0) && (blnUA == 1) && ((UID != 0) || (blnFA == 1)) && (blnFL == 0) && (blnFV == 1) && ((blnFLT == 0) || (blnAdmin == 1)) )
   { 
      w('<a class=f href="?go=forum&p=post&mode=new&id='+ ForumID +'">' + strTxtNewTopic + '</a>&nbsp');
   }
}
else
{
   w('&nbsp;')
}
w('</td></tr></table></td></tr></table>');
}//ThH

function ThH2(strSubject) {
w('<table width="98%" border="0" cellspacing="1" cellpadding="4" align="center">');
w('<tr>');
w('<td bgcolor="' + TitleColour + '" valign=middle width=18% class="bold">' + strTxtMessageBy + '</td>');
w('<td bgcolor="' + TitleColour + '" valign=middle width=82% class="bold">' + strTxtTopic + ':&nbsp;' + strSubject + '&nbsp;' + (((blnFL == 1) || (blnTC == 1))?'<img img src="/forum_images/lock.gif" alt="закрыт">':'') + '</td>');
w('</tr></table>');
}//ThH2

function ThF() {
w('<div align="center">');
if (blnUA == 0) {
    w('<p class="text">' + strTxtSorryNoReply + '<br/>' + strTxtForumMembershipSuspended + '</p>');
}
else if (blnFL == 1){
    w('<p class="text">' + strTxtSorryNoReply + '<br/>' + strTxtThisForumIsLocked + '</p>');
}
else if (blnTC == 1){
    w('<p class="text">' + strTxtSorryNoReply + '<br/>' + strTxtThisTopicIsClosed + '</p>');
}
else if ((UID == 0) & (blnFA == 0)){
    w('<p class="text">' + strTxtPostAReplyRegister + '&nbsp;<a class=f href="?go=login" target="_self">' + strTxtLogin + '</a><br/>');
    w(strTxtNeedToRegister + '&nbsp;<a class=f href="?go=forum&p=profile" target="_self">' + strTxtSmRegister + '</a></p>');
}
w('</div>');
}

function ThreadLC(blnCE,UserID,UserName,IP,blnIsModerator,intBlocked,AuthorLocation,dtmAR,AuthorNumOfPosts,AuthorHomepage,Status,Warnings,isNew){
if (isNew > 0){w('<span class=s><font color=red>Новое</font></span><br/>');}
var i;
if (UserID > 1){
 if ((blnUL == 0) && (blnUB == 0) && (blnUA == 1) && (UID != 0) && (blnFL == 0) && (blnTC == 0)) 
 {
  w('<a class=l href="JavaScript:AddUserName(\'2'+UserName+'\' );">'+UserName+'</a>');
 } else {w('<span class=l>'+UserName+'</span>');}
 if ((UID!=0) && (blnUA==1) && (blnUL==0) && (blnUB==0) ){w('&nbsp;<a href="?go=forum&p=user&id='+UserID+'"><img width="15" height="15" src="/forum_images/q.gif" alt="about" border="0"></a>');}
} else {w('<span class=l>'+UserName+'</span>');}
if ((blnPV==1) && (UserID>0)){w('&nbsp;<a href="?go=forum&p=post_pv&mode=new&oid='+UserID+'" target="_self" title="'+strTxtPrvt+'&nbsp;'+UserName+'"><img src="/i/oSent.gif" alt="в личку" border="0"></a>');}
if (UserID==1){w('<br/><span class=s>'+strTxtForumAdministrator+'</span>');} 
if (IP!=''){w('<br/>IP:'+IP);}
if (blnIsModerator==1){w('<br/><span class=s>'+strTxtForumModerator+'</span>');}
if (Status!=''){w('<br/><span class=s>'+Status+'</span>');}
if (intBlocked!=0){w('<br/><span class=s><font color=red>'+strTxtBlocked+'</font></span>');}
w('<br/><br/>');
if (AuthorLocation!='') {w(strTxtLocation+':&nbsp;'+AuthorLocation+'<br/>');}
w(strTxtJoined+': <span class=date3>'+dtmAR+'</span><br/>'+strTxtPosts+':&nbsp;'+AuthorNumOfPosts);
if (AuthorHomepage!=''){w('<br/><a class=f href="'+AuthorHomepage+'" target="_blank">'+strTxtAuthorHomepage+'</a>');}
if (Warnings>0){w('<br/><span class=s><font color=red>'+strTxtWarnings+'</font></span><br/>');

if (Warnings<4){for(i=0;i<Warnings;i++){w('<img src="/forum_images/spammer.gif" width="18" height="18" align="absmiddle" border="0" alt="Предупреждение">');}
} else {w('<img src="/forum_images/spammer_red.gif" width="18" height="18" align="absmiddle" border="0" alt="Блокирован">');}
}
} //ThreadLC

function aSL(UserID,UserName){
   if ((blnPV == 0) && (blnPrvt == 0))
   {
      w('&nbsp;[<a href="?go=forum&p=search&s='+UserID+'&in=2&fid='+ForumID+'&sort=0" title="'+strTxtSearchForPosts+'&nbsp;'+UserName+'">'+ strTxtSearch+'</a>]');
   }
}
function aQL(strUserName,lngMessageID){
   if (blnPrvt == 0) 
   {
      w('&nbsp;[<a href="?go=forum&p=post&mode=quote&id='+lngMessageID+'" target="_self" title="'+strTxtQuote+'&nbsp;'+strUserName+'">'+strTxtQuote+'</a>]');
   } 
}
function aQL_PV(strUserName,lngMessageID,UserID){
   if ((blnPV == 1) && (blnPrvt == 0))
   {
      w('&nbsp;[<a href="?go=forum&p=post_pv&mode=quote&oid='+UserID+'&id='+lngMessageID+'" target="_self" title="'+strTxtPrvt+'&nbsp;'+strUserName+'">'+strTxtPrvt+'</a>]');
   }   
}
function aEL(lngMessageID){
   if (blnPrvt == 0) 
   {
      w('&nbsp;[<a href="?go=forum&p=post&mode=edit&id='+lngMessageID+'" target="_self" title="'+strTxtEditPost+'">'+strTxtEdit+'</a>]');
   }
}
function aDL(lngMessageID){
   if (blnPrvt == 0) 
   {
      w('&nbsp;[<a href="?go=forum&p=thread&mode=del&id='+lngMessageID+'" target="_self" OnClick="return confirm(\''+strTxtDeletePostAlert+'\')" title="'+strTxtDeletePost+'">'+strTxtDelete+'</a>]');
   }
   else
   {
      w('&nbsp;[<a href="?go=forum&p=pv&mode=del&id='+lngMessageID+'" target="_self" OnClick="return confirm(\''+strTxtDeletePostAlert+'\')" title="'+strTxtDeletePost+'">'+strTxtDelete+'</a>]');
   }   
}

function aCL(strUsername,lngMessageID){
   if (blnPrvt == 0) 
   {
      w('&nbsp;[<a href="?go=forum&p=post&mode=comment&id='+lngMessageID+'" target="_self" title="comment&nbsp;'+strUsername+'">comment</a>]');
   }   
}

function ThreadRC(blnCE,UserID,UserName,ThID,dtmTD,dtmC,TopicName,ForumName){
if ((ForumName != null) && (ForumName != "")) {w('<b>'+strTxtForum+':</b>&nbsp;'+ForumName+'<hr size=1 color=#999999>');}
if ((TopicName != null) && (TopicName != "")) {w('<b>'+strTxtTopic+':</b>&nbsp;<a class=f href="?go=forum&p=thread&id='+ThID+'#'+ThID+'">'+TopicName+'</a><hr size=1 color=#999999>');}
w(strTxtOn+'&nbsp;'+dtmTD);
if (dtmC!=''){w('<br/>'+strTxtChanged+'&nbsp;'+dtmC);}
w('</td><td align=right>');
if (blnE!=1) {
 if ((blnUA==1) && (blnUL==0) && (blnUB==0)) {aSL(UserID,UserName);}
 if ((blnUA==1) && (blnUL==0) && (blnUB==0) &&  (blnTC!=1) && (blnFL!=1) && !((UID==0) && (blnFA!=1))) {aQL(UserName,ThID);}
 if ((blnPrvt == 0) && (blnPV == 1) && (UserID != 0) && (UID!=UserID)) {aQL_PV(UserName,ThID,UserID);}
 if (blnCE == 1) {
  aEL(ThID);
  aDL(ThID);
  if (blnAdmin == 1) {aCL('strUsername',ThID);}
 }
}
w('</td></tr><tr><td class=n style="text-align: justify" colspan=2><hr size=1 color=#999999>');
} //ThreadRC

function ThR(odd,UserID,UserName,IP,blnIsModerator,intBlocked,AuthorLocation,dtmAR,AuthorNumOfPosts,AuthorHomepage,blnCE,ThID,dtmTD,dtmC,Status,Warnings,isNew,Message,TopicName,ForumName){
w('<a name="'+ThID+'"></a>');
w('<table width="98%" border="0" cellspacing="1" cellpadding="4" align="center"><tr class=t'+odd+' valign=top>');
w('<td width=18% class=small3>');
ThreadLC(blnCE,UserID,UserName,IP,blnIsModerator,intBlocked,AuthorLocation,dtmAR,AuthorNumOfPosts,AuthorHomepage,Status,Warnings,isNew);
w('</td><td width=82%>');
w('<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td class=date1 align=left>');
ThreadRC(blnCE,UserID,UserName,ThID,dtmTD,dtmC,TopicName,ForumName);
w(Message);
} //ThreadRow

function ThRE(ModMessage,Signature){
w('<br/><br/><span class=small3>');
if (blnPrvt == 0) {
if (ModMessage == '') {w(strTxtNoModeratorMsg+'</span>');}
else {w(strTxtModeratorMsg+'</span><br/><br/>'+ModMessage);}}
if (Signature != '') {w('<hr size=1 color=#999999><span class=text>'+Signature+'</span>');}
w('</td></tr></table></td></tr></table>');
} //ThreadRowEnd

//Function to check form is filled in correctly before submitting
function CheckMembersPost( SubmitButton ) {
	//Check for a somthing to search for
	if (document.getElementById("ForumMembersFind").value.length == 0)
	{
	   alert(strTxtNoPost);
	   document.getElementById("ForumMembersFind").focus();
	   return;
	}
	SubmitButton.disabled = true;
	SubmitButton.form.submit();
}

//Function to choose how the members list is sorted
function MembersSort(SelectSort){
   	if (SelectSort != "") self.location.href = "?go=forum&p=members&find=" + strFind + ((strReturnPage!='')?'&r='+strReturnPage:'') + "&sort=" + SelectSort.options[SelectSort.selectedIndex].value;
	return true;
}

function MRow(odd,ID,NAME,HOMEPAGE,EMAIL,LOCATION,JOIN_DATE,LAST_POST,NO_OF_POSTS,LOCKED,BLOCKED,ACTIVE){
w('<tr class=t'+odd+'>');
w('<td width="46" align="center" height="24">');
if (HOMEPAGE != '') {
w('<a href="'+ HOMEPAGE + '" target="_blank"><img src="/forum_images/homepage_icon.gif" border="0" width="14" height="14" alt="' + strTxtVisit + ' ' + NAME + '\'s "' + HOMEPAGE + '"></a>');
}
if (EMAIL != '') {
w('<a href="mailto:' + EMAIL + '"><img src="/forum_images/e-mail_icon.gif" border="0" width="18" height="10" alt="' + strTxtSend + ' ' + NAME + ' ' + strTxtPrivateEmail + '"></a>');
}
if (HOMEPAGE == '' && EMAIL == '') {w('&nbsp;');}
w('</td>');
w('<td width="112" height="24" class="text">');
if (LOCKED != 0 || BLOCKED != 0 || ACTIVE != 1 ) {
w('<img src="/forum_images/lock.gif" align="baseline" alt="'+strTxtBlocked+'">&nbsp;');
}
w('<a href="?go=forum&p=user&id=' + ID + ((strReturnPage!='')?'&r='+strReturnPage:'') + '">' + NAME + '</a></td>');
w('<td width="45" align="center" height="24" class="text">' + NO_OF_POSTS + '</td>');
w('<td width="139" align="left" height="24" class="text">' + ((LAST_POST != '')?'<NOBR>'+LAST_POST+'</NOBR>':'&nbsp;') + '</td>');
w('<td width="139" align="center" height="24" class="text">' + JOIN_DATE + '</td>');
w('<td width="125" height="24" class="text">' + ((LOCATION != '')?LOCATION:'&nbsp;') + '</td>');
w('<td width="58" align="center" height="24">');
(NO_OF_POSTS>0)?w('<a href="/?go=forum&p=search&in=2&m=2&sort=0&fid=-1&s='+ID+((strReturnPage!='')?'&r='+strReturnPage:'')+'"><img src="/forum_images/search_icon.gif" width="20" height="19" border="0" alt="'+strTxtSearchForPosts+'&nbsp;'+NAME+'" align="absmiddle"></a>'):'&nbsp;';
w('</td>');
if (blnAdmin == 1) {
w('<td width="58" align="center" height="24"><a href="?go=forum&p=profile&id='+ID+ ((strReturnPage!='')?'&r='+strReturnPage:'') + '"><img src="/forum_images/edit_post_icon.gif" border="0" width="17" height="17" align="absmiddle" alt="'+strTxtEdit+'"></a></td>');
w('<td width="58" align="center" height="24">');
(NO_OF_POSTS==0)?w('<a href="?go=forum&p=members&m=del&id='+ID+"&find=" + strFind + "&sort="+ strSort + "&page=" + intPage + ((strReturnPage!='')?'&r='+strReturnPage:'') + '" OnClick="return confirm(\''+strTxtDeletePostAlert+'\')"><img src="/forum_images/delete_icon.gif" width="15" height="16" align="absmiddle" alt="'+strTxtDelete+' '+NAME+'" border="0"></a>'):'&nbsp;';
w('</td>');
}
w('</tr>');
} //MRow

function post_form(odd,intMessageID,blnIF,blnNT,blnNF,blnNE,blnSG,blnSGC,blnEN,blnENC,strSubject,strMessage) {
w('<a name="reply"></a>');
w('<div id=post style="z-index: 80000;"  align="center">');
w('<table width="98%" border="0" cellspacing="1" cellpadding="4" align="center">');
if ((blnNT) && (blnPrvt==0)) { w('<tr class=t' + odd + '><td align="right" width="18%" height="12"><span class="text">' + strTxtTopic + ':*:</span></td><td height="12" width="82%"><input type="text" id="NewTopic" name="subject" size="120" maxlength="1000" value="');
   w(strSubject.replace("\"","").replace("\"","")); 
   w('"></td></tr>');
}
w('<tr class=t' + odd + '><td align="right" width="18%" valign="top">');
w('<table width="100%">');
w('<tr><td height="44"></td></tr>');
w('<tr><td align="right"><span class="text">' + strTxtTextFormat + ':</span></td></tr>');
w('<tr><td valign="bottom"><span class="text">*&nbsp;' + strTxtRequiredFields + '</span></td></tr>');
if (blnNF) { w('<tr><td valign="bottom"><span class="text">');insert_quote();w('</span></td></tr>'); }
w('</table></td>');
w('<td width="82%" valign="bottom">');
w('<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr valign="bottom">');
w('<tr><td>');
SelectFont();
SelectFontSize();
SelectFontColor();
w('&nbsp;');
SelectSpecialCharacter();
w('</td></tr>');
PrintEditLine();
PrintEditMessageField(strMessage,strMode,intMessageID);
if (blnNE) { PrintSmileyLine(); }
w('<tr><td><table width="100%"><tr><td align="left" height="7"><span class="text">');
if (blnSG) { w(strTxtShowSignature + '&nbsp;<input type="checkbox" name="signature"' + ((blnSGC)?' checked':'') + '>'); }
//   if (blnEN) { w('&nbsp;&nbsp;' + strTxtEmailNotify + '&nbsp;<input type="checkbox" name="email"' + ((blnENC)?' checked':'') + '>'); } 
w('</span></td></tr></table></td></tr><tr><td>');
w('<table width="100%"><tr><td height="2" width="85%" align="left"><p>');
var strSubmitButtonText='';
if (strMode == 'edit' ) { strSubmitButtonText=strTxtUpdatePost; } else if ((strMode == 'new') && (blnPrvt == 0)) { strSubmitButtonText=strTxtNewTopic; } else { strSubmitButtonText=strTxtPostReply; }
w('<input type="button" id="ForumPostButton" name="Submit" value="' + strSubmitButtonText + '" OnClick="CheckPost(this,\'default.aspx?go=forum&p=post'+((blnPrvt==1)?'_pv':'')+'\');" tabindex="30">');
w('<input type="reset" id="ForumResetButton" name="Reset" value="' + strTxtClearForm + '" OnClick="return confirm(\'' + strResetFormConfirm + '\');">');
w('</p></td><td valign="top" align="right" height="2" width="15%">');
if (blnIF) { w('<input ID="ForumMessageArea" type="hidden" name="message" value="">'); }
w('<input type="hidden" name="mode" value="' + strMode + '">');
w('<input type="hidden" name="id" value="' + intMessageID +'">');
w('<a href="javascript:codes()">' + strTxtForumCodes + '</a>');
w('</td> </tr></table> </td></tr></table></td> </tr></table></div>');
} //post_form

