function MB_Menu(oItemArray, oParentItem, sParentItem ,iLevel){

	prefix = "MB";
	id = (oParentItem == null) ? prefix : prefix + "_" + sParentItem; // "MB" + "_0_1"

	mTABLE = '<TABLE align="left" border="0" cellPadding="0" cellSpacing="0"><tr>';
	var mTD = "";
	for (var i = 0; i < oItemArray.length; i++){
		mTD += '<td><select style="font:normal 11px verdana;margin:3px 4px 6px 4px;width:120px;" onchange="MB_ExecLink(this)">';
		mTD += '<option value="">' + oItemArray[i][0] + '</option>';
		mTD += MB_Item(oItemArray[i], id, i);
		mTD += '</select></td>';
	}
	mTABLE += mTD;
	//mTABLE += mTD +'</tr></table>';

	//mTABLE += '<TABLE align="right" border="0" cellPadding="0" cellSpacing="0"><tr>';
	
	mTABLE += '<td nowrap>';
	mTABLE += '<input type="checkbox" id="openNew" style="margin-top:2px"><label for="openNew" style="font:bold 11px tahoma;margin:0px 5px 50px 5px"><b>Yeni&nbsp;Pencere<b></label>';
	mTABLE += '</td></tr></table>';

	return mTABLE;
}

function MB_Item(oItemPropertiesArray, id, iParentMenu){
	thisId = id + "_" + iParentMenu;

	
	var oMenuItems = eval(MB_MenuSrc + "." + thisId);
	var sItems = "";
	
	if (oMenuItems) {
		for (var i = 0; i < oMenuItems.length; i++) {
			if (oMenuItems[i][0].toUpperCase() == "SEPERATOR") {
				sItems += '<option value="">--------</option>';
			} else if (oMenuItems[i][2] == 0) {
				sItems += '<option value=\'' + oMenuItems[i][1] + '\'">' + oMenuItems[i][0] + '</option>';
			} else if (oMenuItems[i][2] == 1) {
				//var sItemArray = thisId + "_" + i;
				var sItemArray = thisId;
				var oItemArray = eval(MB_MenuSrc + "." + sItemArray);
				sItems += MB_Item(oItemArray, sItemArray, i);
			}
		}
	}
	
	//mi.link = (oItemPropertiesArray[1] == "" || oItemPropertiesArray[1].toUpperCase() == "NONE") ? null : oItemPropertiesArray[1];

	return sItems;
}

function MB_ExecLink(obj){
	if (obj.options && obj.options[obj.selectedIndex].value != ""){
		if (obj.options[obj.selectedIndex].value.toUpperCase().indexOf("JAVASCRIPT:") != -1){
			eval(obj.options[obj.selectedIndex].value.replace(/^JAVASCRIPT:/, ""));
		}else {
			if (document.all && document.all.openNew.checked) {
				var sUniqueString = new Date(); 
				sUniqueString = sUniqueString.toString().replace(/\s+|:|\+/g, "");
				var oWin = window.open(sNewWindowBase + obj.options[obj.selectedIndex].value, sUniqueString, 'toolbar=1,menubar=1,resizable=1,scrollbars=1,height=530,width=750,left=10, top=10');
				oWin = null;
			} else {
				self.location = obj.options[obj.selectedIndex].value;
			}
		}
	}else
		return false;
}

function MB_Resize(){
	/*
	if (window.menubarHolder_OLD) {
		document.all.menubarHolder_OLD.style.width = Math.max(parseInt(document.body.clientWidth) - (((arguments.length > 0) && (typeof(arguments[0]) == 'number')) ? arguments[0] : 0), 500)+ 'px';
	}
	*/
}

function MB_windowOpen(sLink) {
	var sUniqueString = new Date(); 
	sUniqueString = sUniqueString.toString().replace(/\s+|:|\+/g, "");
	var oWin = window.open(sLink, sUniqueString, 'toolbar=1,menubar=1,resizable=1,scrollbars=1,height=530,width=750,left=10, top=10');
	oWin = null;
}