/*

JAVASCRIPT LIBRARY

*/

var _js_home_dir = 'toolbox/';

document.write('<script src="'+_js_home_dir+'AnchorPosition.js"></script>');
document.write('<script src="'+_js_home_dir+'CalendarPopup.js"></script>');
document.write('<script src="'+_js_home_dir+'PopupWindow.js"></script>');
document.write('<script src="'+_js_home_dir+'date.js"></script>');
document.write('<script src="'+_js_home_dir+'validation.js"></script>');

// htmlarea inicializalasa
_editor_url = _js_home_dir;                     // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
 document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
 document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }


// OPEN_IN_WINDOW: megnyit egy ablakot megadott tartalommal
function open_in_windows(url) {
  window.open(url,'_blank','scrollbars=1, statusbar=0, location=0, width=400, height=300');
  }

// DIALOG_OPEN: megnyit egy dialogusablakot
function dialog_open(urlp,width,height,arguments) {
  var features = 'dialogWidth:'+width+' px; dialogHeight:'+height+' px; ';
  var features = features + 'center:yes; fullscreen: no; help: no; resizeable: no; status: no;';
  return window.showModalDialog(urlp,arguments,features);
  }

// BUTTONCLICK: oldal betöltése
function ButtonClick(url) {
  window.location = url;
  }

// CONFIRMDELETE: a rekord törlését megerősítő kérdést követően megnyitja a megadott oldalt
function ConfirmDelete(url,text) {
  if (text==undefined) errMsg='Valóban törölni szeretné a kiválasztott elemet?'; else errMsg=text;
  if (window.confirm(errMsg)) window.location=url;
  }
		
// DATEPICKER: 
function DatePicker(mezonev,defvalue) {
	id = 'id_' + Math.random() * Math.pow(10, 17);
	html = '';
	html = html + '<table cellspacing="0" cellpadding="0"><tr><td>';
	html = html + '<input name="'+mezonev+'" id="'+id+'" value="'+defvalue+'" size="14">';
	html = html + '</td><td>';
	html = html + '<a href="javascript:displayDatePicker(\''+id+'\')">';
	html = html + '<img src="'+_js_home_dir+'calendar_icon.gif" BORDER="0" ALT="Dátumválasztó"></a>';
	html = html + '</td></tr></table>';
	document.write(html);
	}
	
// PRINTTEXTAREA()
function PrintTextArea(field_id,pre) {
  var s = document.getElementById(field_id).value;
  var regExp=/\n/gi;
  s = s.replace(regExp,'<br>');
  pWin = window.open('','pWin','location=yes, menubar=yes, toolbar=yes');
  pWin.document.open();
  pWin.document.write('<html><head></head><body>');
  if (pre) pWin.document.write('<pre>');
  pWin.document.write(s);
  if (pre) pWin.document.write('</pre>');  
  pWin.document.write('</body></html>');
  pWin.print();
  pWin.document.close();
  pWin.close();
  } 
  

