
	var isSimpleChar = false;

	function change_val(data,change) {
		if (data.length == 0) return false;
		else if(data == " ") {
			change.value = "";
			return false;
		}
		change.value = data;

	}

	function font_size(doInc) {
	   var body = document.getElementById("ossz_cikk");
	   var dec = document.getElementById("font_size_dec");
	   var inc = document.getElementById("font_size_inc");

	   if (doInc) {
	     if ("" == body.style.fontSize || "12px" == body.style.fontSize) {
		body.style.fontSize = "13px";
		dec.style.display="";
	     }
	     else 
		if ( 18 > parseInt(body.style.fontSize.substr(0,2))) 
		  body.style.fontSize = parseInt(body.style.fontSize.substr(0,2))+2+"px";
		else { inc.style.display="none";}
	  } else {
		if (12 <= parseInt(body.style.fontSize.substr(0,2))) {
		  body.style.fontSize = parseInt(body.style.fontSize.substr(0,2))-2+"px";
		  inc.style.display="";
		} else dec.style.display="none";

	  }
	} 
	
	var ablak = null;
	function imgPopup(list,page,c,what,pagename)
	{
	      var w;
	      var h;
	      if (null == what) { w='800'; h='800'; var what = '/img.php?l='+list+'&f='+page+'&c='+c; }
	      else { w=list ;  h=page; } 
	      if (null == pagename) var pagename = "imgPopup";

	      window.name="_fo";
	      options = 'width='+w+',height='+h+',resizable=yes,scrollbars=yes';
	      ablak = window.open(what, pagename, options);
		
	      if(ablak != null)
	      {
	         if(ablak.opener == null)
	         {
	                 ablak.opener = self;
	         };
	      };
	}
	     
	function doTooltip(e, msg) {
	 	 if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
	  		Tooltip.show(e, msg);
	}
		    
	 function hideTip() {
	    if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
	  		Tooltip.hide();
	 }

	function goUrl() {
		var url = document.getElementById('page');
		not_selected = true;
		for(i=0; i < url.length && not_selected; ++i) {
		    if (url.options[i].selected) {
			location.href= url.options[i].value;
			not_selected = false;
		    } 
		}
	}

        function textCounter(field, maxlimit) {
           if (field.value.length > maxlimit) { 
	    alert("Maximum "+maxlimit+" karaktert ďż˝rhat!");
	    field.value = field.value.substring(0, maxlimit);
	  }
       }

	function my_confirm(loc, alertmsg,msg) {
 		if(confirm(alertmsg)) {
  		alert(msg);
  		parent.location=loc;
 		} 
	}

	function findPosX(obj)
	{
		var curleft = 0;
		if(obj.offsetParent)
			while(1) 
			{
				curleft += obj.offsetLeft;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
		else if(obj.x)
			curleft += obj.x;
		return curleft;
	}
	
	function findPosY(obj)
	{
		var curtop = 0;
		if(obj.offsetParent)
			while(1)
			{
				curtop += obj.offsetTop;
				if(!obj.offsetParent)
					break;
				obj = obj.offsetParent;
			}
		else if(obj.y)
			curtop += obj.y;
		return curtop;
	}

	function changeLineColor(obj, i, dclass )
	{
		if ( i == -1 )
		{
			obj.className = dclass;
		} else 
		{
			obj.parentNode.childNodes[i].className = dclass;
		}
		
	}

	function catchkey(e) 
	{
		isSimpleChar = !validKey(e.keyCode);
		if ( ( onFocused || oniFocused ) && !isSimpleChar )
		{
			var sel = document.getElementById('get_word');
			if ( e.keyCode == 27 ) 
			{
				sel.style.display = 'none';
				i_sel = 0;
			} else if ( e.keyCode == 13 )
			{
				if ( i_sel > 0 )
				{
					var __x = sel.childNodes[i_sel].innerHTML.replace(/<strong>/,"");
					document.getElementById('t_word').value = __x.replace(/<\/strong>/,"");
				}
				sel.style.display = 'none';
				i_sel = 0;
			} else 
			{
				if ( typeof sel != "undefined" && sel.childNodes.length > 0 )
				{
					var is_false = false;
					if ( i_sel >= sel.childNodes.length ) i_sel = 0;

					for( var i=0;!is_false &&  i < sel.childNodes.length; ++i )
					{
						if ( i_sel == i )
						{
							if ( i_sel > 0 && e.keyCode == 38 )
							{
								sel.childNodes[i_sel].className = "t_unsel";
								sel.childNodes[--i_sel].className = "t_sel";
							} else if ( i_sel != sel.childNodes.length - 1 && e.keyCode == 40 )  
							{
								sel.childNodes[i_sel].className = "t_unsel";
								sel.childNodes[++i_sel].className = "t_sel";
							}

							is_false = true;
						}
					}
				}
			}
		}
		e.stopPropagation();
	}
	
	function validKey(kc)
	{
		return kc == 38 || kc == 40 || kc == 13 || kc == 27;
	}

// 	function recheck(obj)
// 	{
// 		if ( isSimpleChar )
// 		{
// 			document.getElementById('get_word').style.display='inline'; 
// 			if (obj.value != '')
// 				AjaxClass.loadURL('funcs/get_word.php',[['q','getval'],['value',obj.value]],'get_word'); 
// 			else 
// 				document.getElementById('get_word').innerHTML='';
// 		}
// 	}
