function addWindowOnLoad(functionName)
{
	if (typeof(__windowOnLoad)=='undefined')
	{
		__windowOnLoad=new Array();
		if (typeof(window.onload)!='undefined' && window.onload!=null)
		{
			__windowOnLoad[0]=window.onload;
		} 
		window.onload=function()
		{
			var i;
			for (i=0;i<__windowOnLoad.length;i++)
			{
				if (typeof(__windowOnLoad[i])=='function')
				{
					__windowOnLoad[i]();
				}
				else
				{
					eval(__windowOnLoad[i]);
				}
			}
		}
	}
	__windowOnLoad[__windowOnLoad.length]=functionName;
}


function addFlash(contentId,content)
{
	var index;

	if (typeof(__objectContent)=='undefined')
	{
		__objectContent=new Array();
	}
	index=__objectContent.length;
	__objectContent[index]=new Array();
	__objectContent[index]['id']=contentId;
	__objectContent[index]['content']='type="application/x-shockwave-flash" '+content;
}

function addObject(contentId,content)
{
	var index;

	if (typeof(__objectContent)=='undefined')
	{
		__objectContent=new Array();
	}
	index=__objectContent.length;
	__objectContent[index]=new Array();
	__objectContent[index]['id']=contentId;
	__objectContent[index]['content']=content;
}

function putObject()
{
	var i;

	if (typeof(__objectContent)=='undefined' || __objectContent.length<1)
	{
		return;
	}
	for (i=0;i<__objectContent.length;i++)
	{
		document.getElementById(__objectContent[i]['id']).innerHTML='<object " '+__objectContent[i]['content']+'</object>';
	}
}

addWindowOnLoad('putObject();');


helpWindow = null;
function openHelpWindow(source)
{
	if (helpWindow != null)
	{
		helpWindow.close();
		helpWindow = null;
	}
	helpWindow = window.open(source, 'helpWindowHungarian', 'resizeable=0, scrollbars=1, width=780, height=500');
}

function getObjXY(Obj)
{
	var Cord,leftpos,toppos,aTag,IE;

	IE=(typeof(Obj.currentStyle)!='undefined');
	Cord = new Array();
	leftpos = Obj.offsetLeft;
	toppos = Obj.offsetTop;
	
	if ((IE?Obj.currentStyle['position']:Obj.style.position)!='absolute')
	{
		aTag = Obj;
		do
		{
			aTag = aTag.offsetParent;
			leftpos += aTag.offsetLeft;
			toppos += aTag.offsetTop;
			if (aTag.style.position=='absolute')
			{
				leftpos -= aTag.offsetLeft;
				toppos -= aTag.offsetTop;
				break;
			}
		} while(aTag.tagName!="BODY" && aTag.tagName!="HTML" && (IE?aTag.currentStyle['position']:aTag.style.position) == 'static');
	}
	Cord[0]=leftpos;
	Cord[1]=toppos;
	return Cord;
}


HM_DOM = document.getElementById ? true : false;
HM_IE  = document.all ? true : false;
HM_NS4 = document.layers ? true : false;

function HM_f_ToggleElementList(show,elList,toggleBy)
{
	if(!(HM_DOM||HM_IE||HM_NS4))
	{
		return true;
	}

	if(HM_NS4&&(toggleBy=="tag"))
	{
		return true;
	}

	for(var i=0; i<elList.length; i++)
	{
		var ElementsToToggle = [];
		switch(toggleBy)
		{
			case "tag":
				ElementsToToggle = (HM_DOM) ? document.getElementsByTagName(elList[i]) : document.all.tags(elList[i]);
				break;
			case "id":
				ElementsToToggle[0] = (HM_DOM) ? document.getElementById(elList[i]) : (HM_IE) ? document.all(elList[i]) : document.layers[elList[i]];
			break;
		}
		for(var j=0; j<ElementsToToggle.length; j++)
		{
			var theElement = ElementsToToggle[j];
			if(!theElement)
			{
				continue;
			}
			if(HM_DOM||HM_IE)
			{
				theElement.style.visibility = show ? "inherit" : "hidden";
			}
			else if (HM_NS4)
			{
				theElement.visibility = show ? "inherit" : "hide";
			}
		}
	}
	return true;
}

var theArray = new Object;
theArray[0] = 'select';
theArray[1] = 'form';
theArray.length = 2;


function getElementsByClassName(oElm, strTagName, oClassNames)
{
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	if(typeof oClassNames == "object")
	{
		for(var i=0; i<oClassNames.length; i++)
		{
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
		}
	}
	else
	{
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
	}
	var oElement;
	var bMatchesAll;
	for(var j=0; j<arrElements.length; j++)
	{
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k<arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className))
			{
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll)
		{
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}


function resetFileInput(formObj)
{
	origValue= new Array();
	for (index=0;index<formObj.elements.length;index++)
	{
		origValue[index]=new Array();
		origValue[index][0]=formObj.elements[index].type;
		origValue[index][1]=formObj.elements[index].value;
		if (origValue[index][0]!='file' && origValue[index][0]!='submit' && origValue[index][0]!='reset')
		{
			origValue[index][2]=formObj.elements[index].disabled;
		}
		if (origValue[index][0]=='radio')
		{
			origValue[index][3]=formObj.elements[index].checked;
		}
	}
	formObj.reset();
	for (index=0;index<formObj.elements.length;index++)
	{
		if (origValue[index][0]!='file' && origValue[index][0]!='submit' && origValue[index][0]!='reset')
		{
			formObj.elements[index].value=origValue[index][1];
			formObj.elements[index].disabled=origValue[index][2];
			if (origValue[index][0]=='radio')
			{
				formObj.elements[index].checked=origValue[index][3];
			}
		}
	}
}

String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };
String.prototype.ltrim = function() { return this.replace(/\s*((\S+\s*)*)/, "$1"); };
String.prototype.rtrim = function() { return this.replace(/((\s*\S+)*)\s*/, "$1"); };

var userAgent=navigator.userAgent.toLowerCase();
var tableRowDisplayType=((userAgent.indexOf('msie')+1)?'block':'table-row');
var tableDisplayType=((userAgent.indexOf('msie')+1)?'block':'table');

