	menunum=0;
	menus=new Array();
	_d=document;
	readbuffer = ""
        aLine = new Array();
        itemindex = 0;
        	
        function getFile(pURL) 
        {
           if (window.ActiveXObject) 
           { //IE 
              xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); 
              if (xmlhttp) 
              {  
                 xmlhttp.open('GET', pURL, false);
                 xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );        
                 xmlhttp.onreadystatechange=function()
                 {
                    if (xmlhttp.readyState === 4) 
                    {  // Makes sure the document is ready to parse.
                        if (xmlhttp.status === 200) 
                        {  // Makes sure it's found the file.
                            allText = xmlhttp.responseText; 
                            aLine = xmlhttp.responseText.split("\n"); // Will separate each line into an array                            
                        }
                    }
                 }                 
                 xmlhttp.send();
              }
              else
                alert('Your browser does not support XMLHTTP');
            }
            else if (window.XMLHttpRequest) 
            { // code for Mozilla, Safari, etc 
              xmlhttp=new XMLHttpRequest();
              xmlhttp.open("GET", pURL, false);
              xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );                                       
              xmlhttp.onreadystatechange=function() 
              {
                    if (xmlhttp.readyState === 4) 
                    {  // Makes sure the document is ready to parse.
                        if (xmlhttp.status === 200) 
                        {  // Makes sure it's found the file.
                            allText = xmlhttp.responseText; 
                            aLine = xmlhttp.responseText.split("\n"); // Will separate each line into an array                            
                        }
                    }
               }
              
               xmlhttp.send(null);
            }
        }

	function searchForTitle( itemsearch)
	{
		   var ind = 0;
		   while (ind < itemindex)
            {
					if (aLine[ind+1] == itemsearch)  
					{
						//alert(aLine[ind]);
						//aLine[ind] = aLine[ininddex].replace(/\n/g, ""); 
						//aLine[ind] = aLine[ind].replace(/\r/g, "");
						return  aLine[ind];
					}
					ind++;
              }
			  return "Not Found";
	}

	function addmenu()
	{
	        menunum++;
		menus[menunum]=menu;
	}

	function dumpmenus()
	{
	        mt="<script language=javascript>";
		for(a=1;a<menus.length;a++)
		{
			mt+=" menu"+a+"=menus["+a+"];"
		}
		mt+="<\/script>";
		_d.write(mt);
	}        
	if(navigator.appVersion.indexOf("MSIE 6.0")>0) 
	{
		effect = "Fade(duration=0.2);Alpha(style=0,opacity=280);Shadow(color='#777777', Direction=135, Strength=5)"
	} 
	else 
	{
		effect = "Shadow(color='#777777', Direction=135, Strength=5)" // Stop IE5.5 bug when using more than one filter
	}

	timegap=80;
	followspeed=60;
	followrate=100;	
	suboffset_top=1;
	suboffset_left=-4;

	style1= ["ffffff","009fec","000000","009fec","ffffff",14,"normal",
		"normal","MS Sans Serif",4,"",1,"ffffff","ffffff","ffffff",
		"009fec","","ffffff","000099",]

	style2=["753a00","cccccc","ff0000","999999","666666",13,"normal",
		"normal","MS Sans Serif",4,"",1,"666666","666666","ffffff",
		"cccccc","","ffffff","000099",]

	addmenu(menu=[		// This is the array that contains your menu properties and details
		"mainmenu","1","112",97,1,"center",style1,1,"center",effect,
		0,1,,,,,,,,,,
		// "Description Text","URL", "Alternate URL", "Status", "Separator Bar"
		// Main menu
		,"Home","default.asp",,"",1      
		,"Company Info","show-menu=company",,"",1
		,"Product","show-menu=product",,"",1
		,"Service","Service.asp",,"",1
		,"What's New","show-menu=whatnew",,"",1
		,"Contribution","show-menu=welfare",,"",1
		,"FAQ","FAQ.asp",,"",1
		,"Contact Us","ContactUs.asp",,"",1

		])

                /*addmenu(menu=["company",,,200,1,"",style1,0,"left",effect,,,,,,,,,,,,
                    ,"Company Data","companyinfo.asp  ",,,1
                    ,"Board of directors","Board.asp ",,,1
                    ,"ISO9001","ISO_1.asp ",,,1
                    ,"ISO14001","ISO.asp ",,,1
                    ,"Management Policy","Quality.asp ",,,1
                    ,"Mitsubishi Electric Corporation","Corporation.asp ",,,1
                    ,"Subsidiary Companies","Subsidiary.asp ",,,1
                    ,"Office Calendar","Calendar.asp ",,,1
                    ,"Office Map","Map.asp ",,,1

                    ])*/
	
				getFile("ES-MIT/UploadFile/menuCompanyInfo.txt");        
                itemindex = aLine.length;
                menu=["company",,,200,1,"",style1,0,"left",effect,,,,,,,,,,,,
				,"Company Profile","companyinfo.asp  ",,,1];
                index = 0; 
				

       			BoardTitle = searchForTitle(1);	  //Board of director		
				url = "Board.asp "
				menu1 = [BoardTitle,url,,,1]
                menu = menu.concat(menu1);

				title = searchForTitle(2);		 //ISO 9001
				url = "ISO_1.asp "
				menu1 = [title,url,,,1]
                menu = menu.concat(menu1);

				title = searchForTitle(3);		 //ISO 14001
				url = "ISO.asp "
				menu1 = [title,url,,,1]
                menu = menu.concat(menu1);

/*  เอาออกชั่วคราวเพราะยังไม่มี mgmt policy
				title = searchForTitle(4);  //Management Policy
				url = "Quality.asp "
				menu1 = [title,url,,,1]
                menu = menu.concat(menu1);
*/
				title = searchForTitle(5);  //Mitsubishi Electric Corporation
				url = "Corporation.asp  "
				menu1 = [title,url,,,1]
                menu = menu.concat(menu1);

				title = searchForTitle(6);  //Subsidiary Companies
				url = "subsidiary.asp  "
				menu1 = [title,url,,,1]
                menu = menu.concat(menu1);

				title = searchForTitle(7);  //company calendar
				url = "calendar.asp  "
				menu1 = [title,url,,,1]
                menu = menu.concat(menu1);

/*
				menu2 = ["Office Calendar","Calendar.asp ",,,1
                    ,"Office Map","Map.asp ",,,1];
				menu = menu.concat(menu2);
                addmenu(menu)
*/

				menu2 = ["Office Map","Map.asp ",,,1];
				menu = menu.concat(menu2);
                addmenu(menu)


                getFile("ES-MIT/UploadFile/menuProducttemp.txt");        
                itemindex = aLine.length;
                menu=["product",,,150,1,"",style1,0,"left",effect,,,,,,,,,,,,];
                index = 0; 
                while (index < itemindex)
                {
                    aLine[index] = aLine[index].replace(/\n/g, ""); 
                    aLine[index] = aLine[index].replace(/\r/g, "");
                    if (aLine[index] == "") 
                        break;
                    
                    title = aLine[index++];
                    aLine[index] = aLine[index].replace(/\n/g, ""); 
                    aLine[index] = aLine[index].replace(/\r/g, "");
                    url = "ProductList2.asp?id=" + aLine[index++] + "  ";            
                    menu1 = [title,url,,,1]
                    menu = menu.concat(menu1);
                }				
                addmenu(menu)
                
                getFile("ES-MIT/UploadFile/menuWhatNewtemp.txt");	
                itemindex = aLine.length;
                menu=["whatnew",,,120,1,"",style1,,"left",effect,0,,,,,,,,,,,];
                index = 0; 
                while (index < itemindex)
                {
                    aLine[index] = aLine[index].replace(/\n/g, ""); 
                    aLine[index] = aLine[index].replace(/\r/g, "");
                    if (aLine[index] == "") 
                        break;
                    
                    title = aLine[index++];
                    aLine[index] = aLine[index].replace(/\n/g, ""); 
                    aLine[index] = aLine[index].replace(/\r/g, "");            
                    url = "WhatNew.asp?id=" + aLine[index++] + "  ";            
                    menu1 = [title,url,,,1]
                    menu = menu.concat(menu1);
                }				
                addmenu(menu)
	


				getFile("ES-MIT/UploadFile/menuContributiontemp.txt");	
                itemindex = aLine.length;
                menu=["welfare",,,180,1,"",style1,,"left",effect,0,,,,,,,,,,,];
                index = 0; 
                while (index < itemindex)
                {
                    aLine[index] = aLine[index].replace(/\n/g, ""); 
                    aLine[index] = aLine[index].replace(/\r/g, "");
                    if (aLine[index] == "") 
                        break;
                    
                    title = aLine[index++];
                    aLine[index] = aLine[index].replace(/\n/g, ""); 
                    aLine[index] = aLine[index].replace(/\r/g, "");            
                    url = "Welfare.asp?id=" + aLine[index++] + "  ";            
                    menu1 = [title,url,,,1]
                    menu = menu.concat(menu1);
                }				
                addmenu(menu)

                dumpmenus()
