// joerg.eichhorn@sys-mail.net


//globals
var b = new Array();
var pxss = '';
function bd()
	{
		b["ie"] = (document.all)? true:false;
		b["nn4"] = (document.layers)? true:false;     
		b["dom"] = (document.getElementById)? true:false;
		
		if (!b['nn4']) { pxss ='px'; }
	}
bd();
var allow = false;



//coords
function cevents()
	{
		if (b["nn4"])
			{ window.captureEvents (Event.MOUSEMOVE); window.onmousemove=xy; }
		else
			{ document.onmousemove=xy; }
	}

var mx=my=-1;
function xy(e)
	{ 
		if (allow) 
		{
      if (document.screenX) { mx = e.screenX; my = e.screenY; }
      else if (b["ie"]) { mx = window.event.x; my = window.event.y; }
	    else { mx = e.pageX; my = e.pageY; }
			//window.status = iter; //mx+':'+my+':'+locked+':'+am;
			
//			mc();
			cm();
		}	    
	}



function lgeto(which,parent)
	{
		//alert(which);
		if (b["dom"]) { return document.getElementById(which); }
		if (b["ie"])  { return document.all[which]; }
		if (b["nn4"])
			{ 
				if (parent)
					{ return document.layers[parent].document.layers[which]; }
				else
					{ return document.layers[which]; }
			}
		
		return false;
	}

function geto(which)
	{
		if (b['dom']) { return document.getElementById(which); } else { return false; }
	}

function getos(which)
	{
		if ( o = geto(which) ) { return o.style; }
		
	}

function lgets(which,parent)
	{
		which = (parent)? lgeto(which,parent):lgeto(which);
		if (b["nn4"]) { return which; }
		else { return which.style; }
	}

function lgeth(which,parent)
	{
		which = (parent)? lgeto(which,parent):lgeto(which);
		if (b["nn4"]) { return which.document.height; }
		else { return parseInt(which.offsetHeight); }
	}

function lgetw(which,parent)
	{
		which = (parent)? lgeto(which,parent):lgeto(which);
		if (b["nn4"]) { return which.document.width; }
		else { return parseInt(which.offsetWidth); }
	}

function lwrite(which,what,parent)
	{
		which = (parent)? lgeto(which,parent):lgeto(which);
		if (b["nn4"]) { with(which.document) {open();write(what);close();} }
		else { which.innerHTML = what; }
	}
		
function lgetx(which,parent)
	{ which = (parent)? lgets(which,parent):lgets(which); 
		return parseInt(which.left); }
		
function lgety(which,parent)
	{
		which = (parent)? lgets(which,parent):lgets(which); 
		return parseInt(which.top); }
	
function lclip(which,o,r,u,l,parent)
	{
		which=lgets(which);
		if(b["nn4"]) { with (which.clip) {top=o;right=r;bottom=u;left=l;} }
		else { which.clip = 'rect('+o+'px '+r+'px '+u+'px '+l+'px)'; }
			
	}
				
function lmove(which,rel,x,y,parent)
	{
		which = (parent)? lgets(which,parent):lgets(which);
		if (rel==1)
			{
				if (x) { which.left = parseInt(which.left)+x+pxss; }
				if (y) { which.top = parseInt(which.top)+y+pxss; }
			}
		else
			{
				if (x) { which.left = x+pxss; }
				if (y) { which.top  = y+pxss;}
			}
		
	}

function lsh(which,how,parent)
	{
		which = (parent)? lgets(which,parent):lgets(which); 
		which.visibility = (how==1)? "visible":"hidden";
	}

function osh(which,how)
	{
		
		if (!( o = getos(which) )) { return; }
		
		o.visibility = (how==1)? "visible":"hidden";
	}

