<!--
/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2002-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function initGlideLayers() {
  var i, el;
  var glideLyrs = new Array();
  
  // Set up your layers here
  // arguments: id, amount to be visible (left), top, width, height
	// If you don't specify the top position (null), code calculates
	// based on height of previous layer, leaving a 2px gap
  glideLyrs[0] = new dynObj('glideDiv1', 212, 0, 10, 20);
  
  for (i=0; glideLyrs[i]; i++) {
		// hold amount to be left visible 
		glideLyrs[i].xOff = glideLyrs[i].x;
		if ( !glideLyrs[i].y ) // position based on previous glideLyrs height and position
			if ( glideLyrs[i-1] ) glideLyrs[i].y = glideLyrs[i-1].y + glideLyrs[i-1].h + 2;	
		glideLyrs[i].shiftTo( -(glideLyrs[i].w - glideLyrs[i].xOff), glideLyrs[i].y );
		glideLyrs[i].show();
    el = dynObj.getElemRef( glideLyrs[i].id );
    if (el) {
	  el.onmousemove = slideIntoView;
      el.onclick = slideOutOfView;
    }
  }  
  
}

function slideIntoView(did) {
	var did;
	if(did == ''){
  		var glideLyr = dynObj.getInstance(this.id);
	} else {
		var glideLyr = dynObj.getInstance(did);
	}
  //('final left pos','up or down end pos','slide speed','blink speed - motion')
  glideLyr.slideTo(8, null, 240, -.8);
  document.getElementById('glideDiv1').style.width = '200px';
  document.getElementById('img_gb').innerHTML = '<img src="img/icon_mais_green.gif" onclick="if(document.getElementById(\'glideDiv1\').style.visibility == \'visible\') { document.getElementById(\'glideDiv1\').style.visibility = \'hidden\'; } else { initGlideLayers();slideIntoView(\'glideDiv1\'); document.getElementById(\'glideDiv1\').style.zIndex = \'2\'; }" border="0" />';
}

function slideOutOfView(e) {
  var glideLyr = dynObj.getInstance(this.id);
	e = e? e: window.event;
  var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
  if ( toEl != glideLyr.el && !contained(toEl, glideLyr.el) )
  	  //back position
	  glideLyr.slideTo( -(glideLyr.w - glideLyr.xOff), null, 300, -.8);
}
// returns true if oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return; // in case alt-tab away while hovering (prevent error)
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}

//-->
