// copyright by Manaz GmbH, Helmstedt, www.manaz.de

var htmlCols = new Array("#000000","#000090","#336644","#009999","#800000","#00A0FF","#AAA0FF","#808080","#D8D8D0","#99CCFF","#66FF33","#0000FF","#FF0000","#C0E8C0","#FFFF33","#FFFFFF","FFF8F4");

var fnh ='<img class="fnbut" onMouseOver="var h=this.style;this.hbg=h.backgroundColor;h.backgroundColor=\'\';this.className=\'fnbuto\'" onMouseOut="this.style.backgroundColor=this.hbg;this.className=\'fnbut\'" ';
function fnHelp  (ID){return fnh+'src="'+imgpath+'wfn/help.gif"   onClick="'+ID+'.onHelp()"    alt="Hilfe">'};
function fnPopout(ID){return fnh+'src="'+imgpath+'wfn/popout.gif" onClick="'+ID+'.onPopout()"  alt="einzelnes Fenster">'};
function fnDone  (ID){return fnh+'src="'+imgpath+'wfn/done.gif"   onClick="'+ID+'.onDone()"    alt="übernehmen" >'};//style="background-color:#005544"
function fnClose (ID){return fnh+'src="'+imgpath+'wfn/close.gif"  onClick="'+ID+'.onClose()"   alt="schließen" >'};//style="background-color:#550066"
function fnLearn (ID){return fnh+'src="'+imgpath+'wfn/learn.gif"  onClick="'+ID+'.onLearn()"   alt="Maske ändern">'};
function fnSPos  (ID){return fnh+'src="'+imgpath+'wfn/spos.gif"   onClick="'+ID+'.onSavePos()" alt="Position speichern">'};

function tCtrl(ID,img,txt,alt){
  if (alt=='')alt=txt;
  if (txt!='') txt='<span style="height: 17px; padding: 2 2 2 2">'+txt+'</span>';
  if (img!='') img='<img width="16" height="16" alt="'+alt+'" border="0" src="'+imgpath+'tbtn/'+img+'.gif">';
  return '<td id="'+ID+'" class="tbut" onClick="SEvt(this,\'CLICK\');" onMouseOver="this.className=\'tbuto\'" onMouseOut="this.className=\'tbut\'">'+img+txt+'</td>';
};

function mCtrls(inner){
  return '<div style="position:absolute;left:0;top:0;z-index:1;">'+inner+'</div>';
};
function mCtrl_blur(){
	this.className="tmen";
};
function SUpMC(t){
	t.onblur=mCtrl_blur;
	t.className="tmena";
	t.oncr=SelEntry_cr;
};
function mCtrl(ID,img,txt,alt,add){
  if (alt=='')alt=txt;
  if (img!='') img='<img width="16" height="16" alt="'+alt+'" border="0" src="'+imgpath+'tbtn/'+img+'.gif">';
  return '<div id="'+ID+'" class="tmen" onFocus="SUpMC(this);SFoL(this.id)" onClick="SEvt(this,\'CLICK\');" onMouseOver="this.cn=this.className;this.className=\'tmeno\'" onMouseOut="this.className=cn" '+add+'><table height="100%" width="100%" cellpadding="0" cellspacing="0"><tr><td width="24">'+img+'</td><td class="tment">'+txt+'</td><tr></table></div>';
};

function lCtrl(ID,img,txt,alt){
  if (alt=='')alt=txt;
  if (img!='') img='<img width="32" height="32" alt="'+alt+'" src="'+imgpath+'lbtn/'+img+'.gif">';
  return '<tr><td id="'+ID+'" align="center" style="font-family: sans-serif; font-size: 11px; color: #ffffff" onClick="SEvt(this,\'CLICK\');"><span class="lbut" onMouseOver="this.className=\'lbuto\'" onMouseOut="this.className=\'lbut\'">'+img+'</span><br>'+txt+'</td></tr>';
};

document.oommove=document.onmousemove;
document.oomup=document.onmouseup;


function wMouseMv(){
  var t=window.mobj;s=t.style;
  if (t.fmv)t.fmv=false;
  else
  with (event) {
	t.isMoved=true;
	s.posLeft+=clientX-t.sx;
	s.posTop+=clientY-t.sy;
	t.sx=clientX;
	t.sy=clientY;
	cancelBubble=true;
  };
};

function wMouseUp(){
  if (event.button==1){
	document.onmousemove=document.oommove;
	document.onmouseup=document.oomup;
	var t=window.mobj;
	if (t.isMoved) {
		s=t.style;
		SEvt(t,'SPOS='+s.posLeft+','+s.posTop+','+(s.posWidth)+','+(s.posHeight))};
	};
};

function wMouseDn(t){
  with (event) {
    if (button==1) {
      document.onmousemove=wMouseMv;
      document.onmouseup=wMouseUp;
      window.mobj=t;
      t.fmv=true;
      t.isMoved=false;
      t.sx=clientX;t.sy=clientY;
};};};

