<!--
var ujhatterszin            = 'White';
var regihatterszin          = '-1';
var posx=0;
var posy=0;
var actPicWidth = 196;
var akep=new Array(12);
var akepIndex;
var maxkep;
var regicolor;
var akivalaszt=new Array();

var aLevalogat = new Array();

function xx(obj, szin, regiclassName, ujclassName) {
//    props(obj);
	var nextItem;
    var debug=1;
    if (debug) {
        if (szin == 0) {
            if (obj.className == regiclassName) {
                obj.className = ujclassName;
            }
        } else {
            if (obj.className == ujclassName) {
                obj.className = regiclassName;
            }
        }
    }
}
function x2(obj, szin) {
    var nextItem;
    var debug=0;
    if (debug) {
        if (szin == 0) {
                if (regihatterszin == '-1') {
                regihatterszin = obj.bgColor;
                }
                obj.bgColor = ujhatterszin;
                obj.style.cursor= "hand";
                nextItem = obj.nextSibling;
                while (nextItem != null) {
                nextItem.bgColor = ujhatterszin;
                nextItem = nextItem.nextSibling;
                }
                nextItem = obj.previousSibling;
                while (nextItem != null) {
                nextItem.bgColor = ujhatterszin;
                nextItem = nextItem.previousSibling;
                }
        //          obj.innerText = 'xx';
        } else {
                obj.bgColor = regihatterszin;
                nextItem = obj.nextSibling;
                while (nextItem != null) {
                nextItem.bgColor = regihatterszin;
                nextItem = nextItem.nextSibling;
                }
                nextItem = obj.previousSibling;
                while (nextItem != null) {
                nextItem.bgColor = regihatterszin;
                nextItem = nextItem.previousSibling;
                }
        }
    }
}

function props(obj, name) {
	for (var i in obj) {
		if (obj[i] != null) {
			document.writeln(i + '=' + obj[i]+ '<BR>\n');
		}
	}
}
function swapImage(x, uj, valt) {
    if (valt) {
        x.src='./pic/_' + uj + '.gif';
//        document.all['kiugrokep'].style.visibility = "hidden";
    } else {
        x.src='./pic/' + uj + '.gif';
    }
}

function showImage(x, uj, szoveg, xkep1, xkep2, xkep3, xkep4, xkep5) {

//,jo    regicolor = document.body.style.backgroundColor;
//.jo    document.body.style.backgroundColor = 'black';

//    document.body.style.filter = 'gray';
//    props(document.all);
    if (posx == 0) {
        posx = document.body.clientWidth/2;
        posy = document.body.clientHeight/2;
        document.all['kiugrokep'].style.left = posx;
        document.all['kiugrokep'].style.top = posy;
    }
  for (ii = 0; ii <= 500; ii ++) {
        if (typeof(document.all['ing'+ii]) != 'undefined') {
            document.all['ing'+ii].style.filter = 'gray';
        } else {
            break;
        }
    }
    akepIndex = 0;

    akep[akepIndex] = uj;
    if (xkep1 !='') {
        akep[++akepIndex] = xkep1;
    }
    if (xkep2 != '') {
        akep[++akepIndex] = xkep2;
    }
    if (xkep3 !='') {
        akep[++akepIndex] = xkep3;
    }
    if (xkep4 !='') {
        akep[++akepIndex] = xkep4;
    }
    if (xkep5 !='') {
        akep[++akepIndex] = xkep5;
    }

    maxkep = akepIndex;
    akepIndex=0;

    document.all['idekellaszoveg'].innerText = ' ' + szoveg + ' ';
    document.all['idekellakep'].innerHTML= "<img src=" + akep[akepIndex] + " width=" + actPicWidth + "'px'>";

    document.all['kiugrokep'].style.visibility = "visible";
}

function showImage2(x, kep, xx, yy) {

	x = screen.width / 2 - 200;

	var oPopup = window.createPopup();
    var oPopBody = oPopup.document.body;
    oPopBody.style.backgroundColor = "lightyellow";
    oPopBody.style.border = "solid black 1px";
    oPopBody.innerHTML = "<img src=" + kep + ">";
    oPopup.show(x, 100, xx, yy, document.body);
}

function showText(o, szoveg, cim, fosorspan) {

    y = window.event.y;
    posx = document.body.clientWidth/2-200;
    document.all['kiugrotext'].style.left = posx;
    document.all['kiugrotext'].style.top = y;

    document.all['idekellatextcim'].innerHTML = ' ' + cim;
    document.all['idekellatextszoveg'].innerHTML = szoveg;

    document.all['kiugrotext'].style.visibility = "visible";
}

function nextImage() {
    var nextkep;
    akepIndex ++;
    if (akepIndex > maxkep) {
        akepIndex = 0;
    }
    document.all['idekellakep'].innerHTML= "<img src=" + akep[akepIndex] + " width=" +actPicWidth+"px>";
}

function prevImage() {
    var nextkep;
    akepIndex --;
    if (akepIndex < 0) {
        akepIndex = maxkep;
    }
    document.all['idekellakep'].innerHTML= "<img src=" + akep[akepIndex] + " width=" +actPicWidth+"px>";
}
function firstImage() {
    akepIndex = 0;
    document.all['idekellakep'].innerHTML= "<img src=" + akep[akepIndex] + " width=" +actPicWidth+"px>";
}
function lastImage() {
    akepIndex = maxkep-1;
    document.all['idekellakep'].innerHTML= "<img src=" + akep[akepIndex] + " width=" +actPicWidth+"px>";
}


function maxLayer(n) {
//    window.status = posx;
//    props(document.atributes);
    actPicWidth += n;
    if (actPicWidth < 196) {
        actPicWidth = 196;

    } else {
        document.all['alsokozep'].width +=n;
    }
    document.all['idekellakep'].innerHTML= "<img src=" + akep[akepIndex] + " width=" +actPicWidth+"px>";
//    document.all['alsokozep'].width +=n;

//    document.all['kiugrokep'].style.left = posx;
//    document.all['kiugrokep'].style.top = posy;
    document.all['kiugrokep'].style.visibility = "visible";
}
function hideLayer() {
    document.all['kiugrokep'].style.visibility = "hidden";
//    document.body.style.backgroundColor = regicolor;
    for (ii = 0; ii <= 500; ii ++) {
        if (typeof(document.all['ing'+ii]) != 'undefined') {
            document.all['ing'+ii].style.filter = '';
        } else {
            break;
        }
    }
}
function hideTextLayer() {
    document.all['kiugrotext'].style.visibility = "hidden";
}

function AddSelectItem(selectName, optionText, optionValue) {
    optionName = new Option(optionText, optionValue);
	n = selectName.options.length;
	selectName.options[n] = optionName;
}

function levalogatFeltolt(selectItem) {
    lok = false;

    xValue = selectItem.value;
//    document.write(selectItem.value);
//    document.write(props(levalogatform.Levalogat2));
//    document.write("cok");

//    AddSelectItem(levalogatform.Levalogat2, "xx", "xx");

    for (i = 0; i < aLevalogat.length; i++) {
//          document.write(aLevalogat[i]+ ': ----'+xValue + '<BR>');
        if (aLevalogat[i].substr(0,4) == "----") {
            if (aLevalogat[i] == "----" + selectItem.value) {
                lok = true;
            } else {
                lok = false;
            }
        } else {
            if (lok) {
                AddSelectItem(levalogatform.Levalogat2, aLevalogat[i], aLevalogat[i]);
            }
        }
    }
}


function dostat(statxt) { window.status=(statxt); }

drag = 0
move = 0

function init() {
    window.document.onmousemove = mouseMove;
    window.document.onmousedown = mouseDown;
    window.document.onmouseup = mouseUp;
    window.document.ondragstart = mouseStop;

//    self.menubar.visible=false;
//    window.toolbar.visible=false;
//    window.locationbar.visible=false;
//    window.personalbar.visible=false;
//    window.scrollbars.visible=false;
//    window.statusbar.visible=false;

}

function mouseDown() {
	if (drag) {
		clickleft = window.event.x - parseInt(dragObj.style.left)
		clicktop = window.event.y - parseInt(dragObj.style.top)
		dragObj.style.zIndex += 1
		move = 1
	}
}

function mouseStop() {
	window.event.returnValue = false
}

function mouseMove() {
	if (move) {
		dragObj.style.left = window.event.x - clickleft
		dragObj.style.top = window.event.y - clicktop
	}
}

function mouseUp() {
	if (move) {
        posx = window.event.x-clickleft;
        posy = window.event.y-clicktop;
    }
    move = 0;
}

function ingatlankivalaszt(o, rovat, pozicio, tetel) {
    var str = '';
    var ossz = 0;
    if (typeof(akivalaszt[tetel]) == 'undefined' ) {
        akivalaszt[tetel] = pozicio;
    } else {
        if (akivalaszt[tetel] == ' ') {
            akivalaszt[tetel] = pozicio;
        } else {
            akivalaszt[tetel] = ' ';
        }
    }
    for (ii = 1; ii <= akivalaszt.length-1; ii++) {
        if (typeof(akivalaszt[ii]) != 'undefined') {
            if (akivalaszt[ii] != ' ') {
                str += akivalaszt[ii] + ', ' ;
//              str += ii + akivalaszt[ii];
                ossz++;
            }
        }
    }
    window.status='Összes tétel:' + ossz + ' rovat:' + rovat + ' pozició:' + pozicio + ' tetelek:' + str;

}

