function levag(hossz) {
  var tex=document.elso.t_text.value;
  document.elso.t_text.value = tex.substring(0,hossz);
  document.elso.szamlalo.value=0;
  return true;
}

function szamol() {
    document.elso.szamlalo.value = 500 - document.elso.t_text.value.length;
        if (document.elso.szamlalo.value<0) {levag(500);};
    return true;
}
function szamol2() {
    document.elso.szamlalo.value = 250 - document.elso.t_text.value.length;
        if (document.elso.szamlalo.value<0) {levag(250);};
    return true;
}

function del_conf(tex) {
   if (confirm(tex))
     {
       return true;
     } else {return false;}

}
function proba() {
    document.arufeltolt.akod.value ='500';

    return true;
}
 function open_help_window(oldal,x1,y1)
	{
	  var hauteur_popup=x1;
	  var H = (screen.height - hauteur_popup) / 2;
	  var largeur_popup=y1;
	  var L = (screen.width - largeur_popup) / 2;
	  window.open(oldal,"Popup","status=no,scrollbars=yes,resizable=yes,height="+hauteur_popup+",width="+largeur_popup+",top="+H+",left="+L);

	};

function get_str(str,formid)
{
  megn=prompt(str,'');
  if (!megn) 
	{
	  return false;
	} else 
	{
		formid.str_get.value=megn;
		return true;
	}
};


function AddImg(inp){
	document.body.all.szinek.aktiv_elem.value=inp;
	y = event.y+document.body.scrollTop;
	x = event.x+document.body.scrollLeft-20;
	y+=-100;
	y+='px';
	x+='px';
	document.all.addimg.style.left = x;
	document.all.addimg.style.top = y;
	document.all.addimg.style.visibility = 'visible';
};

function chang_cellszin(inp){
   inp.style.backgroundColor=inp.value;
};

