DROPMENU = function () {
	this.full = (document.all && document.getElementById);
	this.part = (!document.all && document.getElementById);
	this.openSubMenu = 0;
	this.openSubName = '';
	this.openMe;
	this.closeMe;
	this.subDivArray = [];
	this.Menu = function(n, t, l) {
		this[n] = new Object();
		if(t.length > 0) {
			this.subDivArray[this.subDivArray.length] = n;
			this[n].titles = t;
			this[n].locations = l;
		}
	}
	this.createMenu = function() {
		for(var i = 0; i< this.subDivArray.length; i++) document.write('<div class="mainmenusubmenu" id="'+this.subDivArray[i]+'"></div>');
	}
	this.openSub = function(lead) {
		if(this.full || this.part) {
			this.cancelSub(lead+'sub');
			this.openMe = setTimeout(this.name + ".doOpenSub('" + lead + "');", 250);
		}
	}
	this.doOpenSub = function(lead) {
		clearTimeout(this.openMe);
		if(this.full || this.part) {
			var id = lead + 'sub';
			var subMenu = this.getItem(id);
			if(subMenu != false) {
				this.getItem(lead + '_link').className = 'mainmenuover';
				if(this.getItem(id+'display') == false) this.createSub(lead, id);
				subMenu.style.top = this.getTop(this.getItem(lead))+(-4)+'px';
				subMenu.style.left = this.getLeft(this.getItem(lead))+(180)+'px';
				this.openSubMenu = id;
				this.openSubName = lead;
				if(subMenu.style.visibility != "visible") {
					subMenu.style.visibility = "visible";
					if(this.full) {
						subMenu.style.height = '1px';
						this.growSub(id, this.getItem(id+'display').offsetHeight);				
					}
				}
			} else {
				this.cancelSub(id);
			}
		}
	}
	this.createSub = function(lead, id) {
		var record = this[id].titles.length;
		var mySub = '<div class="mainmenusub" id="' + id + 'display">';
		mySub += '<ul>';
		for(var i=0; i<record; i++) {
			mySub += '<li>';
				mySub += '<a href="' + ((!securedPage) ? '' : website) + this[id].locations[i] + '"';
					mySub += ' onmouseover="' + this.name + '.cancelSub(\'' + lead + 'sub' + '\');"';
					mySub += ' onmouseout="' + this.name + '.closeSub();"';
					mySub += '>';
					mySub += this[id].titles[i];
				mySub += '</a>';
			mySub += '</li>';
		}
		mySub += '</ul>';
		mySub += '</div>';
		this.getItem(id).innerHTML = mySub;
	}
	this.cancelSub = function(e) {
		if(this.full || this.part) {
			clearTimeout(this.openMe);
			clearTimeout(this.closeMe);
			if(this.openSubMenu != 0 && e != this.openSubMenu) {
				clearTimeout(this['st'+this.openSubMenu]);
				this.getItem(this.openSubName + '_link').className = '';
				this.getItem(this.openSubMenu).style.visibility = "hidden";
				this.openSubMenu = 0;
				this.openSubName = '';
			}
		}
	}
	this.closeSub = function(){
		if(this.full || this.part) {
			clearTimeout(this.openMe);
			this.closeMe = setTimeout(this.name + ".cancelSub(0);", 1000);
		}
	}
	this.growSub = function(obj, h) {
		var subMenu = document.getElementById(obj);
		var tempH = subMenu.style.pixelHeight;
		var newH = tempH+Math.ceil((h-tempH)/6);
		subMenu.style.height = newH+'px';
		if(newH != h) this['st'+obj] = setTimeout(this.name + ".growSub('" + obj + "', " + h + ");", 10);
	}
	this.getItem = function(obj) {
		var obj = (document.getElementById(obj) != undefined) ? document.getElementById(obj) : false;
		if (!obj && !obj.style) obj.style = obj;
		return obj;
	}
	this.getLeft = function(e) {
		var leftPos = e.offsetLeft;
		var ep = e.offsetParent;
		while (ep != null) {
			leftPos += ep.offsetLeft;
			ep = ep.offsetParent;
		}
		return leftPos;
	}
	this.getTop = function(e) {
		var topPos = e.offsetTop;
		var ep = e.offsetParent;
		while (ep != null) {
			topPos += ep.offsetTop;
			ep = ep.offsetParent;
		}
		return topPos;
	}
}