    function getMenu()
	{
		if( document.all && document.all.menuBar != null )
			return document.all.menuBar;
		else if (document.layers && document.layers['menuBar'] != null)
			return document.layers['menuBar'];
		else{
			return document.getElementById("menuBar"); 
		}
	}

	function getproductMenu()
        {
                if( document.all && document.all.productmenu != null )
                        return document.all.productmenu;
                else if (document.layers && document.layers['productmenu'] != null)
                        return document.layers['productmenu'];
                else{
                        var menuBar = document.getElementById("productmenu");
                        
			return menuBar;
                }
        }

	function getNavBar()
	{
		 if( document.all && document.all.NavBar != null )
                        return document.all.NavBar;
                else if (document.layers && document.layers['NavBar'] != null)
                        return document.layers['NavBar'];
                else{
                        var menuBar = document.getElementById("NavBar");
                        return menuBar;
                }

	}


    function InitMenu()
	   {
		     var bar = getMenu().children;   
		     if( ! document.all  ){
				bar = getMenu().childNodes;
		     }	     
		     for(var i=0;i < 1;i++){
		          var menu = document.getElementById('productmenu');
		          menu.style.visibility = "hidden"
			  bar[i].onmouseover = new Function("ShowMenu()")
		          var Items = menu.children
			  if( !Items ){
                                Items = menu.childNodes;
                     	  }
		          for(var j=1; j<=9; j++){
				var menuItem = document.getElementById('menuItem1_'+j);
	                      if( document.getElementById('menu1'+j)){ 
		                    menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'></Span>"
		                    FindSubMenu(1,j)
			      }
				  var menuItem = document.getElementById('menuItem1_'+j);
				    menuItem.onclick = new Function("Do("+j+")") 
                   		    menuItem.onmouseover = new Function("highlight(1,"+j+")")
            		      }    
                           } 
           }

    function FindSubMenu(x,y) {
              var menu = document.getElementById('menu'+x+y);
		for(var j=1; j<9; j++){
                      menu.style.visibility = "hidden"
	 var menuItem = document.getElementById('menuItem'+x+'_'+y+'_'+j)
        if( menuItem == null ) return;
	menuItem.onmouseover = new Function("highlight("+x+","+y+","+j+")")               
         menuItem.onclick = new Function("Do("+y+","+j+")")     
		      } 
     
	} 

     function ShowMenu( type, left ) {
		bar = getMenu().children;
		if( !bar ){
                        bar = getMenu().childNodes;
                }

		obj = bar[0];		
		HideMenu('menuBar',1,0);
		var menu
		menu = getproductMenu()
		var bar = getMenu(); 
		var obj2 = getNavBar()
		menu.style.visibility = "visible"
		if(  document.all ){
			menu.style.pixelTop =  obj2.getBoundingClientRect().top + obj2.offsetHeight + Bdy.scrollTop - 3
	        	menu.style.pixelLeft = left+obj2.getBoundingClientRect().left + Bdy.scrollLeft
      		}
		else{
			menu.style.top = 98;
                        menu.style.left = document.width -284; 
		}

      }

      function highlight(x,y,z) {
		 for( q=1;q<10;q++){
                        ItemName = 'menuItem'+x;
                        if(z>0){
                                ItemName+='_'+y
                        }
                        ItemName += '_'+q
                        Item = document.getElementById( ItemName );
                        if( Item != null ){ 
                        Item.className="menuItem"; }
                }
		if( x == 1 ){
			HideMenu( 'menu11' )
			HideMenu( 'menu14' )
			HideMenu( 'menu15' )
		}
		if( document.getElementById( 'menu'+x+y ) ){
                HideMenu('menu'+x+y);
		ShowSubMenu('menu'+x+y,x,y)
		}
		var PElement = document.getElementById( 'menuItem'+x+'_'+y );
                if( z > 0 ){
                   PElement = document.getElementById( 'menuItem'+x+'_'+y+'_'+z);
                }
		PElement.className="ItemMouseOver"
		if( document.all ){
			PElement.className = "ItemMouseOverIE";
		}	
		window.defaultStatus = PElement.title
	}
	
	function Do(x,y) {
		var url = 0;
		if( x == 1 ){
			if( y == 1 ){
				//Consulting Overview
				url = "http://www.wolfetech.com/main/Products/consulting.html";
			}
			if( y == 2 ){
				// Case Studies
				url = "http://www.wolfetech.com/main/Products/CaseStudy.html";
			}
		}
		if( x == 2 ){
			// Contact manager
			 url = "http://www.wolfetech.com/main/Products/wtcm.html";
		}
		if( x == 3 ){
			// Sigma Toolkit
			 url = "http://www.wolfetech.com/main/Products/sigma.html";
		}
		if( x == 6 ){
			url = "http://www.wolfetech.com/main/Products/coop.html";
		}
		 if( x == 7 ){
			url = "http://www.wolfetech.com/main/Products/healthcare.html";
                }
	       if( x == 8 ){
			url = "http://www.wolfetech.com/main/Products/helpdesk.html";
                }
		 if( x == 9 ){
			url = "http://www.wolfetech.com/main/Products/file_access.html";
                }
		if( x == 4 ){
			if( y == 1 ){
				// Customer Login
				url = "https://www.wolfetech.com/cgi-bin/login.cgi";
			}
			if( y == 2 ){
				// PocketGenie 5.0
                        	url = "http://www.wolfetech.com/main/Products/pocketgenie5.html";
			}
			if( y == 3 ){
				// PocketGenie 4.0
                        	url = "http://www.wolfetech.com/main/Products/pocketgenie4.html";
			}
			if( y == 4 ){
				// PocketGenie TImeport
                        	url = "http://www.wolfetech.com/main/Products/pocketgenieTP.html";
			}
		}
		if( x == 5 ){
			if( y == 1 ){
				// PI
				 url = "http://www.wolfetech.com/main/Products/pi.html";
                        }
			if( y == 2 ){
				// WolfeStock
                       		 url = "http://www.wolfetech.com/main/Products/wolfestock.html"; 
			}
		}
		if( url != 0 ){	
			window.location = url;
		}
	}
	function HideallMenu(){
		HideMenu("menu11",1,1);
		HideMenu("menu14",1,4);
		HideMenu("menu15",1,5);
		HideMenu("productmenu",1,0);
			
	}

	function HideMenu(obj,intx, inty)  {
		menu =  document.getElementById(obj);
		menu.style.visibility = "hidden"
		for( x=1;x<6;x++){
			ItemName = 'menuItem'+intx;
			if(inty>0){
				ItemName+='_'+inty
			}
			ItemName += '_'+x
			Item = document.getElementById( ItemName );
		 	if( Item != null ){ 
			Item.className="menuItem"; }			
		}
	}  

	function ShowSubMenu(obj,x,y) {
		    HideMenu('menu15',1,5);
		    HideMenu('menu11',1,1);
		    HideMenu('menu14',1,4);
		    
		    menu =  document.getElementById(obj);
                    if( menu == null ){
                        return;
                    }
		    menu.style.visibility = "visible"
		    if(  document.all ){
		 	obj2 = document.getElementById('menuItem'+x+'_'+y);
			menu.style.pixelTop =  obj2.getBoundingClientRect().top + Bdy.scrollTop
                        menu.style.pixelLeft = obj2.getBoundingClientRect().right + Bdy.scrollLeft
		    }
		    else{
		    	menu.style.top =  78+y*20;
     		    	menu.style.left = document.width - 138; 
		    }
	}	
