function dhtmlQuickDropdown(name, cssClass) {
	var tmpObj = new Object();

	tmpObj.name = name;
	tmpObj.cssClass = cssClass;
	tmpObj.items = new Array();
	tmpObj.addQuickItem = objAddItem;
	tmpObj.draw = objDraw;
	tmpObj.separator = "<div class=\"hr\"><img src=\"/templates/common/images/spacer.gif\" width=\"1\" height=\"1\" alt=\"separator\" border=\"0\"></div>";
	
	return tmpObj;
}

function objAddItem(itemName, itemValue) {
	var tmpItem = new Object();
	tmpItem.name = itemName;
	tmpItem.value = itemValue;
	tmpItem.newWindow = (arguments.length == 3);
	this.items[this.items.length] = tmpItem;
}

function objDraw() {
	document.write("<div id=\"" + this.name + "\" class=\"" + this.cssClass + "\">");
	for (var i = 0; i < this.items.length; i++) {
		if (this.items[i].newWindow) {
			document.write("<a href=\"\" onclick=\"window.open('" + this.items[i].value + "', 'PopupWindow', ''); return false;\" class=\"" + this.cssClass + "Item\">" + this.items[i].name + "</a>");
		} else {
			document.write("<a href=\"\" onclick=\"document.location = '" + this.items[i].value + "'; return false;\" class=\"" + this.cssClass + "Item\">" + this.items[i].name + "</a>");
		}
		if (this.separator != "") {
			document.write(this.separator);
		}
	}
	document.write("</div>");
}

function showDropdown(dropdownId) {

	hideCurrentDropdown();
	
	currentDropdown = dropdownId;
	
	showLayer(dropdownId);
	showLayer("hideDropdown");
}

function hideCurrentDropdown() {
	if (currentDropdown != "") {
		scrollToTop(currentDropdown);
		hideLayer(currentDropdown);
	}
}

function scrollToTop(objId) {
	if (document.getElementById(objId)) {
		document.getElementById(objId).scrollTop = 0;
	}
}


currentDropdown = "";

document.write("<div id=\"hideDropdown\" onmousedown=\"hideLayer('hideDropdown'); hideCurrentDropdown(); return false;\"><img src=\"/templates/common/images/spacer.gif\" width=\"99%\" height=\"99%\" border=\"0\" alt=\"separator\" galleryimg=\"no\"></div>");
