		
function getRefToDiv(divID) {
	if( document.layers ) { return document.layers[divID]; }
	if( document.getElementById ) { return document.getElementById(divID); }
	if( document.all ) { return document.all[divID]; }
	if( document[divID] ) { return document[divID]; }
	return false;
}

function showDiv2(menuID) {
		ID = menuID;
		
		setTimeout("delayedShowDiv(this.ID)",500);
		//delayedShowDiv(this.ID);
}

function showDiv(divID_as_a_string) {
		hideAllDiv()
	var myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) { window.alert('Ezen a böngészőn a menü nem látható'); return; }
	if( myReference.style ) { myReference.style.visibility = 'visible'; } 
	else {
		if( myReference.visibility ) { myReference.visibility = 'show'; } 
		else {
		window.alert('Ezen a böngészőn a menü nem látható'); return; } }
}

function hideDiv(divID_as_a_string) {
	var myReference = getRefToDiv(divID_as_a_string);
	if( !myReference ) { window.alert('Ezen a böngészőn a menü nem látható'); return; }
	if( myReference.style ) { myReference.style.visibility = 'hidden'; } else {
		if( myReference.visibility ) { myReference.visibility = 'hide'; } else {
			window.alert('Ezen a böngészőn a menü nem látható'); return; } }
}


function hasznos() {
	if( myReference.style ) { myReference = myReference.style; }; //IE NS kompatibilitás
	
	myReference.bgColor = '#ff0000';
	myReference.background = '#ff0000';
	myReference.backgroundColor = '#ff0000';
}

function hideAllDiv() {
		hideDiv('subMenu2');
		hideDiv('subMenu3');
		hideDiv('subMenu4');
		hideDiv('subMenu5'); 
		hideDiv('subMenu6');
}

function getCoords(o) {
	oTop = o.offsetTop;
	while(o.offsetParent!=null) {
	  oParent = o.offsetParent;
	  oTop += oParent.offsetTop;
	  o = oParent;
	}
	
	oLeft = o.offsetLeft;
	while(o.offsetParent!=null) {
		oParent = o.offsetParent;
		oLeft += oParent.offsetLeft;
		o = oParent;
	}
	
	document.write(oLeft);
	document.write(oTop);
	if (IE) { name.style.visibility = "visible"; }
	coords.x = oLeft;
	coords.y = oTop;
	return coords;
}
