

// ASSEMBLER JAVASCRIPT LIBRARY
//
// All code copyright 2000 Brent Gustafson, vitaflo.com and assembler.org
// Feel free to hack around with this code for personal use, all I ask is
// that this code comment remain in tact.  If you're are thinking of using
// this code for profit, you MUST get my permission before doing so.
// Thank you.
//
// This is the engine.  This is a well oiled machine.  This is Assembler.
//
// -Brent
// assembler.org || vitaflo.com

var ns4 = (document.layers) ? 1:0
var dom = (document.getElementById) ? 1:0
var ie4 = (document.all) ? 1:0
var range = "";
var styleObj = "";

if (ie4) {
  range = "all.";
  styleObj = ".style";
  if (dom) ie4 = 0;
}

if (dom) {
  range = "getElementById(\"";
  styleObj = "\").style";
}
//--- end global init


function redraw() {
// derived from Webmonkey CSS fix.  Modified for use on ASMBLR, Mar 15, 2000
  if (document.ASMBLR.redraw.winWidth != window.innerWidth  || document.ASMBLR.redraw.winHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function redrawInit() {
// derived from Webmonkey CSS fix.  Modified for use on ASMBLR, Mar 15, 2000
  if (ns4) {
   document.ASMBLR = new Object;
   document.ASMBLR.redraw = new Object;
   document.ASMBLR.redraw.winWidth = window.innerWidth;
   document.ASMBLR.redraw.winHeight = window.innerHeight;
   window.onresize = redraw();
  }
}

function shiftTo(obj, x, y) {
  if (dom) {
    obj.left = x + "px";
    obj.top = y + "px";
  }
  else if (ns4) {
	obj.moveTo(x,y);
  } 
  else {
    obj.pixelLeft = x;
	obj.pixelTop = y;
  }
}

function getObject(obj) {
  var theObj = eval("document." + range + obj + styleObj); 
  return theObj;
}

function showObj(obj) {
  var theObj = getObject(obj);
  theObj.visibility = "visible";
}
