function gete(id) {
	return document.getElementById(id);
}

// a root elemen beluli baseclass classu elemek magassagat allitja az elemek legnagyobbikara
function normalize_height(root, baseclass, offset) {
	var r = document.getElementById(root);
	if(r){ //ie miatt
		if (typeof offset == 'undefined') offset = 0;
		var max_h = 0;
		for (var i = 0; i < r.childNodes.length; i++) {
			var obj = r.childNodes[i];
			if (!obj.getAttributeNode) continue;
			var myclass = obj.getAttributeNode("class");
			if (myclass) {
				var splitted = myclass.nodeValue.split(" ");
				for (var j = 0; j < splitted.length; j++) {
					if (splitted[j] == baseclass) if (max_h < obj.offsetHeight) max_h = obj.offsetHeight;
				}
			}
		}

		for (var i = 0; i < r.childNodes.length; i++) {
			var obj = r.childNodes[i];
			if (!obj.getAttributeNode) continue;
			var myclass = obj.getAttributeNode("class");
			if (myclass) {
				var splitted = myclass.nodeValue.split(" ");
				for (var j = 0; j < splitted.length; j++) {
					if (splitted[j] == baseclass) obj.style.height = max_h-offset+'px';
				}
			}
		}
	}
}

// RADIO BUTTONOK MEGJELÖLT ÉRTÉKÉNEK VISSZAADÁSA
function getradiovalue(radioObj)
	{
	if (!radioObj)
		return "" ;
	var radioLength = radioObj.length ;
	if (radioLength == undefined)
		if (radioObj.checked)
			return radioObj.value ;
		else
			return "" ;
	for (var i = 0; i < radioLength; i++)
        	{
		if (radioObj[i].checked)
			{
			return radioObj[i].value ;
			}
		}
	return "" ;
	}

function showelement(element, winfocus)
    {
	if (!document.getElementById(element)) { /*alert('show: bad element: '+element);*/ return; }
    document.getElementById(element).style.display = "block" ;
    if (typeof winfocus == 'undefined') window.focus() ;
    }

function hideelement(element, winfocus)
    {
	if (!document.getElementById(element)) { /*alert('hide: bad element: '+element);*/ return; }
    document.getElementById(element).style.display = "none" ;
    if (typeof winfocus == 'undefined') window.focus() ;
    }

function hideall(elements){
    var element = elements.split(',');
	for(i=0; i<element.length; i++)	{
		e = element[i];
		if(document.getElementById(e)){
			document.getElementById(e).style.display = "none" ;
		}
	}
    window.focus() ;
}

function showall(elements, inline){
    var element = elements.split(',');
	for(i=0; i<element.length; i++)	{
		e = element[i];
		if(document.getElementById(e)){
			document.getElementById(e).style.display = (typeof inline == 'undefined' ? 'block' : 'inline');
		}
	}
    window.focus() ;
}

function showhideelement(element)
    {
    if (document.getElementById(element).style.display=='none')
	showelement(element) ;
    else
	hideelement(element) ;
    window.focus() ;
    }

function fps_admin_mainMenu(){
	if(document.all && document.getElementById){
		navRoot = document.getElementById('fps_mainmenu');
		for(i=0; i<navRoot.childNodes.length; i++){
			node = navRoot.childNodes[i];
			if(node.nodeName=='LI'){
				node.onmouseover = function(){
					this.className = 'over';
  				}
  				node.onmouseout=function(){
					this.className = '';
   				}
   			}
  		}
 	}
}

var _this = null;
function preventDoubleClick(obj) {
	_this = obj; setTimeout(function() {_this.disabled = true;}, 1); setTimeout(function() {_this.disabled = false;}, 500);
}

function normalizeHeight(el) {
	var maxheight = 0;
	$(el).map(function() {
		if (maxheight < $(this).height()) maxheight = $(this).height();
	});

	$(el).map(function() {
		$(this).height(maxheight);
	});
}

function defaultSearchText(el, text) {
	// leak...
	$(el).blur(function() {
		if ($(this).val().replace(/ /g, '') == '') {
			$(this).val(text);
		}
	});

	$(el).focus(function() {
		if ($(this).val() == text) {
			$(this).val('');
		}
	});

	$(el).parents('form').submit(function() {
		if ($(this).find('input[name=search]').val() == text) {
			$(this).find('input[name=search]').val('');
		}
	});
}
