var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


function flashNav(frameNumber) {
showdiv();
flashID.GotoFrame(frameNumber);
flashID.Play();
}


function hidediv() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('izee').style.visibility = 'hidden';
}
else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'hidden';
}
else { // IE 4
document.all.hideShow.style.visibility = 'hidden';
}
}
}

function showdiv() {

if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('izee').style.visibility = 'visible';
}
else {
if (document.layers) { // Netscape 4
document.hideShow.visibility = 'visible';
}
else { // IE 4
document.all.hideShow.style.visibility = 'visible';
}
}
}



function temamegjelol() {
    
    document.athelyez.tema1.visible = 'hidden';
    document.athelyez.tema2.visible = 'hidden';
    document.athelyez.tema3.visible = 'hidden';
    document.athelyez.tema4.visible = 'hidden';
    document.athelyez.tema5.visible = 'hidden';
    document.athelyez.tema6.visible = 'hidden';
    document.athelyez.tema7.visible = 'hidden';
    document.athelyez.tema8.visible = 'hidden';
    document.athelyez.tema9.visible = 'hidden';
    document.athelyez.tema10.visible = 'hidden';
    document.athelyez.tema11.visible = 'hidden';
    document.athelyez.tema12.visible = 'hidden';
    document.athelyez.tema13.visible = 'hidden';
    document.athelyez.tema14.visible = 'hidden';
    document.athelyez.tema15.visible = 'hidden';
    document.athelyez.tema16.visible = 'hidden';
    
    z = document.athelyez.fotemasel.value;
    switch (z) {
        case 1:
            document.athelyez.tema1.visible = 'visible';
        case 2:
            document.athelyez.tema2.visible = 'visible';
        case 3:
            document.athelyez.tema3.visible = 'visible';
        case 4:
            document.athelyez.tema4.visible = 'visible';
        case 5:
            document.athelyez.tema5.visible = 'visible';
        case 6:
            document.athelyez.tema6.visible = 'visible';
        case 7:
            document.athelyez.tema7.visible = 'visible';
        case 8:
            document.athelyez.tema8.visible = 'visible';
        case 9:
            document.athelyez.tema9.visible = 'visible';
        case 10:
            document.athelyez.tema10.visible = 'visible';
        case 11:
            document.athelyez.tema11.visible = 'visible';
        case 12:
            document.athelyez.tema12.visible = 'visible';
        case 13:
            document.athelyez.tema13.visible = 'visible';
        case 14:
            document.athelyez.tema14.visible = 'visible';
        case 15:
            document.athelyez.tema15.visible = 'visible';
        case 16:
            document.athelyez.tema16.visible = 'visible';
    }
    
    
}



var allchecked = false;

 function select_all_checkboxes()
  {
	if (allchecked) { allchecked = false; }
		else { allchecked = true; }
	for (var i=0;i<document.forms.leveltorolform.elements.length;i++)
	{
		var e = document.forms.leveltorolform.elements[i];
			e.checked = allchecked;
	}   
  }



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function hirkep(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('hir_kep.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=300');
			console.focus();
}

function player(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('player_kep.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=300');
			console.focus();
}

function gal(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('gal_kep.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=300');
			console.focus();
}

function popm(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popm.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=300');
			console.focus();
}

function pop1() {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/pop1.php','a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=350');
			console.focus();
}

function pop2() {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/pop2.php','a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=350');
			console.focus();
}


function popz(kepcime) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/pic.php?kep=' + kepcime,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=100,height=100,left=1,top=1');
			console.focus();
}

function popsz(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/popsz.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=300');
			console.focus();
}

function kispopsz() {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/kispopsz.php', 'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=700,height=500');
			console.focus();
}

function schkep(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/schpic.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=100,height=100,left=1,top=1');
			console.focus();
}

function klubkep(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/klubpic.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=100,height=100,left=1,top=1');
			console.focus();
}


function schkepgal(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/schpicgal.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=100,height=100,left=1,top=1');
			console.focus();
}

function schvid(vidke) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/schvid.php?vid=' + vidke,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=400,height=300,left=1,top=1');
			console.focus();
}
function schkvid(vidke) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/schkvid.php?vid=' + vidke,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=400,height=300,left=1,top=1');
			console.focus();
}

function schkep1(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('schpic.php?kep=' + thekep,'_blank','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=100,height=100,left=1,top=1');
			console.focus();
}

function adatlap(victim) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/adatlap.php?victim=' + victim,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=522,height=550,left=1,top=1');
			console.focus();
}

function adatlap1(victim) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('../popup/adatlap.php?victim=' + victim,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=522,height=550,left=1,top=1');
			console.focus();
}


function pop(fajl) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/pop.php?kep=' + fajl,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,titlebar=no,width=300,height=300');
			console.focus();
}


function szschkep(thekep) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/szschpic.php?kep=' + thekep,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=100,height=100,left=1,top=1');
			console.focus();
}



function szavaz(smile, smiley) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
            
            var winl = (((screen.width) / 2) - 104);
            var wint = (((screen.height) /2 ) - 104);
            
			console=window.open('popup/smileszavaz.php?smile=' + smile + '&smiley=' + smiley,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=208,height=208,left=' + winl +',top=' + wint +' ');
			console.focus();
}

function szavazavatar(avatar, avatary) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
            
            var winl = (((screen.width) / 2) - 104);
            var wint = (((screen.height) /2 ) - 104);
            
			console=window.open('popup/avatarszavaz.php?avatar=' + avatar + '&avatary=' + avatary,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=208,height=208,left=' + winl +',top=' + wint +' ');
			console.focus();
}

function szavazprogi(progi, progey) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
            
            var winl = (((screen.width) / 2) - 104);
            var wint = (((screen.height) /2 ) - 104);
            
			console=window.open('popup/progiszavaz.php?progi=' + progi + '&progey=' + progey,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=208,height=208,left=' + winl +',top=' + wint +' ');
			console.focus();
}

function dlprg(progi) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
            
            var winl = (((screen.width) / 2) - 104);
            var wint = (((screen.height) /2 ) - 104);
            
			console=window.open('popup/dlprg.php?progi=' + progi,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=208,height=208,left=' + winl +',top=' + wint +' ');
			console.focus();
}

function szavaztrukk(trukk, trukknev) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
            
            var winl = (((screen.width) / 2) - 104);
            var wint = (((screen.height) /2 ) - 104);
            
			console=window.open('popup/trukkszavaz.php?trukk=' + trukk + '&trukknev=' + trukknev,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=208,height=208,left=' + winl +',top=' + wint +' ');
			console.focus();
}


function szabaly() {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('sites/szabaly.php','a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=780,height=500');
			console.focus();
}

function smilepop(smile, szavazat, letoltes) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('popup/smile_pop.php?kep=' + smile + '&szavazat=' + szavazat + '&letoltes=' + letoltes,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=250,height=500,left=1,top=1');
			console.focus();
}

function chatpop() {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('sites/chat.php','_blank','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,width=770,height=580');
			console.focus();
}

function tiltpopup(id) {
			if (((navigator.appName!='Microsoft Internet Explorer') && (navigator.appName!='Netscape')) || (parseInt(navigator.appVersion)<4)) {
			}
			console=window.open('../popup/tiltas.php?user_id=' + id,'a','fullscreen=no,margin=0,border=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,titlebar=no,width=400,height=600,left=1,top=1');
			console.focus();
}


function scrollwindow() {
    window.scroll(0,1000);
}

function focuside() {
    document.chatuzi.uzi.focus();
}




function confirmSubmit()
{
var agree=confirm("Biztosan törlöd?");
if (agree)
	return true ;
else
	return false ;
}




// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
var is_moz = 0;

var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac = (clientPC.indexOf("mac")!=-1);

// Helpline messages
b_help = "Félkövér: [b]szöveg[/b]  (alt+b)";
i_help = "Dőlt: [d]szöveg[/d]  (alt+i)";
u_help = "Aláhúzás: [a]szöveg[/a]  (alt+u)";
q_help = "Idézet: [quote]szöveg[/quote]  (alt+q)";
c_help = "Kód: [code]kód[/code]  (alt+c)";
l_help = "Lista: [list]szöveg[/list] (alt+l)";
o_help = "Rendezett lista: [list=]szöveg[/list]  (alt+o)";
p_help = "Kép beillesztése: [img]http://kép_url[/img]  (alt+p)";
w_help = "URL beillesztése: [url]http://url[/url]  (alt+w)";
a_help = "Nyitott bbCode tag-ek lezárása";
s_help = "Betűszín: [color=red]text[/color] \(a \"color=#FF0000 is használható\)";
f_help = "Betűméret: [size=x-small]kis szöveg[/size]";

// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('[b]','[/b]','[d]','[/d]','[a]','[/a]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
imageTag = false;

// Shows the help messages in the helpline window
function helpline(help) {
	document.post.helpbox.value = eval(help + "_help");
}

function bongeszo() {
    if (window.opera) {
        alert("Opera böngészővel nem biztos, hogy megjelennek az új üzenetek! Ez esetben térj vissza Internet explorerből, vagy Mozilla firefoxból!");
    }
}

// Replacement for arrayname.length property
function getarraysize(thearray) {
	for (i = 0; i < thearray.length; i++) {
		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
			return i;
		}
	return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
	thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
	thearraysize = getarraysize(thearray);
	retval = thearray[thearraysize - 1];
	delete thearray[thearraysize - 1];
	return retval;
}


function checkForm() {

	formErrors = false;

	if (document.post.message.value.length < 2) {
		formErrors = "Nem küldhetsz üres hozzászólást";
	}

	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
        return true;
    }
}


/*function korvalaszt() {
    
    if ((document.korvalaszto.korig.value != 0) && (document.korvalaszto.kortol.value != 0)) {
        if (document.korvalaszto.kortol.value > document.korvalaszto.korig.value) {
            document.korvalaszto.kortol.value = document.korvalaszto.korig.value;
        }
    }
    
}*/

function checkAdat() {
    
	formErrors = false;
    
    if (document.newUserForm.elfogadom.checked == false) {
        formErrors = "Nem fogadtad el a regisztrációs szabályzatot!";
    }
    
    if (document.newUserForm.code.value.length != 7) {
        formErrors = "A kódnak 7 betűsnek kell lennie!"
    }
    
    /*if (document.newUserForm.tars.value.length < 1) {
		formErrors = "Üres a társ mező!";
	}
    
   	if (document.newUserForm.leiras.value.length < 1) {
		formErrors = "Üres a leírás mező!";
	}*/
    
    var oldstring2 = document.newUserForm.magassag.value;
    var newstring2 = parseInt(oldstring2).toString();
    var InpValid=1;
    
    if (oldstring2.length == newstring2.length) {
    	if ((document.newUserForm.magassag.value < 100) || (document.newUserForm.magassag.value > 270)) {
	    	formErrors = "A magasság 100 és 270 közötti érték lehet!";
	    }
    } else {
        formErrors = "Nem megfelelő adattípus a magasság!";
        InpValid=0;
    }
    
    var oldstring1 = document.newUserForm.suly.value;
    var newstring1 = parseInt(oldstring1).toString();
    var InpValid=1;
    
    if (oldstring1.length == newstring1.length) {
    if ((document.newUserForm.suly.value < 20) || (document.newUserForm.suly.value > 300)) {
        formErrors = "A súly 20 és 300 közötti érték lehet!";
    }
    } else {
        formErrors = "Nem megfelelő adattípus a súly!";
        InpValid=0;
    }
    
    
    if (document.newUserForm.varos.value.length < 1) {
		formErrors = "Meg kell adni Várost!";
	}
    
    
    if (document.newUserForm.msncim1.value != document.newUserForm.msncim2.value) {
        formErrors = "Az MSN címek nem egyeznek!";
    }
    
    if (document.newUserForm.email1.value != document.newUserForm.email2.value) {
        formErrors = "Az email címek nem egyeznek!";
    }
    
    if (document.newUserForm.msncim1.value != 0) {
        msncheck(document.newUserForm.msncim1);
    }
    
    emailcheck(document.newUserForm.email1);
    
    var oldstring3 = document.newUserForm.szulev.value;
    var newstring3 = parseInt(oldstring3).toString(); 
    var InpValid=1;
    
    if (oldstring3.length == newstring3.length) {
        if ((document.newUserForm.szulev.value < 1900) || (document.newUserForm.szulev.value > 2005)) {
            formErrors = "A születési év nem megfelelő";
        }
    } else { 
        formErrors = "Nem megfelelő adattípus a születéi év!";
        InpValid=0;
    }
    
	if (document.newUserForm.password1.value != document.newUserForm.password2.value) {
		formErrors = "A jelszavak nem egyeznek!";
	}
    
	if (document.newUserForm.password1.value.length < 1) {
		formErrors = "Jelszó nincs kitöltve!";
	}
    
    if (document.newUserForm.username.value.length < 1) {
		formErrors = "Meg kell adni felhasználónevet!";
	}
    
    
	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
        return true;
    }

}

function checkModAdat() {
    
	formErrors = false;
    
    /*if (document.post.tars.value.length < 1) {
		formErrors = "Üres a társ mező!";
	}
    
   	if (document.post.leiras.value.length < 1) {
		formErrors = "Üres a leírás mező!";
	}*/
    
    var oldstring2 = document.post.magassag.value;
    var newstring2 = parseInt(oldstring2).toString();
    var InpValid=1;
    
    if (oldstring2.length == newstring2.length) {
    	if ((document.post.magassag.value < 100) || (document.post.magassag.value > 270)) {
	    	formErrors = "A magasság 100 és 270 közötti érték lehet!";
	    }
    } else {
        formErrors = "Nem megfelelő adattípus a magasság!";
        InpValid=0;
    }
    
    var oldstring1 = document.post.suly.value;
    var newstring1 = parseInt(oldstring1).toString();
    var InpValid=1;
    
    
    if (oldstring1.length == newstring1.length) {
    if ((document.post.suly.value < 20) || (document.post.suly.value > 300)) {
        formErrors = "A súly 20 és 300 közötti érték lehet!";
    }
    } else {
        formErrors = "Nem megfelelő adattípus a súly!";
        InpValid=0;
    }
    
    if (document.post.varos.value.length < 1) {
		formErrors = "Meg kell adni Várost!";
	}
    
    if (document.post.msncim1.value != document.post.msncim2.value) {
        formErrors = "Az MSN címek nem egyeznek!";
    }
    
    if (document.post.email1.value != document.post.email2.value) {
        formErrors = "Az email címek nem egyeznek!";
    }
    
    if (document.post.msncim1.value != 0) {
        msncheck(document.post.msncim1);
    }
    
    emailcheck(document.post.email1);
    
    var oldstring3 = document.post.szulev.value;
    var newstring3 = parseInt(oldstring3).toString(); 
    var InpValid=1;
    
    if (oldstring3.length == newstring3.length) {
        if ((document.post.szulev.value < 1900) || (document.post.szulev.value > 2005)) {
            formErrors = "A születési év nem megfelelő";
        }
    } else { 
        formErrors = "Nem megfelelő adattípus a születéi év!";
        InpValid=0;
    }
    
    
	if (formErrors) {
		alert(formErrors);
		return false;
	} else {
        return true;
    }

}


function email_check(email) // Minden kategória - e-mail elenőrzés - írt
{
    var minta=/^[_\.0-9a-zA-ZćřĺĆŘĹ-]+@([0-9a-zA-ZćřĺĆŘĹ][0-9a-zA-ZćřĺĆŘĹ-]+\.)+[a-zA-Z]{2,6}$/
    
    var minta_tomb = email.value.match(minta)
    if (minta_tomb==null)
    {
        alert('Az e-mail cím formátuma nem megfelelő!');
	    email.focus();
        return false;
    }
}

function emailcheck(email) // Minden kategória - e-mail elenőrzés - írt
{
    var minta=/^[_\.0-9a-zA-ZćřĺĆŘĹ-]+@([0-9a-zA-ZćřĺĆŘĹ][0-9a-zA-ZćřĺĆŘĹ-]+\.)+[a-zA-Z]{2,6}$/
    
    var minta_tomb = email.value.match(minta)
    if (minta_tomb==null)
    {
        formErrors = "Az e-mail cím formátuma nem megfelelő!";
	    //email.focus();
        return false;
    }
}
function msncheck(email) // Minden kategória - e-mail elenőrzés - írt
{
    var minta=/^[_\.0-9a-zA-ZćřĺĆŘĹ-]+@([0-9a-zA-ZćřĺĆŘĹ][0-9a-zA-ZćřĺĆŘĹ-]+\.)+[a-zA-Z]{2,6}$/
    
    var minta_tomb = email.value.match(minta)
    if (minta_tomb==null)
    {
        formErrors = "Az msn cím formátuma nem megfelelő!";
	    //email.focus();
        return false;
    }
}


function emoticon(text) {
	var txtarea = document.post.message;
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}

function bbfontstyle(bbopen, bbclose) {
	var txtarea = document.post.message;

	if ((clientVer >= 4) && is_ie && is_win) {
		theSelection = document.selection.createRange().text;
		if (!theSelection) {
			txtarea.value += bbopen + bbclose;
			txtarea.focus();
			return;
		}
		document.selection.createRange().text = bbopen + theSelection + bbclose;
		txtarea.focus();
		return;
	}
	else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
	{
		mozWrap(txtarea, bbopen, bbclose);
		return;
	}
	else
	{
		txtarea.value += bbopen + bbclose;
		txtarea.focus();
	}
	storeCaret(txtarea);
}


function bbstyle(bbnumber) {
	var txtarea = document.post.message;

	donotinsert = false;
	theSelection = false;
	bblast = 0;

	if (bbnumber == -1) { // Close all open tags & default button names
		while (bbcode[0]) {
			butnumber = arraypop(bbcode) - 1;
			txtarea.value += bbtags[butnumber + 1];
			buttext = eval('document.post.addbbcode' + butnumber + '.value');
			eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
		}
		imageTag = false; // All tags are closed including image tags :D
		txtarea.focus();
		return;
	}

	if ((clientVer >= 4) && is_ie && is_win)
	{
		theSelection = document.selection.createRange().text; // Get text selection
		if (theSelection) {
			// Add tags around selection
			document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
			txtarea.focus();
			theSelection = '';
			return;
		}
	}
	else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))
	{
		mozWrap(txtarea, bbtags[bbnumber], bbtags[bbnumber+1]);
		return;
	}

	// Find last occurance of an open tag the same as the one just clicked
	for (i = 0; i < bbcode.length; i++) {
		if (bbcode[i] == bbnumber+1) {
			bblast = i;
			donotinsert = true;
		}
	}

	if (donotinsert) {		// Close all open tags up to the one just clicked & default button names
		while (bbcode[bblast]) {
				butnumber = arraypop(bbcode) - 1;
				txtarea.value += bbtags[butnumber + 1];
				buttext = eval('document.post.addbbcode' + butnumber + '.value');
				eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
				imageTag = false;
			}
			txtarea.focus();
			return;
	} else { // Open tags

		if (imageTag && (bbnumber != 14)) {		// Close image tag before adding another
			txtarea.value += bbtags[15];
			lastValue = arraypop(bbcode) - 1;	// Remove the close image tag from the list
			document.post.addbbcode14.value = "Img";	// Return button back to normal state
			imageTag = false;
		}

		// Open tag
		txtarea.value += bbtags[bbnumber];
		if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
		arraypush(bbcode,bbnumber+1);
		eval('document.post.addbbcode'+bbnumber+'.value += "*"');
		txtarea.focus();
		return;
	}
	storeCaret(txtarea);
}

// From http://www.massless.org/mozedit/
function mozWrap(txtarea, open, close)
{
	var selLength = txtarea.textLength;
	var selStart = txtarea.selectionStart;
	var selEnd = txtarea.selectionEnd;
	if (selEnd == 1 || selEnd == 2)
		selEnd = selLength;

	var s1 = (txtarea.value).substring(0,selStart);
	var s2 = (txtarea.value).substring(selStart, selEnd)
	var s3 = (txtarea.value).substring(selEnd, selLength);
	txtarea.value = s1 + open + s2 + close + s3;
	return;
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
function storeCaret(textEl) {
	if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

function changeMenu()
{
    if (document.newUserForm.orszag.selectedIndex == 0) {
        //document.newUserForm.megye.disabled = false;
        if (document.newUserForm.megye.selectedIndex == 0) {
            document.newUserForm.varos.value = "Budapest";
            //document.newUserForm.varos.disabled = true;
        }
    } else {
        //document.newUserForm.varos.disabled = false;
        if (document.newUserForm.varos.value == "Budapest") {
            document.newUserForm.varos.value = "";
        }
        //document.newUserForm.megye.disabled = true;
    }
}

/*function changeMenu2()
{
    if (document.newUserForm.orszag.selectedIndex == 2) {
        document.newUserForm.megye.disabled = false;
    } else {
        document.newUserForm.megye.disabled = true;
    }
}*/

function changeMenu3()
{
    if (document.post.orszag.selectedIndex == 0) {
        //document.post.megye.disabled = false;
        if (document.post.megye.selectedIndex == 1) {
            document.post.varos.value = "Budapest";
            //document.post.varos.disabled = true;
        }
    } else {
        //document.post.varos.disabled = false;
        if (document.post.varos.value == "Budapest") {
            document.post.varos.value = "";
        }
        //document.post.megye.disabled = true;
    }
}

function changeMenu4()
{
    if (document.post.orszag.selectedIndex == 2) {
        //document.post.megye.disabled = false;
        if (document.post.megye.selectedIndex == 2) {
            document.post.varos.value = "Budapest";
            //document.post.varos.disabled = true;
        }
    } else {
        //document.post.varos.disabled = false;
        if (document.post.varos.value == "Budapest") {
            document.post.varos.value = "";
        }
        //document.post.megye.disabled = true;
    }
}

function changeMenu5()
{
    
    if (document.post.megye.selectedIndex == 2) {
        document.post.varos.value = "Budapest";
        //document.post.varos.disabled = true;
    } else {
        //document.post.varos.disabled = false;
        if (document.post.varos.value == "Budapest") {
            document.post.varos.value = "";
        }
    }
    
}

function changeMenu6()
{
    
    if (document.newUserForm.megye.selectedIndex == 0) {
        document.newUserForm.varos.value = "Budapest";
        //document.newUserForm.varos.disabled = true;
    } else {
        //document.newUserForm.varos.disabled = false;
        if (document.newUserForm.varos.value == "Budapest") {
            document.newUserForm.varos.value = "";
        }
    }
    
}

function changeMenu7()
{
    
    if (document.post.megye.selectedIndex == 1) {
        document.post.varos.value = "Budapest";
        //document.post.varos.disabled = true;
    } else {
        //document.post.varos.disabled = false;
        if (document.post.varos.value == "Budapest") {
            document.post.varos.value = "";
        }
    }
    
}

function urltag()
{

    var FoundErrors = '';
    var error_no_url        = "Hivatkozás (cím) megadása szükséges!";
	//var error_no_title      = "Cím megadása szükséges";
    var text_enter_url      = "Teljes címet adj meg a hivatkozásként";
	//var text_enter_url_name = "Honlap cím megadása";
    var enterURL   = prompt(text_enter_url, "http://");
    //var enterTITLE = prompt(text_enter_url_name, "My Webpage");
    
    if (!enterURL) {
        FoundErrors += " " + error_no_url;
    }
    /*if (!enterTITLE) {
        FoundErrors += " " + error_no_title;
    }*/
    
    if (FoundErrors) {
        alert("Error!"+FoundErrors);
        return;
    }
    
    //document.post.message.value  += "[URL="+enterURL+"]"+enterTITLE+"[/URL]";
    document.post.message.value  += " [URL]"+enterURL+"[/URL] ";
    document.post.message.focus();
    
}

function imgtag()
{

    var FoundErrors = '';
    var error_no_img        = "Hivatkozás (cím) megadása szükséges!";
	//var error_no_title      = "Cím megadása szükséges";
    var text_enter_img      = "Teljes címet adj meg a hivatkozásként";
	//var text_enter_url_name = "Honlap cím megadása";
    var enterIMG   = prompt(text_enter_img, "http://");
    //var enterTITLE = prompt(text_enter_url_name, "My Webpage");
    
    if (!enterIMG) {
        FoundErrors += " " + error_no_img;
    }
    /*if (!enterTITLE) {
        FoundErrors += " " + error_no_title;
    }*/
    
    if (FoundErrors) {
        alert("Error!"+FoundErrors);
        return;
    }
    
    //document.post.message.value  += "[URL="+enterURL+"]"+enterTITLE+"[/URL]";
    document.post.message.value  += " [IMG]"+enterIMG+"[/IMG] ";
    document.post.message.focus();
    
}

function textCounter() {
    if (document.myForm.message.value.length > 150) {    // if too long...trim it!
        document.myForm.message.value = document.myForm.message.value.substring(0, 150);
        // otherwise, update 'characters left' counter
    } else {
        document.myForm.remLen.value = 150 - document.myForm.message.value.length;
    }

}

function textCounter1() {
    if (document.post.leiras.value.length > 600) {    // if too long...trim it!
        document.post.leiras.value = document.post.leiras.value.substring(0, 600);
        // otherwise, update 'characters left' counter
    } else {
        document.post.len_text1.value = 600 - document.post.leiras.value.length;
    }

}

function textCounter2() {
    if (document.post.tars.value.length > 600) {    // if too long...trim it!
        document.post.tars.value = document.post.tars.value.substring(0, 600);
        // otherwise, update 'characters left' counter
    } else {
        document.post.len_text2.value = 600 - document.post.tars.value.length;
    }

}

function textCounter3() {
    if (document.newUserForm.leiras.value.length > 600) {    // if too long...trim it!
        document.newUserForm.leiras.value = document.newUserForm.leiras.value.substring(0, 600);
        // otherwise, update 'characters left' counter
    } else {
        document.newUserForm.len_text1.value = 600 - document.newUserForm.leiras.value.length;
    }

}

function textCounter4() {
    if (document.newUserForm.tars.value.length > 600) {    // if too long...trim it!
        document.newUserForm.tars.value = document.newUserForm.tars.value.substring(0, 600);
        // otherwise, update 'characters left' counter
    } else {
        document.newUserForm.len_text2.value = 600 - document.newUserForm.tars.value.length;
    }

}

function textCounter5() {
    if (document.ujklub.bemutatas.value.length > 1000) {    // if too long...trim it!
        document.ujklub.bemutatas.value = document.ujklub.bemutatas.value.substring(0, 1000);
        // otherwise, update 'characters left' counter
    } else {
        document.ujklub.len_text1.value = 1000 - document.ujklub.bemutatas.value.length;
    }

}


/*function textCounter1() {
    
    //document.newUserForm.len_text1.value = "Még legalább "+(50 - document.newUserForm.leiras.value.length)+" betűt kell írni";
    if (50 - document.post.leiras.value.length < 0) {
        document.post.len_text1.value = 0;
    } else {
        document.post.len_text1.value = document.post.leiras.value.length;
    }
    
}

function textCounter2() {
    
    //document.newUserForm.len_text2.value = "Még legalább "+(50 - document.newUserForm.tars.value.length)+" betűt kell írni";
    if (50 - document.post.tars.value.length < 0) {
        document.post.len_text2.value = 0;
    } else {
        document.post.len_text2.value = 50 - document.post.tars.value.length;
    }
    
}

function textCounter1() {
    
    //document.newUserForm.len_text1.value = "Még legalább "+(50 - document.newUserForm.leiras.value.length)+" betűt kell írni";
    if (50 - document.newUserForm.leiras.value.length < 0) {
        document.newUserForm.getElementById(23).value = 0
    } else {
        document.newUserForm.getElementById(23).value = 50 - document.newUserForm.leiras.value.length;
    }
    
}

function textCounter2() {
    
    //document.newUserForm.len_text2.value = "Még legalább "+(50 - document.newUserForm.tars.value.length)+" betűt kell írni";
    if (50 - document.newUserForm.tars.value.length < 0) {
        document.newUserForm.getElementById(25).value = 0
    } else {
        document.newUserForm.getElementById(25).value = 50 - document.newUserForm.tars.value.length;
    }
    
}*/

function addbookmark()
{
bookmarkurl="http://msnclub.hu/"
bookmarktitle="MSN Club"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function fav2(){
window.external.AddFavorite('http://msnclub.hu','MSN Club');
}
function home(){
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.msnclub.hu');
}



function CreateBookmarkLink() {

 title = "MSN Club"; 
  // Blogger - Replace with <$BlogItemTitle$> 
  // MovableType - Replace with <$MTEntryTitle$>

 url = "http://msnclub.hu";
  // Blogger - Replace with <$BlogItemPermalinkURL$> 
  // MovableType - Replace with <$MTEntryPermalink$>
  // WordPress - <?php bloginfo('url'); ?>

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; }
 }

// adatmodositas kepek

//személyes adatok

function kepof1 () {
document.szem.src=('grfv4/box/szem1.gif')

}

function kepon1 () {
document.szem.src=('grfv4/box/szem2.gif')

}

//kommunikacios

function kepof2 () {
document.kom.src=('grfv4/box/kom1.gif')

}

function kepon2 () {
document.kom.src=('grfv4/box/kom2.gif')

}

//reg


function kepof3 () {
document.regi.src=('grfv4/box/reg1.gif')

}

function kepon3 () {
document.regi.src=('grfv4/box/reg2.gif')

}

// program

function kepof4 () {
document.program.src=('grfv4/box/prog.gif')

}

function kepon4 () {
document.program.src=('grfv4/box/prog1.gif')

}

// kieg 


function kepof5 () {
document.kieg.src=('grfv4/box/kieg.gif')

}

function kepon5 () {
document.kieg.src=('grfv4/box/kieg1.gif')

}

// seged


function kepof6 () {
document.seged.src=('grfv4/box/seged.gif')

}

function kepon6 () {
document.seged.src=('grfv4/box/seged1.gif')

}

// skin 


function kepof7 () {
document.skin.src=('grfv4/box/skin.gif')

}

function kepon7 () {
document.skin.src=('grfv4/box/skin1.gif')

}

// script


function kepof8 () {
document.script.src=('grfv4/box/script.gif')

}

function kepon8 () {
document.script.src=('grfv4/box/script1.gif')

}
