/*
 * date:	2002-10-14
 * info:	http://inspire.server101.com/js/m/
 */

var mItem = [];
var mTime = [];
var mWait = 250;



function getElementsByStyleClass (className) {
  var all = document.all ? document.all :
    document.getElementsByTagName('*');
  var elements = new Array();
  for (var e = 0; e < all.length; e++)
    if (all[e].className == className)
      elements[elements.length] = all[e];
  return elements;
}

function mSet(ul, c) {
if (document.getElementById) {
	var b = getElementsByStyleClass('dd');
	for (ca=0;ca<b.length;ca++){
		//	for each (xa in b){
		//alert(ca + ' ' + b.length);
		xa = b[ca];
		mHelp(xa,c);
		//alert(xa);
		//ul = document.getElementById(ul).getElementsByTagName('ul');
	
		
	}
}}

function mHelp(xa,c){


		ul = xa.getElementsByTagName('ul');
		var i, j, e, a, f, b;
		var m = mItem.length;
			for (i = 0; i < ul.length; i++) {
			//alert(ul);
			//alert(i);
			if (e = ul[i].getAttribute('id')) {
				//alert(e);
				//alert(mItem);
				mItem[m] = e;
				e = ul[i].parentNode;
				e.className = c;
	
				f = new Function('mShow(\'' + mItem[m] + '\');');
				b = new Function('mBlur(\'' + mItem[m] + '\');');
				e.onmouseover = f;
				e.onmouseout = b;
				a = e.getElementsByTagName('a');
				for (j = 0; j < a.length; j++) {
					a[j].onfocus = f;
					a[j].onblur = b;
				}
				m++;
			}
		}
		
}

function mShow(id) {
	for (var i = 0; i < mItem.length; i++) {
		if (document.getElementById(mItem[i]).style.display != 'none') {
			if (mItem[i] != id) mHide(mItem[i]);
			else mClear(mItem[i]);
		}
	}
	document.getElementById(id).style.display = 'block';
}


function mHide(id) {
	mClear(id);
	document.getElementById(id).style.display = 'none';
}


function mBlur(id) {
	mTime[id] = setTimeout('mHide(\'' + id + '\');', mWait);
}


function mClear(id) {
	if (mTime[id]) {
		clearTimeout(mTime[id]);
		mTime[id] = null;
	}
}