// JavaScript Document

//----------------------------------------- fajlfeltöltés   ---------------------------------------------


function fajl_ellenoriz()
{     
if (parent.also.currentitem!=null){
    var sText = parent.also.currentitem.document.selection.createRange();
   if ((sText.text!="") || (sText.text==undefined)) {window.open("main.php?f=fajl&feltolt=nem","fileWindow","width=800,height=600,resizable=yes,controls=yes,menubar=no,toolbar=no,scrollbars=yes");}
    else alert ("Jelölje ki a szerkesztő felületen azt a szöveget, ahová a fájl linkjét be szeretné illeszteni!");
 }else alert ("Jelölje ki a szerkesztő felületen azt a szöveget, ahová a fájl linkjét be szeretné illeszteni!");
}

function fszinez(melyiket,mire)
{
document.getElementById('cella1_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella2_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella3_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella4_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella5_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella6_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella7_'+melyiket).style.backgroundColor=mire;
document.getElementById('cella8_'+melyiket).style.backgroundColor=mire;
}



//----------------------------------------- fajlfeltöltés VÉGE   ---------------------------------------------


//------------------------------ BELSŐ LINK belso_link.htm--------------------------
function link()
{   

 if (form1.radio[1].checked)
 {
  window.location.href = "ujlink.php?oldalid="+opener.parent.also.document.form1.oldalid.value}
  else
 {
   window.resizeTo(850,600)
   window.moveTo(100,100)
   window.location.href = "connect.htm"//oldalid="+opener.parent.also.document.form1.oldalid.value
 }
}

//----------------------------------  KILÉPÉS A FŐOLDALRA --------------------------
function exit_()
{parent.window.location.href = "index.php"
 }


//----------------------------------   MENT, KILÉP, MEGTEKINT   ------------------------------------------
function kilep()
{
parent.also.document.form1.i_realtext.value = parent.also.i_text.innerHTML;
          if (parent.also.document.form1.ment.value == "1") {
		  if (!confirm("Az oldal tartalma megváltozott. Kívánja menteni?")) {parent.also.document.form1.ment.value="0";}
		    }
		  parent.also.document.form1.submit();
		  
window.location.href = "fo_szerk.php"
}



function submitting2() {
          parent.also.document.form1.i_realtext.value = parent.also.i_text.innerHTML;
          if (parent.also.document.form1.ment.value == "1") {
		  if (!confirm("Az oldal tartalma megváltozott. Kívánja menteni?")) {parent.also.document.form1.ment.value="0";}
		    }
		  parent.also.document.form1.submit();

}



function nezet()
{      parent.also.document.form1.i_realtext.value=parent.also.i_text.innerHTML;
window.open('preview.htm','Preview','width=650,height=500,resizable=yes,controls=yes,menubar=yes,toolbar=yes,scrollbars=yes');
		}




function submitting() {
         parent.also.document.form1.i_realtext.value = parent.also.i_text.innerHTML;
		 parent.also.document.form1.ment.value = "3"; 
         parent.also.document.form1.submit();

}
//---------------------------------- MENT, KILÉP, MEGTEKINT  VÉGE ---------------------------------------

//-----------------------------------       Preview.htm       -----------------------------------------
function eddig() {
    i_realtext = opener.parent.also.document.form1.i_realtext.value;
	while (i_realtext.search('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse\"')!=-1) {
	  i_realtext=i_realtext.replace('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse\"','');
	}
	while (i_realtext.search(' BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse; ')!=-1) {
	i_realtext=i_realtext.replace('TABLE style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; ','TABLE ');
	i_realtext=i_realtext.replace(' BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse; ','');
	i_realtext=i_realtext.replace('TABLE WIDTH','TABLE style=\"WIDTH');
    }
	//i_realtext=i_realtext.replace('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse\"','');
	while (i_realtext.search('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed\"')!=-1) {
	i_realtext=i_realtext.replace('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed\"','');
      }    
	
	return i_realtext;
}


//------------------------------------- P A L E T T A -----------------------------------------------------
function MakeArray(n) 
 { 
 this.length=n 
 for(var j=1; j<=n; j++){ 
 this[j]=0 
 } 
 return this 
 } 

//----------------------------------------------------------------------



function Tcolor_(color) {
document.paletta.scolor.value=color;
fixszin.innerHTML = "<table><tr><td width='20' height='20' STYLE='border: 1px solid black;' bgcolor='" + color + "'> </td></tr></table>";

//opener.currentitem.document.execCommand("Forecolor",false,color);
//window.close();
}

//----------------------------------------------------------------------
function setColor()
{
if (document.paletta.scolor.value=="") {alert("Nincs szín kiválasztva!")} else {
opener.parent.also.currentitem.document.execCommand("Forecolor",false,document.paletta.scolor.value)
window.opener=self
window.close()}
}
//----------------------------------------------------------------------

function GetColor(myColor) {
document.paletta.gcolor.value=myColor;
szin.innerHTML = "<table><tr><td width='20' height='20' STYLE='border: 1px solid black;' bgcolor='" + myColor + "'> </td></tr></table>";
}

//----------------------------------------------------------------------
colors = new MakeArray(16);

//----------------------------------------------------------------------

function dectohex(dec) {
hexChars = "0123456789ABCDEF"
result=""
   i=dec%16
   j=(dec-i)/16
   result +=hexChars.charAt(j)
  result += hexChars.charAt(i)

return result
}

//----------------------------------------------------------------------

function MakeCol_1()
{
//1.intervallumba eső sorok

R=0 //x koord. 
szorzo=0
//ret=""
for(var i=1; i<=8; i++){ 
elpont = szorzo*32
szorzo++
R=0 //x koord. 
G=0

ret=""
for(var j=1; j<=8; j++){ 
colors[j]=dectohex(R) + dectohex(G) + "00"
 ret+='<td bgcolor="'+colors[j]+'" ><a href=javascript:Tcolor_("'+colors[j]+'"); onmouseover=GetColor("'+colors[j]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[j]+'"></a></td>'; 
  
R+=32
Y=R*(elpont/255)
G=Math.round(Y)
}//for belso

B=0
G=elpont
for(var k=9; k<=16; k++){ 
colors[k]="FF" + dectohex(G) + dectohex(B)
 
 ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[k]+'"></a></td>'; 
B+=32
Y=B*((255-elpont)/255)+elpont
G=Math.round(Y)
}//for belso

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table></center>")

}//for kulso

}


//----------------------------------------------------------------------

function MakeCol_2()
{
//2.intervallumba eső sorok


szorzo=8 

for(var i=1; i<=8; i++){ 
elpont = szorzo*32
szorzo--
R=0 //x koord. 
G=0
ret=""

for(var j=1; j<=8; j++){ 
colors[j]=dectohex(R) + dectohex(G) + "00"
 ret+='<td bgcolor="'+colors[j]+'" ><a href=javascript:Tcolor_("'+colors[j]+'"); onmouseover=GetColor("'+colors[j]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[j]+'"></a></td>'; 
G+=32
Y=G/((255)/elpont)
R=Math.round(Y)
}//for belso


B=0
R=elpont
if (elpont==256) {R=255}
for(var k=9; k<=16; k++){ 
colors[k]=dectohex(R) + "FF" + dectohex(B)
 ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[k]+'"></a></td>'; 
B+=32
if (elpont==256) {Y=255} else
{Y=(B+((255*elpont)/(255-elpont)))/(255/(255-elpont))}
R=Math.round(Y)
}//for belso*/

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table>")
}//for kulso

}



//----------------------------------------------------------------------

function MakeCol_3()
{
//3.intervallumba eső sorok


szorzo=0

for(var i=1; i<=8; i++){ 
elpont = szorzo*32
szorzo++
B=0 //x koord. 
G=0
ret=""

for(var j=1; j<=8; j++){ 
colors[j]="00" + dectohex(G) + dectohex(B)
 ret+='<td bgcolor="'+colors[j]+'" ><a href=javascript:Tcolor_("'+colors[j]+'"); onmouseover=GetColor("'+colors[j]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[j]+'"></a></td>'; 
 G+=32
Y=G/((255)/elpont)
B=Math.round(Y)
}//for belso


B=elpont
R=0
for(var k=9; k<=16; k++){ 
colors[k]=dectohex(R) + "FF" + dectohex(B)
  ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[k]+'"></a></td>'; R+=32
Y=R*((255-elpont)/255)+elpont

B=Math.round(Y)
}//for belso*/

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table></center>")

}//for kulso

}



//----------------------------------------------------------------------

function MakeCol_4()
{
//4.intervallumba eső sorok


szorzo=8

for(var i=1; i<=8; i++){ 
elpont = szorzo*32
szorzo--
B=0 //x koord. 
G=0
ret=""

for(var j=1; j<=8; j++){ 
colors[j]="00" + dectohex(G) + dectohex(B)
 ret+='<td bgcolor="'+colors[j]+'" ><a href=javascript:Tcolor_("'+colors[j]+'"); onmouseover=GetColor("'+colors[j]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[j]+'"></a></td>'; B+=32
Y=B*(elpont/255)
G=Math.round(Y)
}//for belso



G=elpont
if (elpont==256) {G=255}
R=0
for(var k=9; k<=16; k++){ 
colors[k]=dectohex(R) +  dectohex(G) + "FF"
 ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[k]+'"></a></td>'; R+=32
if (elpont==256) {Y=255} else
{Y=R*((255-elpont)/255)+elpont}

G=Math.round(Y)
}//for belso*/

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table></center>")

}//for kulso

}

//----------------------------------------------------------------------

function MakeCol_5()
{
//5.intervallumba eső sorok


szorzo=0

for(var i=1; i<=8; i++){ 
elpont = szorzo*32
szorzo++
R=0 //x koord. 
B=0
ret=""

for(var j=1; j<=8; j++){ 
colors[j]= dectohex(R) + "00" + dectohex(B)
 ret+='<td bgcolor="'+colors[j]+'" ><a href=javascript:Tcolor_("'+colors[j]+'"); onmouseover=GetColor("'+colors[j]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[j]+'"></a></td>'; B+=32
Y=B/(255/elpont)
R=Math.round(Y)
}//for belso



R=elpont
G=0
for(var k=9; k<=16; k++){ 
colors[k]=dectohex(R) +  dectohex(G) + "FF"
 ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[k]+'"></a></td>'; G+=32
Y=(G+((255*elpont)/(255-elpont)))/(255/(255-elpont))

R=Math.round(Y)
}//for belso*/

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table></center>")

}//for kulso

}



//----------------------------------------------------------------------

function MakeCol_6()
{
//6.intervallumba eső sorok


szorzo=8

for(var i=1; i<=8; i++){ 
elpont = szorzo*32
szorzo--
R=0 //x koord. 
B=0
ret=""

for(var j=1; j<=8; j++){ 
colors[j]= dectohex(R) + "00" + dectohex(B)
 ret+='<td bgcolor="'+colors[j]+'" ><a href=javascript:Tcolor_("'+colors[j]+'"); onmouseover=GetColor("'+colors[j]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[j]+'"></a></td>'; R+=32
Y=R*(elpont/255)
B=Math.round(Y)
}//for belso



B=elpont
if (elpont==256) {B=255}
G=0
for(var k=9; k<=16; k++){ 
colors[k]="FF" +  dectohex(G) + dectohex(B)
 ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=4 alt="'+colors[k]+'"></a></td>'; G+=32
if (elpont==256) {Y=255} else {Y=(G+((255*elpont)/(255-elpont)))/(255/(255-elpont))}
B=Math.round(Y)
}//for belso*/

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table></center>")

}//for kulso

}

//----------------------------------------------------------------------

function MakeCol_7()
{

  document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln('<td colspan=16> </td>')
  document.writeln('</tr>')
  document.writeln("</table></center>")

R=0  
B=0
G=0
ret=""  
for(var k=1; k<=16; k++){ 
if (R==240) { R=255;G=255;B=255}
colors[k]=dectohex(R) +  dectohex(G) + dectohex(B)

 ret+='<td bgcolor="'+colors[k]+'" ><a href=javascript:Tcolor_("'+colors[k]+'"); onmouseover=GetColor("'+colors[k]+'"); ><img src="palkep1.gif" border=0 width=14 height=7 alt="'+colors[k]+'"></a></td>'
R+=16
G+=16
B+=16
} //for  

document.writeln('<table border=0 cellspacing=0 cellpadding=0>')
  document.writeln('<tr>')
  document.writeln(ret)
  document.writeln('</tr>')
  document.writeln("</table></center>")  
}


//------------------------------------- P A L E T T A  V É G E-----------------------------------------


//-----------------------------------------     KEP.HTM    --------------------------------------------
function ellenoriz()
{
if (parent.also.currentitem!=null){
    var sText = parent.also.currentitem.document.selection.createRange();
   if (sText.text=="") {window.open("main.php?f=kepbeill","pictureWindow","width=600,height=600,resizable=yes,controls=yes,menubar=no,toolbar=no,scrollbars=yes");}
    else alert ("Jelölje ki a szerkesztő felületen azt az üres területet, ahová a képet be szeretné illeszteni!");
 }else alert ("Jelölje ki a szerkesztő felületen azt az üres területet, ahová a képet be szeretné illeszteni!");
}

  
function insert(kep)  
{
 if (sText = parent.also.currentitem.document.selection.createRange())
  sText.execCommand("InsertImage",false, kep);
}


  
function meret() {
 betu_meret = document.form1.bmeret.value;
 parent.also.currentitem.document.execCommand("fontsize", false, betu_meret);
   }
   
   
   
function tipus() {
 betu_tipus = document.form1.btipus.value;
 parent.also.currentitem.document.execCommand("fontname", false, betu_tipus);
   }  


//----------------------------------------- KEP.HTM VÉGE   ---------------------------------------------


//----------------------------------------- FO_SZERK.HTM   ---------------------------------------------


function oldalszerkeszt()
{ 
  parent.also.window.location.href = "main.php?f=modify&oid="+parent.also.oid.value+"&mid="+parent.also.mid.value
   parent.felso.window.location.href = "13_felso.php"
}


function torles()
{ 
if (confirm("Az oldal törlésésvel elveszhetnek más kapcsolódó oldalak. Folytatja?"))
 parent.also.window.location.href = "main.php?f=torles&oid="+parent.also.oid.value+"&mid="+parent.also.mid.value
}


//--------------------------------------- FO_SZERK.HTM VÉGE  --------------------------------------------


//-----------------------------------------    EGYEB.HTM    ---------------------------------------------

//Külső link létrehozása.
function addlink() {
 if (parent.also.currentitem!=null){
    var sText = parent.also.currentitem.document.selection.createRange();
   if ((sText.text!="") || (sText.text==undefined)){
      parent.also.currentitem.document.execCommand("CreateLink");
    }else alert("Kérem jelölje ki a linkhez tartozó szöveget vagy képet!");
   }else alert("Kérem jelölje ki a linkhez tartozó szöveget vagy képet!");
  }
  
  
// Az oldalon található könyvjelzők kilistázását indítja.  - Könyvjelzőre hivatkozáskor.
function konyv_link()
{
 if (parent.also.currentitem!=null){
    var sText = parent.also.currentitem.document.selection.createRange();
   if ((sText.text!="") || (sText.text==undefined)){
         parent.also.document.form1.i_realtext.value=parent.also.i_text.innerHTML;
         window.open('bookmark_select.htm','Könyvjelző','width=350,height=120,resizable=no,controls=no,menubar=no,toolbar=no,scrollbars=no');}
   else alert("Kérem jelölje ki a linkhez tartozó szöveget vagy képet!");
 }else alert("Kérem jelölje ki a linkhez tartozó szöveget vagy képet!");
}



//KÖnyvjelző létrehozásának indítása - könyvjelző hivatkozási nevének bekérése.
function konyvjelzo() {
 if (parent.also.currentitem!=null){
    var sText = parent.also.currentitem.document.selection.createRange();
   if ((sText.text!="") && (sText.text!=undefined)){ 
         window.open('bookmark_name.htm','Könyvjelző','width=300,height=150,resizable=no,controls=no,menubar=no,toolbar=no,scrollbars=no');
    }else alert("Kérem jelölje ki a könyvjelzőhöz tartozó szöveget!");
 }else alert("Kérem jelölje ki a könyvjelzőhöz tartozó szöveget!");
}


//Könyvjelző létrehozása.
function konyvjelzo_be(nev) {
 parent.also.currentitem.document.execCommand("CreateBookmark","false",nev);
 alert ("A könyvjelző létrehozva!")
}





function belso_link()
{
 if (parent.also.currentitem!=null){
 var sText = parent.also.currentitem.document.selection.createRange();
if ((sText.text!="") || (sText.text==undefined))
 {window.open('belso_link.htm','','width=300,height=100,resizable=yes,controls=yes,menubar=no,toolbar=no,scrollbars=no');
 }else alert("Kérem jelölje ki a linkhez tartozó szöveget vagy képet!"); 
 }else alert("Kérem jelölje ki a linkhez tartozó szöveget vagy képet!");
} 


function paletta_open() {
 if (parent.also.currentitem!=null){
    var sText = parent.also.currentitem.document.selection.createRange();
   if ((sText.text!="") && (sText.text!=undefined)){
                         window.open("palproba_8.htm","","width=700,height=500");}
       else {alert("Kérem jelölje ki az átszínezni kívánt szövegrészt!");}
	    
  }else {alert("Kérem jelölje ki az átszínezni kívánt szövegrészt!");}
}


//----------------------------------------- EGYEB.HTM VÉGE    ------------------------------------------




//----------------------------------------- CONN_SZERK.HTM   --------------------------------------------

function connszerk()
{ 
  parent.window.location.href = "regilink.php?oldalid="+parent.opener.parent.also.document.form1.oldalid.value+"&kapcsid="+parent.also.oid.value

}

//------------------------------------ CONN_SZERK.HTM  VÉGE  --------------------------------------------


//------------------------------------   BOOKMARK_NAME.HTM   --------------------------------------------
function kuld()
{
if (document.form1.nev.value!="") { opener.parent.felso.konyvjelzo_be(document.form1.nev.value);
                                     window.close();}
 else alert ("Adja meg a könyvjelző hivatkozási nevét!");
 
}


//----------------------------------- BOOKMARK_NAME.HTM VÉGE  -------------------------------------------



//------------------------------------ BOOKMARK_LINK_KAPCS.HTM  -----------------------------------------


//Talált lista kiírása.
function listaz(hivnev,linknev)
{
if ( (linknev!='') && (linknev!='&nbsp;')  ) {
document.writeln('<tr><td bordercolor="#C6CACD" background="images/fugg_kiscsik2.jpg"> <div align="center"><font color="8D8D8F" size="2" face="Times New Roman, Times, serif"><b>'+linknev+'</b></font></td>')

document.writeln("<td bordercolor='#C6CACD' background='images/fugg_kiscsik2.jpg'> <div align='center'>-</td>");
document.writeln("<td bordercolor='#C6CACD' background='images/fugg_kiscsik2.jpg'> <div align='center'><font color='8D8D8F' size='2' face='Times New Roman, Times, serif'>"+hivnev+'</font><input name="nev" type="radio" value="'+hivnev+'" onClick="linkesit('+"'"+hivnev+"'"+')"></td></tr>');
}
}


//Link létrehozása.
function linkesit(nev)
{
 klink='main.php?f=kiir&oid='+parent.also.oid.value+'&mid='+parent.also.mid.value+'#'+nev;
 parent.opener.parent.also.currentitem.document.execCommand("CreateLink",false,klink);
 alert("A hivatkozás létrehozva!");
 parent.window.close();
}



//Link létrehozása.
function lista()
{
hivatkozas='';

hivnev='';
linknev='';
veg='';
i=0;
i_realtext=parent.also.text.value;
kezd=i_realtext.search('<A name=');

  while (kezd!=-1) {
    kezd=kezd+8; //a könyvjelző hiv. nevének kezdő pozíciója
	i=kezd+1;
	while (i_realtext.charAt(i)!='>') {i=i+1;}
	veg=i;//a könyvjelző hiv. nevének végpontja
	hivnev=i_realtext.substring(kezd,veg);
   
   	// Üres hivatkozás kereséséhez:
	hivatkozas='<A name='+hivnev+'>';
   
	kezd=i+1;
	while (i_realtext.charAt(i)!='<') {i=i+1;}
	linknev=i_realtext.substring(kezd,i);
	
	// Üres hivatkozás kereséséhez:
	hivatkozas=hivatkozas+linknev+'</A>';
	if ((linknev=='') || (linknev=='&nbsp;')) {text=opener.parent.also.document.form1.i_realtext.value;
	                                           text=text.replace(hivatkozas,'');
											   opener.parent.also.i_text.innerHTML=text;
											   hivatkozas='';}
	listaz(hivnev,linknev);
	
	i_realtext=i_realtext.replace('<A name=','');
	kezd=i_realtext.search('<A name=');	
  }

}

//-------------------------------- BOOKMARK_LINK_KAPCS.HTM VÉGE -----------------------------------------



//------------------------------------    BOOKMARK_LINK.HTM     -----------------------------------------
//Talált lista kiírása.
function listaz2(hivnev,linknev)
{
if ( (linknev!='') && (linknev!='&nbsp;')  ) {
document.writeln('<tr><td bordercolor="#C6CACD" background="images/fugg_kiscsik2.jpg"> <div align="center"><font color="8D8D8F" size="2" face="Times New Roman, Times, serif"><b>'+linknev+'</b></font></td>')

document.writeln("<td bordercolor='#C6CACD' background='images/fugg_kiscsik2.jpg'> <div align='center'>-</td>");
document.writeln("<td bordercolor='#C6CACD' background='images/fugg_kiscsik2.jpg'> <div align='center'><font color='8D8D8F' size='2' face='Times New Roman, Times, serif'>"+hivnev+'</font><input name="nev" type="radio" value="'+hivnev+'" onClick="linkesit2('+"'"+hivnev+"'"+')"></td></tr>');
  }
}


//Link létrehozása.
function linkesit2(nev)
{
 klink='main.php?f=kiir&oid='+opener.parent.also.document.form1.oldalid.value+'&mid='+opener.parent.also.document.form1.mid.value+'#'+nev;
 opener.parent.also.currentitem.document.execCommand("CreateLink",false,klink);
 alert("A hivatkozás létrehozva!");
 window.close();
}



//Hivatkozási nevek és könyvjelző szövegek megkeresése.
function lista2()
{
hivatkozas='';

hivnev='';
linknev='';
veg='';
i=0;
sor=0;
i_realtext = opener.parent.also.document.form1.i_realtext.value;
kezd=i_realtext.search('<A name=');

  while (kezd!=-1) {
   
    kezd=kezd+8; //a könyvjelző hiv. nevének kezdő pozíciója
	i=kezd+1;
	while (i_realtext.charAt(i)!='>') {i=i+1;}
	veg=i;//a könyvjelző hiv. nevének végpontja
	hivnev=i_realtext.substring(kezd,veg);
    
	// Üres hivatkozás kereséséhez:
	hivatkozas='<A name='+hivnev+'>';
	
	
	kezd=i+1;
	while (i_realtext.charAt(i)!='<') {i=i+1;}
	linknev=i_realtext.substring(kezd,i);
	
	// Üres hivatkozás kereséséhez:
	hivatkozas=hivatkozas+linknev+'</A>';
	if ((linknev=='') || (linknev=='&nbsp;')) {text=opener.parent.also.document.form1.i_realtext.value;
	                                           text=text.replace(hivatkozas,'');
											   opener.parent.also.i_text.innerHTML=text;
											   hivatkozas='';}
	
	listaz2(hivnev,linknev);
	sor =sor+1;
	
	i_realtext=i_realtext.replace('<A name=','');
	kezd=i_realtext.search('<A name=');	
  }
 if (sor==0) {document.writeln('<tr ><td  colspan=3 bordercolor="#C6CACD" background="images/fugg_kiscsik2.jpg"><div align="center"><font color="8D8D8F" size="3" face="Times New Roman, Times, serif"><b>Ezen ez oldalon nincs könyvjelző!</b></font></td></tr>')}
}

//--------------------------------     BOOKMARK_LINK.HTM VÉGE    -----------------------------------------


//------------------------------------     BOOK_SZERK.HTM     --------------------------------------------

function connszerk2()
{
   window.location.href='bookmark_link_kapcs.htm';
}
//------------------------------------   BOOK_SZERK.HTM  VÉGE --------------------------------------------

//------------------------------------     13_FELSO.HTM     ----------------------------------------------

function meret() {
 betu_meret = document.form1.bmeret.value;
 parent.also.currentitem.document.execCommand("fontsize", false, betu_meret);
   }
   
function tipus() {
 betu_tipus = document.form1.btipus.value;
 parent.also.currentitem.document.execCommand("fontname", false, betu_tipus);
   }
   
//------------------------------------ 13_FELSO.HTM VÉGE ------------------------------------------------



//------------------------------------ 13_ALSO_SZERK.HTM  ----------------------------------------------

function valt() 
{ document.form1.ment.value = "1";}

function fnBeforePaste() {
    event.returnValue = false;
}
// Cancel the returnValue in onpaste for the text input, which
// has a default behavior.
function fnPaste(v) {
    event.returnValue = false;
	thisitem = v;
   srange = thisitem.document.selection.createRange();
   srange.text = window.clipboardData.getData("text");

}
//------------------------------------ 13_ALSO_SZERK.HTM VÉGE -------------------------------------------


//------------------------------------ 13_ALSO.HTM  -------------------------------------------

function eddig2() {
    i_realtext = cucc.innerHTML
	while (i_realtext.search('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse\"')!=-1) {
	  i_realtext=i_realtext.replace('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse\"','');
	}
	while (i_realtext.search(' BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse; ')!=-1) {
	i_realtext=i_realtext.replace('TABLE style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; ','TABLE ');
	i_realtext=i_realtext.replace(' BORDER-BOTTOM: black 1px dashed; BORDER-COLLAPSE: collapse; ','');
	i_realtext=i_realtext.replace('TABLE WIDTH','TABLE style=\"WIDTH');
    }
	
	while (i_realtext.search('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed\"')!=-1) {
	i_realtext=i_realtext.replace('style=\"BORDER-RIGHT: black 1px dashed; BORDER-TOP: black 1px dashed; BORDER-LEFT: black 1px dashed; BORDER-BOTTOM: black 1px dashed\"','');
      }    
	cucc.innerHTML = i_realtext
	
}
