<?php
	
	global $pageObject;
	$pageType = "";
	if(isset($pageObject))
		$pageType = $pageObject->pageType;
		
	$xt = new Xtempl();
	if(array_key_exists("custom1",$menuparams) && $menuparams["custom1"]=="horizontal")
	{
		$xt->assign("horizontal_typemenu",true);//horizontal type menu
		$xt->assign("tophorizontal_item",true);//top item for horizontal menu
		$xt->assign("simplehorizontal_item",true);//simple item for horizontal menu
		$horiz=true;
	}	
	else{
		$xt->assign("vertical_typemenu",true);//vertical type menu
		$xt->assign("topvertical_item",true);//top item for vertical menu
		$xt->assign("simplevertical_item",true);//simple item for vertical menu
		$horiz=false;
	}
		
	// create menu nodes arr
	$menuNodes = array();
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "1";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "My Home";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "My Home";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "SIPSS GLOBAL-Marketing Portal";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "2";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "http://corbisnet.com/mktg/";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "External";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "NewWindow";					 
	// set title		
			$menuNode["title"] = "SIPSS GLOBAL-Marketing Portal";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "Customer List - Modules";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "3";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Group";
	$menuNode["linkType"] = "None";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Customer List - Modules";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "4";
	$menuNode["parent"] = "3";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Inactive customer_list";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Inactive Customer List";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "5";
	$menuNode["parent"] = "3";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Pending Customers";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Pending Customers";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "6";
	$menuNode["parent"] = "3";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Review List";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Review List";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "7";
	$menuNode["parent"] = "3";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Short-Listed Customers";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Short-Listed Customers";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "8";
	$menuNode["parent"] = "3";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Active Customers";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Active Customers";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "9";
	$menuNode["parent"] = "3";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Visit Update";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Visit Update";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "Admin Roles";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "10";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Group";
	$menuNode["linkType"] = "None";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Admin Roles";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "11";
	$menuNode["parent"] = "10";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "employee_list";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Employee List";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "12";
	$menuNode["parent"] = "10";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Area_Details";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Area Details";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "13";
	$menuNode["parent"] = "10";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Region_Details";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Region Details";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "Regional Reports";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "14";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Group";
	$menuNode["linkType"] = "None";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Regional Reports";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "15";
	$menuNode["parent"] = "14";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "RO - Calls Summary";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "RO - Calls Summary";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "16";
	$menuNode["parent"] = "14";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "RO - Calls Report";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "RO - Calls Report";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "17";
	$menuNode["parent"] = "14";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "RO - Visit Report";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "RO - Visit Report";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "18";
	$menuNode["parent"] = "14";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Customer List Summary - RO";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Chart";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Customer List Summary - RO";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "HO - Reports";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "19";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Group";
	$menuNode["linkType"] = "None";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "HO - Reports";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "20";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "HO - Calls Report";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "HO - Calls Report";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "21";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "HO - Calls Summary";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "HO - Calls Summary";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "22";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "HO - Visit Report";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "HO - Visit Report";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "23";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Open Leads Report";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Report";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Open Leads Report";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "24";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Potential Customer List";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Potential Customer List";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "25";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Calls Performance";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Chart";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Calls Performance";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "26";
	$menuNode["parent"] = "19";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Visit Performance";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "Chart";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Visit Performance";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "Opportunity - Module";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "27";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Group";
	$menuNode["linkType"] = "None";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Opportunity - Module";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "28";
	$menuNode["parent"] = "27";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Vendor Details";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Vendor Details";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "29";
	$menuNode["parent"] = "27";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "Leads-Management";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Leads-Management";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "30";
	$menuNode["parent"] = "27";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "SPC-Pending";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "SPC-Pending";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "Materials Module";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "31";
	$menuNode["parent"] = "0";
	$menuNode["style"] = "";
	$menuNode["href"] = "";
	$menuNode["params"] = "";
	$menuNode["table"] = "";
	$menuNode["type"] = "Group";
	$menuNode["linkType"] = "None";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Materials Module";
	$menuNodes[] = $menuNode;	
	
	$menuNode = array();
	$menuNode["name"] = "";
	$menuNode["nameType"] = "Text";
	$menuNode["id"] = "32";
	$menuNode["parent"] = "31";
	$menuNode["style"] = "";
	$menuNode["href"] = "mypage.htm";
	$menuNode["params"] = "";
	$menuNode["table"] = "material category";
	$menuNode["type"] = "Leaf";
	$menuNode["linkType"] = "Internal";
	$menuNode["pageType"] = "List";
	$menuNode["openType"] = "None";					 
	// set title		
			$menuNode["title"] = "Material Category";
	$menuNodes[] = $menuNode;	
	
	
	// need to predefine vars
	$nullParent = NULL;
	$rootInfoArr = array("id"=>0, "href"=>"");
	// create treeMenu instance
	$menuRoot = new MenuItem($rootInfoArr, $menuNodes, $nullParent);
	// call xtempl assign, set session params
	$menuRoot->setMenuSession();
	$menuRoot->assignMenuAttrsToTempl($xt);
	$menuRoot->setCurrMenuElem($xt);
//	$menuRoot->clearMenuSession();
	
	$xt->assign("mainmenu_block",true);
	$rOrder = $xt->getReadingOrder();
	
	$mainmenu=array();
	if(isEnableSection508()) 
	{
		$mainmenu["begin"]="<a name=\"skipmenu\"></a>";
	}
//	Javascript code for menu on page
	$mainmenu["end"]='
	<script type="text/javascript" language="javascript" src="include/jquery.dropshadow.js"></script>';
		$mainmenu["end"] .= '<script type="text/javascript" language="javascript" src="include/cookies.js"></script>';
	
	$countLinks=0;
	$countGroups=0;
	foreach($menuRoot->children as $ind=>$val)
	{
		if($val->showAsLink)
			$countLinks++;			
		if ($val->showAsGroup)
			$countGroups++;			
	}
	if(($pageType == PAGE_MENU) || $countLinks>1 || $countGroups>0)
	{
		$xt->assignbyref("mainmenu_block",$mainmenu);
		$xt->assign("mainmenustyle_block",true);
		$xt->assign("mainmenuiestyle_block",true);
		if(isset($menuparams["quickjump"]))
			$xt->display("mainmenu_quickjump.htm");
		elseif(array_key_exists("custom1",$menuparams) && $menuparams["custom1"]=="horizontal")
			$xt->display("mainmenu_horiz.htm");
		else
			$xt->display("mainmenu.htm");
	}
	//for add ao delete &nbsp; 
?>
