function slideOpenRight(theObj) {
	var w = openObj.clientWidth;
	var wInc = Math.round(w/10);
	if (getClipOpen(openObj,'cr','1') < w + 10) {
		clipByOpen(openObj,0,wInc,0,0)
		setTimeout("slideOpenRight()",10)
	}
}
function slideOpenBottom(theObj,hInc,h) {
	var h = openObj.clientHeight;
	var hInc = Math.round(h/10);
	if (getClipOpen(theObj,'cb','1') < h + 10) {
		clipByOpen(theObj,0,0,hInc,0)
		setTimeout("slideOpenBottom()",10)		
	}
}
function slideCloseLeft(theObj,wInc,w) {
	var w = closeObj.clientWidth;
	var wInc = Math.round(w/10);
	if (getClipClose(theObj,'cr','2') > 0) {
		clipByClose(theObj,0,-wInc,0,0)
		setTimeout("slideCloseLeft()",10)
	}
}
function slideCloseTop(theObj,hInc,h) {
	var h = closeObj.clientHeight;
	var hInc = Math.round(h/10);
	if (getClipClose(theObj,'cb','2') > 0) {
		clipByClose(theObj,0,0,-hInc,0)
		setTimeout("slideCloseTop()",5)
	}
}
function getClipOpen(theObj,side,which) {
	var clipv = openObj.style.clip.split("rect(")[1].split(")")[0].split("px")
	if (side=="ct") return Number(clipv[0])
	if (side=="cr") return Number(clipv[1])
	if (side=="cb") return Number(clipv[2])
	if (side=="cl") return Number(clipv[3])
}
function getClipClose(theObj,side,which) {
	var clipv = closeObj.style.clip.split("rect(")[1].split(")")[0].split("px")
	if (side=="ct") return Number(clipv[0])
	if (side=="cr") return Number(clipv[1])
	if (side=="cb") return Number(clipv[2])
	if (side=="cl") return Number(clipv[3])
}
function clipByOpen(theObj,ct,cr,cb,cl) {
	openObj.style.clip = "rect("+(this.getClipOpen(theObj,'ct')+ct)+"px "+(this.getClipOpen(theObj,'cr')+cr)+"px "+Number(this.getClipOpen(theObj,'cb')+cb)+"px "+Number(this.getClipOpen(theObj,'cl')+cl)+"px)";
}
function clipByClose(theObj,ct,cr,cb,cl) {
	closeObj.style.clip = "rect("+(this.getClipClose(theObj,'ct')+ct)+"px "+(this.getClipClose(theObj,'cr')+cr)+"px "+Number(this.getClipClose(theObj,'cb')+cb)+"px "+Number(this.getClipClose(theObj,'cl')+cl)+"px)";
}

var LastVisibleName = "";

function slides() 
{
  var i, visStr, args, theObj, LastObj;
  args = slides.arguments;
  var Direction = args[0];
  for (i=1; i < (args.length-1); i+=2) 
  { 
    visStr   = args[i+1];
    if (document.all != null) 
    {
      theObj = eval(document.all[args[i]]);
      if (theObj) 
      {
        if (visStr == "visible") 
        {
	  openObj = theObj;
          SetCoords(openObj);
          while ((openObj.style.top == "-1px") && (openObj.style.left == "-1px"))
          {
            LastObj = openObj;
            openObj = GetNextObj(Direction, LastObj);
            if (!openObj)
            {
              openObj = LastObj;
              break;
            }
            SetCoords(openObj);
          }
 
          if (openObj.Seq > 1)
            LastVisibleName = openObj.id;
          openObj.style.visibility = visStr;
	  openObj.style.clip = "rect(0,0,0,0)";
          
	  slideOpenRight();
          slideOpenBottom();
         
        }
        else 
        if (visStr == "hidden") 
        {
          if (Direction == 'Cancel') 
            LastVisibleName = "";
          closeObj = theObj;
          closeObj.style.clip = "rect(0 " + closeObj.clientWidth + " " + closeObj.clientHeight + " 0)"
          slideCloseLeft()
	  slideCloseTop()				
        }  
      }
    } 
  }
}

function GetNextObj(Direction, LastObj)
{
  if (Direction == 'Back') 
    Name = LastObj.Prev
  else
    Name = LastObj.Next;
  if (Name != "")
    return document.all[Name]
  else
    return null;
}
    

function SetCoords(openObj)
{
 
  var Found = false;
  if (openObj.id.indexOf('LkpHelp') >= 0)
  {
    openObj.style.top = -1;
    openObj.style.left = -1;
    var ObjName = openObj.id.split("LkpHelp")[1];
    var Form = document.forms[0];
    if (Form)
    {
      var Elem = Form.elements[ObjName];
      if (Elem)
      {
        var Rect = Elem.getClientRects();
        openObj.style.top = Rect.top + document.body.scrollTop;
        openObj.style.left = Rect.right + document.body.scrollLeft + 10;
        Found = true;
      }
    }

    if (!Found)
    {
      Elem = document.all[ObjName];
      if ((Elem) && (Elem.length))
        Elem = Elem[0];

      if (Elem)
      {
        var Rect = Elem.getClientRects();
        openObj.style.top = Rect[0].top + document.body.scrollTop - 2;
        if (Elem.tagName == "LI")
          openObj.style.left = Rect[0].left + document.body.scrollLeft + 50
        else
          openObj.style.left = Rect[0].right + document.body.scrollLeft;
      }
    }
  }
}

     
