</div>
<!-- end of the central column.--->

</td>
<!------start of right column-------->
<?php
//$pokp=true;
//$pokp1=true;
//$pokp2=true;
//$pokp3=true;
if ($pokp)    //
{
 if ($pokp1 or $pokp2 or $pokp3)
 {
 echo  '<td id=k6><div style="width:200;height:20;color:';
 if (file_exists($ifa."kpz-c.txt")) {include "plan/pod/kpz-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."kpz-b.txt")) {include "plan/pod/kpz-b.txt";} else {echo " silver";}
 echo '"><center><b>';
 
 
 include "plan/rz.htm";  // 
 echo '</b></center></div>';
 }
 if ($pokp1)
 {
 echo '<DIV id=k3  style="width:200;OVERFLOW: auto;color:'; 
 if (file_exists($ifa."kp1-c.txt")) {include "plan/pod/kp1-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."kp1-b.txt")) {include "plan/pod/kp1-b.txt";} else {echo " silver";}
 echo '" align=left>';
 include "plan/r1t/r1t.htm";
 echo '</div>';
}
 if ($pokp2)
 {
 echo '<DIV id=k4 style="OVERFLOW: auto;width:200;color:';
 if (file_exists($ifa."kp2-c.txt")) {include "plan/pod/kp2-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."kp2-b.txt")) {include "plan/pod/kp2-b.txt";} else {echo " silver";}
 echo '" align=left>';
 include "plan/r2t/r2t.htm";
 echo '</div>';
}
 if ($pokp3)
 {
 echo '<DIV id=k5 style="OVERFLOW: auto;width:200;color:'; 
 if (file_exists($ifa."kp3-c.txt")) {include "plan/pod/kp3-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."kp3-b.txt")) {include "plan/pod/kp3-b.txt";} else {echo " silver";}
 echo '" align=left>';
 include "plan/r3t/r3t.htm";
 echo '</div>';
 echo '</td>';
 }
 }
?>
</tr>
<?php
if ($pokb)
{
  echo '<tr id=podv>
 <td colspan=3>
 <DIV id=k10 style="OVERFLOW: auto;height:75px;width:100%">
 <table border=0 width=100% ><tbody> 
 <tr>';
 if ($pokb1)
 {echo '<!---footer left column---->';
 echo ' <td width=33% valign=top style="color:';
 //pl-b.txt
 if (file_exists($ifa."pl-c.txt")) {include "plan/pod/pl-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."pl-b.txt")) {include "plan/pod/pl-b.txt";}  else {echo " silver";}
 echo '">';
 include "plan/pl/pl.htm";
 echo '</td>';
 }
 if ($pokb2)
 {
 echo '<!---The center column of the footer.---->';
 echo '<td width=33% valign=top style="color:';
 //pc-b.txt
 if (file_exists($ifa."pc-c.txt")) {include "plan/pod/pc-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."pc-b.txt")) {include "plan/pod/pc-b.txt";}  else {echo " silver";}
 echo '">';
 include "plan/pc/pc.htm";
 echo '</td>';
 }
 if ($pokb3)
 {
 echo '<!---footer right column---->';	
 echo '<td width=33% valign=top style="color:';
 //pp-b.txt
 if (file_exists($ifa."pp-c.txt")) {include "plan/pod/pp-c.txt";}
 echo ';background:'; 
 if (file_exists($ifa."pp-b.txt")) {include "plan/pod/pp-b.txt";}  else {echo " silver";}
 echo '">';
 include "plan/pr/pr.htm";
 echo '</td>';
 }
 echo '</tr>'; 
 echo '</tbody>';
 echo '</table>';
 echo '</td>';
 echo '</tr>';
 echo '</div>';
 }
 
?>
</table>

</body>

<script type="text/javascript">
main.style.visibility="hidden";

var retu=location.href;
var rez=false
yk1=document.all["k1"]!=undefined;  //
yk3=document.all["k3"]!=undefined;  //
yk4=document.all["k4"]!=undefined;  //
yk5=document.all["k5"]!=undefined;  //
var d1=0;    
var d1z=0;
var hsap=0
var mg=";",mp=";"
var mj=0
var ipic=1;   // 
var imax=0;    //
w=<?php   if (isset($_GET['scr'])) {echo trim($_GET['scr']);} else {echo "0";} echo "\r\n" ?>
w1=<?php   if (isset($_GET['scr1'])) {echo trim($_GET['scr1']);} else {echo "0";} echo "\r\n" ?>
mg="<?php   if (isset($_GET['vis'])){echo trim($_GET['vis']);} ?>"
var dc=0
//////
  var mob=false;
  var isMobile = {
    Android: function() {
    return navigator.userAgent.match(/Android/i);
    },
    BlackBerry: function() {
    return navigator.userAgent.match(/BlackBerry/i);
    },
    iOS: function() {
    return navigator.userAgent.match(/iPhone|iPad|iPod/i);
    },
    Opera: function() {
    return navigator.userAgent.match(/Opera Mini/i);
    },
    Windows: function() {
    return navigator.userAgent.match(/IEMobile/i);
    },
    any: function() {
    return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
    }
    };
    if(isMobile.any()){
    mob=true
    if (navigator.userAgent.indexOf("Android 2")>0 || navigator.userAgent.indexOf("Android 1")>0 ) 
    {}
    else
	{
//	mob=false
	}
   }
//////
//mob=true
window.onload=function ()
{
onLd(0)
}
/////////////////////////////////////////////
function bez(p)
{
 //$_SERVER['HTTP_REFERER'];
// p.href=$_SERVER['HTTP_REFERER']+"&bez=1";
//location.href=$_SERVER['HTTP_REFERER']+"&bez=1";
alert($_SERVER['HTTP_REFERER'])
 //p.click()
}
/////////////////////////////////////////////////
//**********************************************
// 
//**********************************************
function scre()
{
hsap=qqq1.offsetHeight //sap.scrollHeight+sap1.scrollHeight  giir
document.all["gip1"].style.height=h.offsetHeight-100;
document.all["zip1"].style.height=h.offsetHeight-100;
document.all["gip1"].style.width=h.offsetWidth-200;
document.all["zip1"].style.width=h.offsetWidth-200;
document.all["giir"].style.height=h.offsetHeight-150;
document.all["ziir"].style.height=h.offsetHeight-150;
document.all["giir"].style.width=h.offsetWidth-100;
document.all["ziir"].style.width=h.offsetWidth-100;




if (document.all["podv"]==undefined)  //
{d1=h.offsetHeight-hsap-30;}
else
{d1=h.offsetHeight-hsap-podv.scrollHeight-17;  // 
}
d1z=d1/3;
d2z=d1/2;
if (yk1)               
{k1.style.height=d1-15;
}
if (yk3 & yk4 & yk5)  //
{k3.style.height=d1z-5;
k4.style.height=d1z-5;
k5.style.height=d1z-5;
}
else if (yk3 & !yk4 & !yk5) //
{k3.style.height=d1-15;
}
else if (!yk3 & yk4 & !yk5) // 
{k4.style.height=d1-15;
}
else if (!yk3 & !yk4 & yk5) // 
{k5.style.height=d1-15;
}
else if (yk3 & yk4 & !yk5) // 
{k3.style.height=d2z-8;
k4.style.height=d2z-8;
}
else if (yk3 & !yk4 & yk5) // 
{k3.style.height=d2z-8;
k5.style.height=d2z-8;
}
else if (!yk3 & yk4 & yk5) // 
{k4.style.height=d2z-8;
k5.style.height=d2z-8;}

k2.style.height=d1-15;   // 
kw1=0;
kw2=0;
if (document.all["k1"]!=undefined)
{kw1=k1.offsetWidth;}
if (document.all["k3"]!=undefined)
{kw2=k3.offsetWidth;}
if (document.all["k4"]!=undefined)
{kw2=k4.offsetWidth;}
if (document.all["k5"]!=undefined)
{kw2=k5.offsetWidth;}



k2.style.width=h.offsetWidth-kw1-kw2-15
}


function rez1()
{
main.style.visibility="hidden";
window.location =retu;
main.style.visibility="visible";
scre()
}
function c(j,pt)
{
if  (document.all[j].style.display=="")
{
document.all[j].style.display="none"
pt.src="../d~e~f/plus.gif"
mg=mg.replace(j+";","")
}
else
{
document.all[j].style.display=""
if (mg.indexOf(j+";")>=0) 
{} 
else 
{mg=mg+j+";"
pt.src="../d~e~f/minus.gif"
}}}
//***************************
// 
//**************************
function q1(t,p,p2)
{
if (document.all["k1"]!=undefined)
{p.href=t+"?vis="+mg+"&scr="+document.all["k1"].scrollTop+"&td="+dp}
else
{p.href=t+"?vis="+mg+"&scr=0"+"&td="+dp}
if (p2!=undefined)
{
p.href=p.href+"&p2="+p2
}
p.click()
}
//**********************************
// 
//**********************************
function pgm(j)
{

plan.style.visibility="visible";
//plan.style.height=d1;
//document.all["plan"].style.height=d1;
document.all["z"+j].style.display="";
document.all["z"+j].style.height=400

document.all["kar1"].style.display="";
document.all["kar1"].style.visibility="visible";
mj=j
if (mob)  // 
{
mv=document.all["z"+j].scrollHeight
document.all["z"+j].style.overflow=""
document.all["z"+j].style.height=mv
document.all["kar1"].style.height=mv 
}
}
//**********************************
// 
//**********************************
function b1(j)
{
plan.style.visibility="hidden";
kar1.style.display="none";
document.all["z"+mj].style.display="none";
}
//***********************************
// 
//***********************************
function top1(j)
{obj=document.all["k2"]
obj.scrollTop=0;
}
//***********************************
// 
//***********************************
function top2(j)
{obj=document.all["k1"]
obj.scrollTop=0;
}

//***********************************
// 
//***********************************
function test(j)
{
jj=j.parentNode.parentNode
if (jj.tagName!="FORM")
{
jj=j.parentNode
}
if (jj.elements[0].value=="" || jj.elements[1].value=="")
{
alert("Fields are not filled! Fill in and repeat!")
}
else
{
poz1=retu.indexOf("/pages/")
poz2=retu.indexOf(".php")
w=retu.substring(poz1+7,poz2+4)
if (document.all["k"]!=undefined)
{src=document.all["k"].scrollTop}
else
{src=0}

if (mob)
{
jj.action="../pages/"+w+"?vis="+mg+"&scr="+src+"&scr1="+document.all["bod"].scrollTop+"&td="+dp
jj.elements["sub"].click()
}
else
{
jj.action="../pages/"+w+"?vis="+mg+"&scr="+src+"&scr1="+document.all["k2"].scrollTop+"&td="+dp
jj.elements["sub"].click()
}}
}

//***********************************
// 
//***********************************

function test1(j)
{
jj=j.parentNode.parentNode.parentNode.parentNode.parentNode
if (jj.elements[0].value=="" || jj.elements[1].value=="")
{
alert("Fields are not filled! Fill in and repeat!")
}
else
{
poz1=retu.indexOf("/pages/")
poz2=retu.indexOf(".php")
w=retu.substring(poz1+7,poz2+4)
if (document.all["k"]!=undefined)
{src=document.all["k"].scrollTop}
else
{src=0}

if (mob)
{
jj.action="../pages/"+w+"?vis="+mg+"&scr="+src+"&scr1="+document.all["bod"].scrollTop+"&td="+dp
jj.elements["sub"].click()
}
else
{
jj.action="../pages/"+w+"?vis="+mg+"&scr="+src+"&scr1="+document.all["k2"].scrollTop+"&td="+dp
jj.elements["sub"].click()
}
}
}

//***********************************
// 
//***********************************
// 
var zs =document.getElementById("k2").getElementsByTagName("IMG");
var itek=0;   // 
var iauto="";
/////////
function pon(p)  // 
{
if (mob)
{
document.all["im"].style.height=""  //300
document.all["im"].style.width=""  //450
rew=a_i(2)
}
else
{
document.all["im"].style.width="";
document.all["im"].style.height="";
}

im.style.visibility="visible"
}
///////// 
var tm;
function av(j)
{ tm=setInterval(v, 5000);
 document.all["p_s1"].innerHTML="START, 5 sec.";
}
////// 
function v(j)
{
rew=a_f(j);
}
////// 
function st()
{
clearInterval(tm);
document.all["p_s1"].innerHTML="STOP";
}
//// 
function a_i(p)
{

a_ih=parseInt(document.all["im"].offsetHeight)  //
a_iw=parseInt(document.all["im"].offsetWidth)   //
a_ih2=parseInt(document.all["pic_d"].offsetHeight)  // 
a_iw2=parseInt(document.all["pic_d"].offsetWidth)   // 
if (a_ih2<=a_iw2)        // 
{
document.all["im"].style.height=a_ih2
}
else                   // 
{
document.all["im"].style.width=a_iw2;
}
a_ih=parseInt(document.all["im"].offsetHeight)  //
a_iw=parseInt(document.all["im"].offsetWidth)   //

if (a_ih>a_ih2)
{
document.all["im"].style.width=""
document.all["im"].style.height=a_ih2 
}
else
{
if (a_iw>a_iw2)
{
document.all["im"].style.width=a_iw2 
document.all["im"].style.height="" 
}
}




}
var pic = new Array()
//////////////////////////////////////////////////////
function a(j)
{
if (mob)
{
document.all["pic_d"].style.height=300 //h.offsetHeight-400;
document.all["pic_d"].style.width=550  //h.offsetWidth-300;
document.all["kar"].style.top=document.getElementById('bod').scrollTop
}
else
{
document.all["pic_d"].style.height=h.offsetHeight-200;
document.all["pic_d"].style.width=h.offsetWidth-300;
}
document.all["kar"].style.height=h.offsetHeight;
document.all["kar"].style.width=h.offsetWidth;


document.all["po"].innerHTML=j.title;
im.style.visibility="hidden"
k=0;
if (imax==0 )   //
{
for(var i=0; i<zs.length; i++)
{if (zs[i].id!="")
{
pic[k++]=i;
}}
imax=k;
}
document.all["im"].src=j.id;
if (mob)
{document.all["im"].style.height=h.offsetHeight-300;
document.all["im"].style.width=h.offsetWidth-400;
}


for(var i=0; i<pic.length; i++)
{
if (zs[pic[i]].id==j.id) {break;}
}
itek=i;

document.all["kar"].style.display="";
//alert(document.all["kar"].style.display)
document.all["p_s"].innerHTML="&nbsp;&nbsp;&nbsp;"+(itek+1)+"/"+imax;
document.all["ppp"].style.visibility="visible";
}
//***********************************
// 
//***********************************
function b(j)
{im.src="";
clearInterval(tm);
document.all["p_s1"].innerHTML="";
document.all["p_s"].innerHTML="";
ppp.style.visibility="hidden";
kar.style.display="none";}

//***********************************
// 
//***********************************
function a_f(j)
{
itek++;
//im.style.visibility="hidden"
if (itek>imax-1) {itek=0;} 
im.src=zs[pic[itek]].id;
document.all["p_s"].innerHTML="&nbsp;&nbsp;&nbsp;"+(itek+1)+"/"+imax;
document.all["po"].innerHTML=zs[pic[itek]].title;

}

//***********************************
// 
//***********************************
function a_b(j)
{
itek--;
//im.style.visibility="hidden"
if (itek<0) {itek=imax-1;} 
im.src=zs[pic[itek]].id;
document.all["p_s"].innerHTML="&nbsp;&nbsp;&nbsp;"+(itek+1)+"/"+imax;
document.all["po"].innerHTML=zs[pic[itek]].title;
}
//***********************************
// 
//***********************************
function a_auto(j)
{}


//***********************************
// 
//***********************************
function a_begin(j)
{itek=0;
im.src=zs[pic[itek]].id;
document.all["p_s"].innerHTML="&nbsp;&nbsp;&nbsp;"+(itek+1)+"/"+imax;
document.all["po"].innerHTML=zs[pic[itek]].title;
}


//***********************************
// 
//***********************************
function a_end(j)
{itek=imax-1;
im.src=zs[pic[itek]].id;
document.all["p_s"].innerHTML="&nbsp;&nbsp;&nbsp;"+(itek+1)+"/"+imax;
document.all["po"].innerHTML=zs[pic[itek]].title;
}

//******************************************************
function karp(j)
{
}
//*****************************
//
function list_all(p,nt)
{pm=p.parentNode.parentNode.getElementsByTagName(nt)
pim=p.parentNode.getElementsByTagName("IMG")
if (p.src.indexOf("minus.gif")>0)
{
for(var j = 0; j < pim.length; j++)       // 
{if (pim[j].src.indexOf("minus.gif")>0)
{pim[j].src="../d~e~f/plus.gif"}
}
for(var j = 1; j < pm.length; j++)       // 
{pm[j].style.display="none"}
}
else
{for(var j = 0; j < pim.length; j++)       // 
{if (pim[j].src.indexOf("plus.gif")>0)
{pim[j].src="../d~e~f/minus.gif"}
}
for(var j = 0; j < pm.length; j++)       // 
{pm[j].style.display=""}
for(var j = 0; j < pm.length; j++)       // 
{pm[j].style.display=""}
}
if (mob)  //
{document.all["bod"].scrollTop=p.parentNode.offsetTop+document.getElementById("sap").offsetHeight-20
}
else
{document.getElementById("k2").scrollTop=p.parentNode.offsetTop-20
}
}

//************************
//
function list_z(p,nt)
{tek=p.parentNode.getElementsByTagName(nt)[0].style
if (tek.display=="")
{tek.display="none"
p.src="../d~e~f/plus.gif"}
else
{tek.display=""
p.src="../d~e~f/minus.gif"}
}

//*********************************************************
function konsp(p)  //
//********************************************************
{t2=p
if (t2.id!="s")                     // 
{for(var j = 0; j <9999 ; j++)  
{t2=t2.parentNode
if (t2.lang=="ko")
{break}
}}
t22=t2
mt2=t2.getElementsByTagName("div")  //
for(var j = 0; j <9999 ; j++)  
{if (mt2[j].id=="kons")
{t2=mt2[j]
break}
}
if (t2.style.display=="")
{t2.style.display="none"
p.src="../d~e~f/plus.gif"}
else
{t2.style.display=""
p.src="../d~e~f/minus.gif"}
if (mob)  // 
{document.all["bod"].scrollTop=t22.offsetTop   //+document.getElementById("sap").offsetHeight-20
}
else
{document.getElementById("k2").scrollTop=t22.offsetTop  //-20
}
}

//******************************************************
// 
//******************************************************
knn=0    // 
function ziie(j)
{
if (mob)    //
{window.top.document.getElementById('bod').scrollTop=knn
}
if (j==2 || j==4)
{ppp.style.visibility="hidden"
zii.style.display="none"
gii.style.display="none"
document.getElementById("buh").style.background="#dcdcdc"
document.getElementById("buh2").style.background="#dcdcdc"
return
}
phtml=false
if (j==3)
{mid='ziir'
mmm2=" "+document.getElementById("buh2").style.background
if (mmm2.indexOf("white")>0) phtml=true
}
else if (j==1)
{mid='giir'
mmm2=" "+document.getElementById("buh").style.background
if (mmm2.indexOf("white")>0) phtml=true
}
tags44=document.getElementById(mid).value
if (tags44.indexOf("/#")>=0 || tags44.indexOf("#/")>=0)
{alert("/ #, # /  character pairs found.\r\n Delete them, or end selection and redo.")
return
}
tags4=tags44.split("¶¶") 
tags5=tags.split("<#>") 
pos=false
if (phtml)    // 
{
if (" "+tags44.indexOf("¶¶")>0) 
{pos=true}
else
{qwe2=tags44}
}
else          // 
{if (tags5.length!=tags4.length) 
{pos=true}
else
{
for (i=0;i<=tags4.length-1;i++) 
{
tags44=tags44.replace("¶¶",tags5[i])
}
qwe2=tags44
}
}
if (pos)
{alert("Saving is impossible! \r\n There was a deletion or addition of \r\n delimited characters in the form ¶¶. "+
"\r\n Start over!")
return
}
if (!code_check("<div>"+qwe2+"</div>"))      //
{return}	
document.getElementById("buh2").style.background="#dcdcdc"
document.getElementById("buh").style.background="#dcdcdc"
document.getElementById("but2").style.background="#dcdcdc"
document.getElementById("but").style.background="#dcdcdc"
if (j==1)   // 
{document.getElementsByTagName('iframe')['ifr'].contentWindow.document.getElementById("feg").elements["eg_e"].value=qwe2
document.getElementsByTagName('iframe')['ifr'].contentWindow.document.getElementById("feg").elements["eg_sav"].click();
}
else if (j==3)   // 
{document.getElementsByTagName('iframe')['ifrzk'].contentWindow.document.getElementById("fzk").elements["zk_e"].value=qwe2
document.getElementsByTagName('iframe')['ifrzk'].contentWindow.document.getElementById("fzk").elements["zk_sav"].click();
}
ppp.style.visibility="hidden";
zii.style.display="none";
gii.style.display="none";
}


//*****************************************************
function gip(j)
{
//document.getElementById('bod').scrollTop=document.getElementsByTagName('iframe')['ifr'].contentWindow.rewscr
document.getElementById("ppp").style.visibility="hidden";
document.getElementById("gip").style.display="none";
if (mob)    //
{
window.top.document.getElementById('bod').scrollTop=knn
}

}

//******************************************************
function zip(j)
{document.getElementById("ppp").style.visibility="hidden";
document.getElementById("zip").style.display="none";
if (mob)    //
{
window.top.document.getElementById('bod').scrollTop=knn
}

}




//****************************************************************************
// 

function getCaretPos2(p,event) 
//***************************************************************************
{


if (p.id=="ziir")
{mbut="but2"}
else
{mbut="but"}
mmm=p.parentNode.parentNode.parentNode.parentNode.parentNode     //
obj2=mmm.getElementsByTagName("INPUT")[0]
mmm2=" "+document.getElementById(mbut).style.background
if (mmm2.indexOf("white")==0)
{alert("Paste is only possible in hidden tag mode. \r\n Click 'TXT' and repeat!")
return
}
obj=mmm.getElementsByTagName("TEXTAREA")[0]  
obj.focus();
scrw=obj.scrollTop
vte=0
  if (document.selection) 
  { // IE
    var sel = document.selection.createRange();
	vte=sel.text.length
    if (vte!=0) return
    var clone = sel.duplicate();
    sel.collapse(true);
    clone.moveToElementText(obj);
    clone.setEndPoint('EndToEnd', sel);
    re= clone.text.length;
  } 
  else if (obj.selectionStart!==false) 
  {
 if (obj.selectionStart!=obj.selectionEnd)
   {return}
  re= obj.selectionStart; 
  }
  else 
  {re= 0;}
  if (obj2.value=="")
{
return
}
  mmm= obj.value
	if (re==obj.innerHTML.length)
	{obj.value=mmm+obj2.value}
	else
	{obj.value=mmm.substr( 0, re)+ obj2.value+
	mmm.substr(re)
	}
  obj.scrollTop=scrw
  }
//*****************************************************
// 
//function vin(p)
var vta2t=""
function vta2(p,event)
//*******************************************
{
ev = event || window.event
var t = ev.target || ev.srcElement
if (t.tagName!="A") return

//****************************************************
{minput=p.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")  //
for(var j = 0; j < minput.length; j++)       //   
{if (minput[j].id=="inn")                       //
{j2=j
break
}}
tin=t.innerHTML.replace(new RegExp("&nbsp;",'g'),"")

if (tin=="date")
{minput[j2].value=' '+Date().toString()+' '
} 
else if (tin=="LI")
{minput[j2].value='<LI>'
} 
else if (tin=="OL")
{minput[j2].value='<OL><LI>first<LI>second<LI>third</OL>'} 
else if (tin=="UL")
{minput[j2].value='<UL><LI>first<LI>second<LI>third</UL>'} 
else if (tin=="HR")
{minput[j2].value='<HR>'
} 
else if (tin=="BR")
{minput[j2].value='<BR>'
} 
else if 
(tin=="N")
{minput[j2].value='\r\n'+'<br>&#160;&#160;&#160;'
} 
else
{minput[j2].value=tin
vta2t=t.innerHTML
}}}

//********************************************
// 
function zvin2(p)
//*******************************************
{mmm=p.parentNode.parentNode.parentNode.parentNode.parentNode
vin=mmm.getElementsByTagName("INPUT")[0]
vin.value=""
}

//********************************************
// 
function zvin3(p)
//*******************************************
{mmm=p.parentNode.parentNode.parentNode.parentNode.parentNode
vin=mmm.getElementsByTagName("TEXTAREA")[0]
vin.value=""
tags=""
}
var oldvta=""
button_HTML_TXT=""
//********************************************
// 
function vta(p,event)  
//*******************************************
{ev = event || window.event
var t = ev.target || ev.srcElement
mmm=p.parentNode.parentNode.parentNode.parentNode.parentNode     //
mmm.getElementsByTagName("INPUT")[0].value=""                    //
obj=mmm.getElementsByTagName("TEXTAREA")[0]  
if (obj.id=="ziir")
{mbut="but2"}
else
{mbut="but"}
mmm2=" "+document.getElementById(mbut).style.background
if (mmm2.indexOf("white")==0)
{alert("Tagging is only possible in hidden tag mode. \r\n Click 'TXT' and repeat!")
return
}
mmg=obj.value.split("/#")
mmg2=obj.value.split("#/")
if  (oldvta!="")
{oldvta.style.background="#dcdcdc"
}
if (t.tagName!="A") return
t.style.background="yellow"
oldvta=t
if (t.style.color!="")
{colo=t.style.color}
else
{colo="#4682b4"}
ppp2=t.innerHTML.replace(new RegExp("&nbsp;",'g'),"")            //t.innerHTML
// IE---------------------------------------------------------------------------
if (document.selection)    
{var sel = document.selection.createRange();
vte=sel.text.length
//
//-------------------
if (vte!=0)       // 
{if	(sel.text.indexOf("<")>=0 || sel.text.indexOf(">")>=0 || sel.text.indexOf("¶")>=0 )
{alert("Incorrect selection, \r\ninvalid characters in it: <,>, ¶") 	
return	
}	
	if (ppp2=="A")
	{sel.text=sel.text.toUpperCase()}
	else if (ppp2=="a")
	{sel.text=sel.text.toLowerCase()}
	else if (ppp2=="«»")
	{sel.text="«"+sel.text+"»"}
	else if (ppp2=="BR")
	{sel.text=+sel.text+"<BR>"}
	else if (ppp2=="LI")
	{sel.text="<LI>"+sel.text}
	else if (ppp2=="HR")
	{sel.text=sel.text+"<HR>"}
	else if (ppp2=="H1" || ppp2=="H2"  || ppp2=="H3" || ppp2=="H4"  || ppp2=="H5"  || ppp2=="H6")
	{sel.text="<"+ppp2+" style=color:"+colo+">"+sel.text+"</"+ppp2+">"}
else
{sel.text="<"+ppp2+" style=color:"+colo+">"+sel.text+"</"+ppp2+">"
}}}
//--------------------------------------------
else     // 
//--------------------------------------------
{start= obj.selectionStart;
end=obj.selectionEnd;
if (start!=end)                   //
{vte=1
sel_text=obj.value.substr(start,end-start)	
if 	(sel_text.indexOf("<")>=0 || sel_text.indexOf(">")>=0 || sel_text.indexOf("¶")>=0 )
{alert("Incorrect selection, \r\n invalid characters in it: <,>, ¶") 	
return	
}
  if (ppp2=="A")
	{obj.value = obj.value.substr( 0, start)+obj.value.substr(start,end-start).toUpperCase()+obj.value.substr(end)}
	else if (ppp2=="a")
	{obj.value = obj.value.substr( 0, start)+obj.value.substr(start,end-start).toLowerCase()+obj.value.substr(end)}
	else if (ppp2=="«»")
	{obj.value = obj.value.substr( 0, start )+"«"+obj.value.substr(start,end-start)+"»"+obj.value.substr(end)}
	else if (ppp2=="BR")
	{obj.value = obj.value+"<BR>"}
	else if (ppp2=="LI")
	{obj.value="<LI>"+obj.value}
	else if (ppp2=="HR")
	{obj.value=obj.value+"<HR>"}
	else if (ppp2=="H1" || ppp2=="H2"  || ppp2=="H3" || ppp2=="H4"  || ppp2=="H5"  || ppp2=="H6")
	{	obj.value = obj.value.substr( 0, start )+"<"+ppp2+" style=color:#4682b4>"+obj.value.substr(start,end-start)+"</"+ppp2+">"+obj.value.substr(end)
	}
	else
{{obj.value = obj.value.substr( 0, start )+"<"+ppp2+" style='color:"+colo+"'>"+obj.value.substr(start,end-start)+"</"+ppp2+">"+obj.value.substr(end)
}}}}
//
//-------------------------------------
if  (mmg.length!=mmg2.length)
{alert("There is a mismatch in the number of heads (/ #) and tails (# /) characters in the text field! \r\n Select correctly and repeat! ")
 return}
else
{if  (mmg.length==1)         //
 {}
 else                        //
 {obj.value =obj.value.replace(/\/\#/g,"<"+ppp2+" style=color:"+colo+">")
 obj.value =obj.value.replace(/\#\//g,"</"+ppp2+">")
}}	
if (mmg.length==1 && vte==0)
{alert("No highlighting, no select with symbols /#, #/! \r\n Highlight the required text and repeat!")}	
if (window.getSelection)                    //
{window.getSelection().removeAllRanges()
} 
else 
{document.selection.empty()               //
}}


function gip6(p,event)   // this
//*******************************************
{
if (p.id=="zip1")
{
mscr="cbzip"
}
else
{
mscr="cbgip"
}

if (document.getElementById(mscr).src.indexOf("no.gif")>0) return
ev = event || window.event
var t = ev.target || ev.srcElement
if (t.id=="blq" || t.id=="gip1" || t.id=="zip1" || t.tagname=="TABLE"  ) return
try {t.outerHTML=t.innerHTML
	  throw {message: "Prohibited!"}
	} catch (e) {
	return 
}
 
 }


//**********************************************
// 
function atip2(p)
//*********************************************
{
//if (document.getElementById("tde")!=undefined)
//{
if (p.src.indexOf("no.gif")>0)
{p.src="../d~e~f/yes.gif"}
else
{p.src="../d~e~f/no.gif"}
}



//************************************
// 
function gip7(p,event)   // this
//*******************************************
{if (p.id=="gip10")
{if (document.getElementById("cbgip").src.indexOf("yes.gif")>0)  // 
{if (document.getElementsByTagName('iframe')['ifr'].contentWindow.document.getElementById("feg").elements["eg_e"].value=="")
{return}
mmm=document.getElementById("gip1").innerHTML
if (mmm.indexOf("</TEXTAREA>")>0)
{rzd="</TEXTAREA>"}
else if (mmm.indexOf("</textarea>")>0)
{rzd="</textarea>"}
mmg=document.getElementById("gip1").innerHTML.split(rzd)
document.getElementsByTagName('iframe')['ifr'].contentWindow.document.getElementById("feg").elements["eghtml"].style.display=""
document.getElementsByTagName('iframe')['ifr'].contentWindow.document.getElementById("feg").elements["eg_e"].value=mmg[1];
document.getElementsByTagName('iframe')['ifr'].contentWindow.document.getElementById("feg").elements["eg_sav"].click();
}}
if (p.id=="zip10")
{if (document.getElementById("cbzip").src.indexOf("yes.gif")>0)  
{if (document.getElementsByTagName('iframe')['ifrzk'].contentWindow.document.getElementById("fzk").elements["zk_e"].value=="")
{return}
mmm=document.getElementById("zip1").innerHTML
if (mmm.indexOf("</TEXTAREA>")>0)
{rzd="</TEXTAREA>"}
else if (mmm.indexOf("</textarea>")>0)
{rzd="</textarea>"}
mmg=document.getElementById("zip1").innerHTML.split(rzd)
document.getElementsByTagName('iframe')['ifrzk'].contentWindow.document.getElementById("fzk").elements["zkhtml"].style.display=""
document.getElementsByTagName('iframe')['ifrzk'].contentWindow.document.getElementById("fzk").elements["zk_e"].value=mmg[1];
document.getElementsByTagName('iframe')['ifrzk'].contentWindow.document.getElementById("fzk").elements["zk_sav"].click();
}}
document.getElementById("cbgip").src="../d~e~f/no.gif"
document.getElementById("cbzip").src="../d~e~f/no.gif"
document.getElementById("ppp").style.visibility="hidden";
document.getElementById("gip").style.display="none";
document.getElementById("zip").style.display="none";
if (mob)    //
{
window.top.document.getElementById('bod').scrollTop=knn
}
}

//************************************
// 
function gip8(p,event)   // this
//*******************************************
{ttt=p.parentNode.parentNode.parentNode.parentNode.parentNode.id
dop=window.open("","","");
tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head>"
if (ttt=="zip")
{ng="<h2>NOTEBOOK</h2>"
tnap=tnap+"<center>"+document.getElementById("sname4").innerHTML+"<br>"+ng+"<br>"+"</center>"+document.getElementById(ttt+"1").innerHTML+"</html>"
}
else
{ng="<h2>DIARY</h2>"
tnap=tnap+"<center>"+document.getElementById("sname3").innerHTML+"<br>"+ng+"<br>"+"</center>"+document.getElementById(ttt+"1").innerHTML+"</html>"
}
dop.document.write(tnap)
}


//********************************************************
// 
function but2(p)
//*******************************************************
{
if (p.style.background=="white") return
if (p.id=="buh2")
{mid='ziir'}
else
{mid='giir'}
tags44=document.getElementById(mid).value
tags44=tags44.replace(/\r/g,"")
tags44=tags44.replace(/\n/g,"")
tags4=tags44.split("¶¶") 
tags5=tags.split("<#>") 
if (tags5.length!=tags4.length && tags4.length>1 )
{alert("No conversion possible! \r\n Was the deletion or addition of \r\nseparated characters like ¶¶. \r\n Start over!")
return
}
if (p.id=="buh2")
{document.getElementById("buh2").style.background="white"
document.getElementById("but2").style.background="#dcdcdc"
}
else
{document.getElementById("buh").style.background="white"
document.getElementById("but").style.background="#dcdcdc"
}
qwe2=""
for (i=0;i<=tags4.length-1;i++) 
{
if (i==0)
{qwe2=qwe2+tags4[i]+"\r\n"+tags5[i].replace(/></g,">\r\n<")
}
else
{qwe2=qwe2+"\r\n"+tags4[i]+"\r\n"+tags5[i].replace(/></g,">\r\n<")
}
}
document.getElementById(mid).value=qwe2
}

//********************************************************
var tags = ""                     //
//********************************************************
//  
function but3(p)
//********************************************************
{
if (p.id=="but2")
{document.getElementById("but2").style.background="white"
document.getElementById("buh2").style.background="#dcdcdc"
mid='ziir'
}
else
{document.getElementById("but").style.background="white"
document.getElementById("buh").style.background="#dcdcdc"
mid='giir'
}
// 
tags3=document.getElementById(mid).value
document.getElementById(mid).value=tags3.replace(/\.\./g,"")

ktex=document.getElementById(mid).value
qwe=ktex.replace(/\r/g,"")
qwe=qwe.replace(/\n/g,"")
qwe=qwe.replace(/></g,"~~")
qwe=qwe.replace(/> </g,"~~")
qwe=qwe.replace(/>  </g,"~~")
qwe=qwe.replace(/>   </g,"~~")
qwe=qwe.replace(/>    </g,"~~")
qwe=qwe.replace(/</g,"¶¶")
qwe=qwe.replace(/>/g,"¶¶")
qwe=qwe.replace(/~~/g,"><")
mmm=qwe.split("¶¶")
tt=""
pzz=""
tags=""
for (i=0;i<=mmm.length-1;i++) 
{
kdo=""
kposle=""
if (i%2==1)                           //
{tt="<"+mmm[i]+">"
tags=tags+tt+"<#>"                    //
tt=" "+tt.toUpperCase()
pzz=pzz+"\r\n¶¶"
}
else                                  //
{
pzz=pzz+mmm[i]
}}
document.getElementById(mid).value=pzz
}

//***************************************************
function utag(p)  //
//***************************************************
{if (confirm("All tags will be removed, \r\n sure you want this?"))
{document.getElementById(mid).value=document.getElementById(mid).value.replace(/¶¶/g,"")
tags=""
}
if (!code_check("<div>"+document.getElementById(mid).value	+"</div>"))      //
{return}
www9=document.getElementById(mid).value	
if (www9.indexOf("<")>=0)
{while (www9.indexOf("<")>=0)
{poz_begin=www9.indexOf("<")
poz_end=www9.indexOf(">")
www9=www9.substr(0,poz_begin)+www9.substr(poz_end+1)
}}
document.getElementById(mid).value=www9
}

//**********************************************************
// 
function getsel(p) 
//*********************************************************
{minput=p.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")  //
for(var j = 0; j < minput.length; j++)                                    //
{if (minput[j].id=="inn")                                                 //
{j2=j
break
}}
  minput[j2].value=""                                                              // 
  var obj=p.parentNode.parentNode.parentNode.getElementsByTagName("TEXTAREA")[0]  //
//  obj.focus();
  if (document.selection) 
  { // IE
    var sel = document.selection.createRange();
	vte=sel.text.length
    if (vte==0) 
	{alert("No selection in text field! \r\n Highlight and repeat!")
		return
    }
    ppp2=p.title.substr(0,1)
    if (ppp2=="1")
	{sel.text=sel.text.toUpperCase()}
	else if (ppp2=="2")
	{sel.text=sel.text.toLowerCase()}
	else
	{sel.text="«"+sel.text+"»"}
}
  else if (obj.selectionStart!==false) 
  {start= obj.selectionStart;
  end=obj.selectionEnd;
  if (start==end) 
  {
  alert("No selection in text field! \r\n Highlight and repeat!")
  return
  }
  ppp2=p.title.substr(0,1)
    if (ppp2=="1")
	{obj.value = obj.value.substr( 0, start)+obj.value.substr(start,end-start).toUpperCase()+obj.value.substr(end)
	}
	else if (ppp2=="2")
	{obj.value = obj.value.substr( 0, start)+obj.value.substr(start,end-start).toLowerCase()+obj.value.substr(end)}
	else
	{obj.value = obj.value.substr( 0, start )+"«"+obj.value.substr(start,end-start)+"»"+obj.value.substr(end)}
  }
  else 
  {}
  }

//*****************************************************
// 
function vin(p)
//****************************************************
{
minput=p.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")  // 
for(var j = 0; j < minput.length; j++)                                   // 
{if (minput[j].id=="inn")                                                 //
{j2=j
break
}}
if (p.innerHTML=="date")
{minput[j2].value=' '+Date().toString()+' '
} 
else
{minput[j2].value=p.innerHTML
}} 

//*********************************************************************************
// 
function getCaretPos(p) 
//********************************************************************************
{minput=p.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")  //
for(var j = 0; j < minput.length; j++)                                    //
{if (minput[j].id=="inn")                                                 //
{j2=j
break
}}
 p.parentNode.elements[1].focus();
if (minput[j2].value=="") return                                          //
  var obj = p.parentNode.elements[1]                                      //
  if (document.selection) 
  {var sel = document.selection.createRange();   // IE
	vte=sel.text.length
    if (vte!=0) return
    var clone = sel.duplicate();
    sel.collapse(true);
    clone.moveToElementText(obj);
    clone.setEndPoint('EndToEnd', sel);
    re= clone.text.length;
  } 
  else if (obj.selectionStart!==false) 
  {if (obj.selectionStart!=obj.selectionEnd)
   {return}
  re= obj.selectionStart; 
  }
  else 
  {re= 0;}
	mmm= obj.value
	if (re==obj.innerHTML.length)
	{obj.value=mmm+minput[j2].value}
	else
	{obj.value=mmm.substr( 0, re)+ minput[j2].value+
	mmm.substr(re)
	}
  }

//********************************************
// 
function zvin(p)
//*******************************************
{minput=p.parentNode.parentNode.parentNode.getElementsByTagName("INPUT")
for(var j2 = 0; j2 < minput.length; j2++)
{if (minput[j2].id=="inn") 
{minput[j2].value=''
break
}}}

scr2=0
zgsm=document.getElementById('zgs').innerHTML
rzk2=document.getElementById('k2').offsetWidth

//********************************************
// 
function zaLL()
//*******************************************
{if (document.getElementById('sap').style.display=='none') return 
if (document.all['kL']!=undefined)
{document.getElementById('kL').style.display='none'
scr2=document.getElementById('k1').scrollTop
}
if (document.all['k6']!=undefined)
{document.getElementById('k6').style.display='none';}
if (document.all['k10']!=undefined)
{document.getElementById('k10').style.display='none';}
document.getElementById('sap').style.display='none';
document.getElementById('k2').style.width=document.getElementById('main').clientWidth-7 
document.getElementById('k2').style.height=document.getElementById('main').clientHeight-30
}

//********************************************
// 
function zaLL2()
//*******************************************
{if (document.getElementById('sap').style.display=='') return 
if (document.all['kL']!=undefined)
{document.getElementById('kL').style.display=''
document.getElementById('kL').scrollTop=scr2
}
if (document.all['k10']!=undefined)
{document.getElementById('k10').style.display=''}
if (document.all['k6']!=undefined)
{document.getElementById('k6').style.display=''}

document.getElementById('sap').style.display=''
document.getElementById('zgs').innerHTML=zgsm
onLd(2)
document.all["k2"].style.width=document.all["k2"].parentNode.offsetWidth
}

//******************************************************
function onLd(p)    
//******************************************************   
{if(!mob)
{scre();}
// 
if (document.all["k1"]!=undefined)
{mmg=mg.split(";")
for (i=0;i<=mmg.length-2;i++) 
{document.all[mmg[i]].style.display=""
if (mmg[i].indexOf("s")==0)
{document.all["s"+mmg[i]].src="../d~e~f/minus.gif"}
if (mmg[i].indexOf("g")==0)
{document.all["g"+mmg[i]].src="../d~e~f/minus.gif"}
}
document.all["k1"].scrollTop=w;
document.all["k1"].scrollTop=w;
document.all["k1"].scrollTop=w;
}
document.all["k2"].scrollTop=w1;
document.all["k2"].scrollTop=w1;
document.all["k2"].scrollTop=w1;

if (document.all["rep1"]!=undefined)
{alert(document.all["rep1"].innerHTML)
}
else
{if (document.all["rep"]!=undefined)
{if (p==0)
{alert(document.all["rep"].innerHTML)
}}}
main.style.visibility="visible";
if(!mob)
{if (sap1.offsetHeight>45)
{sap1.style.height=60;
scre();
}}
else
///////////////
{document.all["vxod"].style.display="none"     // 
document.all["bod"].style.overflow=""
if (document.all["podv"]!=undefined)
{document.all["k10"].style.height=document.all["k10"].scrollHeight;}
if (yk1)
{d1=document.all["k1"].offsetHeight;}
else
{d1=0;}
if (d1<document.all["k2"].offsetHeight)
{d1=document.all["k2"].offsetHeight;
}
else
{document.all["k2"].style.height=d1;
}
d1z=d1/3;
d2z=d1/2;
if (yk3 & yk4 & yk5)  // 
{k3.style.height=d1z;
k4.style.height=d1z;
k5.style.height=d1z;
}
else if (yk3 & !yk4 & !yk5) // 
{k3.style.height=d1;
}
else if (!yk3 & yk4 & !yk5) // 
{k4.style.height=d1;
}
else if (!yk3 & !yk4 & yk5) // 
{k5.style.height=d1;
}
else if (yk3 & yk4 & !yk5) // 
{k3.style.height=d2z;
k4.style.height=d2z;
}
else if (yk3 & !yk4 & yk5) // 
{k3.style.height=d2z;
k5.style.height=d2z;
}
else if (!yk3 & yk4 & yk5) // 
{k4.style.height=d2z;
k5.style.height=d2z;}
if (yk1)
{
k1.style.height=d1;
}

if (w1!=0)
{
obj=document.all["bod"];
obj.scrollTop=w1;
}
}
document.all["ppp"].style.height=document.all["h"].offsetHeight;
document.all["plan"].style.height=document.all["h"].offsetHeight;
document.all["ppp"].style.width=document.all["h"].offsetWidth;
document.all["plan"].style.width=document.all["h"].offsetWidth;
document.all["bod"].style.visibility="visible";
}
//
va=""
function k2f(event)
{ev = event || window.event
var t = ev.target || ev.srcElement
if (t.tagName!="A") return
if (va=="")
{}
else
{va.style.border=""}
t.style.border="brown 2px double"
va=t
}

//********************************************************************
function tabtop(p)   //
//********************************************************************
{tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head>"
tnap=tnap+"<h2 style='text-align:center'>"+document.getElementById("sname2").innerHTML+"</h2>"+
"<h2 style='text-align:center'>"+document.getElementById("zagvs").innerHTML+"</h2>"
tnap=tnap+document.getElementById("k2").innerHTML
tnap=tnap.replace(/onclick/g,"oncl")
tnap=tnap+"</html>"
dop=window.open("","","");
dop.document.write(tnap)
}

//*******************************************************************
 function to_change() // 
 //******************************************************************
 { if (document.selection) 
 {var sel = document.selection.createRange(); // IE
vte=sel.text.length
 if (vte==0) 
 {alert("No selection in text field! \r\n Highlight and repeat!")
 return
 }
 else
{if (sel.text.indexOf("#/")>=0 || sel.text.indexOf("/#")>=0) 	
{alert("The selection contains /# or #/! \r\n This is not allowed! \r\n Fix it and repeat!")
return
}	
else if (sel.text.indexOf("¶")>=0 || sel.text.indexOf(">")>=0 || sel.text.indexOf("<")>=0 ) 	
{alert("The selection contains ¶,>, <! \r\n This is not allowed! \r\n Fix it and repeat!")
return
}
else
{sel.text="/#"+sel.text+"#/"}
}}
//-----------------------------------------------------------
else if (obj.selectionStart!==false)   //
{start= obj.selectionStart;
end=obj.selectionEnd;
if (start==end) 
{alert("No selection in text field! \r\n Highlight and repeat!")
 return
}
 else
{
sel_text=obj.value.substr(start,end-start)
if (sel_text.indexOf("#/")>=0 || sel_text.indexOf("/#")>=0) 	
{alert("The selection contains /# or #/! \r\n This is not allowed! \r\n Fix it and repeat!")
return
}	
else if (sel_text.indexOf("¶")>=0 || sel_text.indexOf(">")>=0 || sel_text.indexOf("<")>=0) 	
{alert("The selection contains ¶,>, <! \r\n This is unacceptable! \r\n Correct and repeat!")
return
}
else
{	
obj.value=obj.value.substr( 0, start)+"/#"+obj.value.substr(start,end-start)+"#/"+obj.value.substr(end)		
}}}
if (window.getSelection)                    // 
{window.getSelection().removeAllRanges()
} 
else 
{document.selection.empty()               // 
}} 
 
//*******************************************************************************
 function to_change_del(p)   // 
 //******************************************************************************
 {
www10=document.getElementById(p).value 
www10=www10.replace(/\/#/g,"")
www10=www10.replace(/#\//g,"")	 
document.getElementById(p).value=www10 
if (window.getSelection)                    //
{window.getSelection().removeAllRanges()
} 
else 
{document.selection.empty()               //
}}

//*******************************************************************************
 function by_point(p)   //
 //******************************************************************************
 {
www10=document.getElementById(p).value 
www10=www10.replace(/\./g,".\r\n")
document.getElementById(p).value=www10 
 }



 </script>  
<script src="../code_check.js"></script>    
 </html>
