<!--

var Menu = new Array ()
var subMenu = new Array ()
Menu[0] = new Array("<span class="style_blue"> :: หน้าแรก</span>", "?pid=home","_self")
subMenu[0] = new Array()
Menu[1] = new Array("<span class="style_blue"> :: ประชาสัมพันธ์</span>", "?pid=relate","_self")
subMenu[1] = new Array()
subMenu[1][0] = new Array ("ข่าวกิจกรรมต่างๆ", "?pid=relate&sub=1","_self")
subMenu[1][1] = new Array ("ข่าวประกวด/จัดซื้อจัดจ้าง", "?pid=relate&sub=2","_self")
subMenu[1][2] = new Array ("แผนพัฒนาท้องถิ่นประจำปี", "?pid=relate&sub=3","_self")
subMenu[1][3] = new Array ("เอกสารงบประมาณประจำปี", "?pid=relate&sub=4","_self")
subMenu[1][4] = new Array ("แผนการจัดหาพัสดุ", "?pid=relate&sub=5","_self")
subMenu[1][5] = new Array ("ผลการจัดซื้อจัดจ้าง", "?pid=relate&sub=6","_self")
subMenu[1][6] = new Array ("รายงานทางการเงิน", "?pid=relate&sub=7","_self")
subMenu[1][7] = new Array ("รายงานการประชุมสภาฯ", "?pid=relate&sub=8","_self")
subMenu[1][8] = new Array ("รายงานประชุมผู้บริหารฯ", "?pid=relate&sub=9","_self")
subMenu[1][9] = new Array ("รายงานผลการปฎิบัติงานฯ", "?pid=relate&sub=10","_self")
subMenu[1][10] = new Array ("ข่าวจากสื่อต่างๆ", "?pid=relate&sub=11","_self")
Menu[2] = new Array("<span class=style_blue> :: เกี่ยวกับ เทศบาล</span>", "?pid=about","_self")
subMenu[2] = new Array()
subMenu[2][0] = new Array ("ข้อมูลพื้นฐาน", "?pid=about&sub=1","_self")
subMenu[2][1] = new Array ("วิสัยทัศน์", "?pid=about&sub=2","_self")
subMenu[2][2] = new Array ("หน่วยงานในพื้นที่", "?pid=about&sub=3","_self")
Menu[3] = new Array("<span class=style_blue> :: บุคลากร</span>", "?pid=person","_self")
subMenu[3] = new Array()
subMenu[3][0] = new Array ("โครงสร้าง", "?pid=person&sub=1","_self")
subMenu[3][1] = new Array ("คณะบริหาร", "?pid=person&sub=2","_self")
subMenu[3][2] = new Array ("สภาเทศบาล", "?pid=person&sub=3","_self")
subMenu[3][3] = new Array ("สำนักปลัด", "?pid=person&sub=4","_self")
subMenu[3][4] = new Array ("ส่วนการคลัง", "?pid=person&sub=5","_self")
subMenu[3][5] = new Array ("ส่วนโยธา", "?pid=person&sub=6","_self")
subMenu[3][6] = new Array ("ส่วนการศึกษาฯ", "?pid=person&sub=7","_self")
Menu[4] = new Array("<span class=style_blue> :: สถานที่ท่องเที่ยว</span>", "?pid=result","_self")
subMenu[4] = new Array()
Menu[5] = new Array("<span class="style_blue"> :: ผลการดำเนินงาน</span>", "?pid=result","_self")
subMenu[5] = new Array()
Menu[6] = new Array("<span class=style_blue> :: ติดต่อสื่อสาร</span>", "?pid=contact","_self")
subMenu[6] = new Array()
subMenu[6][0] = new Array ("สารจากนายก.", "?pid=contact&sub=1","_self")
subMenu[6][1] = new Array ("เว็บบอร์ด", "?pid=contact&sub=2","_self")
subMenu[6][2] = new Array ("ข้อมูลติดต่อ", "?pid=contact&sub=3","_self")
subMenu[6][3] = new Array ("แบบสำรวจ", "?pid=contact&sub=4","_self")
subMenu[6][4] = new Array ("สมุดเยี่ยมชม", "?pid=contact&sub=5","_self")
Menu[7] = new Array("<span class=style_blue> :: Web Mail</span>", "?pid=webmail","_self")
subMenu[7] = new Array()
sShadow = 1
var isIE = (document.getElementById && document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = (document.getElementById && !document.all)?true:false;
var timer;
var obj = (isIE)?"document.all":"document.getElementById"
styleBorder=("3d".toLowerCase() == "flat")?1:0
document.writeln ('<style>');
document.writeln ('.rcMenuStatic {font-family:'+"tahoma"+';font-size:'+"12px"+';color:'+"#FFFFFF"+';font-weight:'+"bold"+';background-color:'+"#017301"+'; cursor:hand; text-decoration:'+"none"+'}');
document.writeln ('.rcMenuHover {font-family:'+"tahoma"+';font-size:'+"12px"+';color:'+"#024802"+';font-weight:'+"bold"+';background-color:'+"#8EC009"+'; cursor:hand; text-decoration:'+"none"+'}');
document.writeln ('.rcSubMenuStatic {font-family:'+"tahoma"+';font-size:'+"12px"+';color:'+"#024802"+';font-weight:'+"normal"+';text-decoration:'+"none"+';background-color:'+"#DBDBCE"+'; cursor:hand}');
document.writeln ('.rcSubMenuHover {font-family:'+"tahoma"+';font-size:'+"12px"+';color:'+"#024802"+';font-weight:'+"normal"+';text-decoration:'+"none"+';background-color:'+"#A6A684"+'; cursor:hand}');
document.writeln ('</style>');

function showMenus()
{
  if ("vertical".toLowerCase() == "vertical"){document.writeln ('<table border="0" cellpadding="0" cellspacing="'+styleBorder+'" bgColor="'+"#FFFFFF"+'">')}
  else{document.writeln ('<table border="0" cellpadding="0" cellspacing="'+styleBorder+'" bgColor="'+"#FFFFFF"+'"><tr>')}  
  for (x=0; x<Menu.length; x++)
  {
    if ("vertical".toLowerCase()=="vertical") document.writeln('<tr>')
    document.writeln ('<td onclick="tdMouseClick(\'mainLink'+x+'\')" onMouseOver="hoverMenu(); popDown('+x+', \'button'+x+'\'); " onMouseOut="clearMenu('+x+')" ')
    if ("3d".toLowerCase() == "3d"){document.writeln ('style="border-left:'+1+'px solid '+"#8EC009"+';border-top:'+1+'px solid '+"#8EC009"+';border-right:'+1+'px solid '+"#024802"+';border-bottom:'+1+'px solid '+"#024802"+';"');}        
    document.writeln (' width="140"><div id="button'+x+'"><table border="0" cellpadding="'+3+'" cellspacing="0" width="100%"><tr><td class="rcMenuStatic" id="cell'+x+'" nowrap   align="left">');
    document.writeln ('<a id="mainLink'+x+'" href="'+Menu[x][1]+'" target="'+Menu[x][2]+'" class="rcMenuStatic">'+Menu[x][0]+'</a></td>');
    if (1 == 1&&subMenu[x].length>=1){
      document.writeln('<td class="rcMenuStatic" id="cell'+x+'a" align="right" >');
      document.writeln ('<a id="mainLink'+x+'a" href="'+Menu[x][1]+'" target="'+Menu[x][2]+'" class="rcMenuStatic">'+"<img src='images/arrow-right.gif'  width='5'  height='5' border='0'>"+'</a></td>');}
    document.writeln ('</tr></table></div></td>');    
    if ("vertical".toLowerCase()=="vertical") document.writeln('</tr>')
  }
  if ("vertical".toLowerCase() == "vertical"){document.writeln ('</table>');}
  else{document.writeln ('</tr></table>');}   
}  

  for (x=0; x<Menu.length; x++)
  { 
    if (subMenu[x].length > 0)
    {     
      document.writeln ('<div id="MENU'+x+'" style="visibility:hidden; position:absolute; z-index:2" >');
      document.writeln ('<table border="0" cellpadding="'+3+'" cellspacing="'+styleBorder+'" bgColor="'+"#A6A684"+'" width="140">');   
      for (y=0; y<subMenu[x].length; y++)
      {
        document.writeln ('<tr><td id="subMenu'+x+y+'" class="rcSubMenuStatic" onMouseOver="hoverMenu(); highlightMenu(\'sub\','+x+','+y+')" onMouseOut="clearMenu('+x+');" onclick="tdMouseClick(\'subLink'+x+y+'\')" nowrap')
        if ("3d".toLowerCase() == "3d"){document.writeln ('style="border-left:'+1+'px solid '+"#E9E9E2"+';border-top:'+1+'px solid '+"#E9E9E2"+';border-right:'+1+'px solid '+"#83837C"+';border-bottom:'+1+'px solid '+"#83837C"+';"');}
        document.writeln (' ><a id="subLink'+x+y+'" href="'+subMenu[x][y][1]+'" target="'+subMenu[x][y][2]+'">'+subMenu[x][y][0]+'</a></td></tr>');
      }
      document.writeln ('</table></div>');
    }
  }
 
function highlightMenu(element,mainMenu,dropMenu,state)
{
  state=(state == "hover")?"rcMenuHover":"rcMenuStatic"
  if (element == "sub")
  {
    for (x=0; x < subMenu[mainMenu].length; x++)
    {
      eval(obj+'("subMenu'+mainMenu+x+'").className = "rcSubMenuStatic"')
      eval(obj+'("subLink'+mainMenu+x+'").className = "rcSubMenuStatic"')
    }   
    eval(obj+'("subMenu'+mainMenu+dropMenu+'").className="rcSubMenuHover"')
    eval(obj+'("subLink'+mainMenu+dropMenu+'").className="rcSubMenuHover"')
  }
  else
  {
    eval(obj+'("cell'+mainMenu+'").className = "'+state+'"')
    eval(obj+'("mainLink'+mainMenu+'").className = "'+state+'"')
    if (1 == 1&&subMenu[mainMenu].length>=1)
    {
      eval(obj+'("cell'+mainMenu+'a").className = "'+state+'"')
      eval(obj+'("mainLink'+mainMenu+'a").className = "'+state+'"')
    }
  }
}

function getOffset(obj, dim) 
{
  if(dim=="left") 
  {     
    oLeft = obj.offsetLeft;    
    while(obj.offsetParent!=null) 
    {    
      oParent = obj.offsetParent     
      oLeft += oParent.offsetLeft 
      obj = oParent 	
    }


    return oLeft
  }
  else if(dim=="top")

  {
    oTop = obj.offsetTop;
    while(obj.offsetParent!=null) 
    {
      oParent = obj.offsetParent
      oTop += oParent.offsetTop
      obj = oParent 	
    }
    return oTop
  }
  else if(dim=="width")
  {
    oWidth = obj.offsetWidth


    return oWidth
  }  
  else if(dim=="height")
  {
    oHeight = obj.offsetHeight
    return oHeight
  }    
  else
  {
    alert("Error: invalid offset dimension '" + dim + "' in getOffset()")
    return false;
  }
}

function popDown(param, id)
{
  var cellBorderOffset = (isNS6)?1:eval(1*2)
  var browserAdjustment = (isNS6)?1:0
  var menu;
  var button;

  if (id)
  {    
    getOffset(eval(obj+'(id)'),'left');
    getOffset(eval(obj+'(id)'),'top');    
    getOffset(eval(obj+'(id)'),'width');  
    getOffset(eval(obj+'(id)'),'height');
  }  
  n = 0;    
  while (n < Menu.length)
  {          
    menu = "MENU"+n
    if (param == n)
    {
      theObj = eval(obj+'(menu)');
      if (theObj)
      {
         theObj.style.visibility = "visible"

          if ("vertical".toLowerCase()=="vertical"){
            theObj.style.left=("3d".toLowerCase()=="flat")?oLeft+oWidth+1+0:oLeft+oWidth+cellBorderOffset+0;
            theObj.style.top=("3d".toLowerCase()=="flat")?oTop-1+0:oTop+0-browserAdjustment}
          else{
            theObj.style.left=("3d".toLowerCase()=="flat")?oLeft-1+0:oLeft+0-browserAdjustment;
            theObj.style.top=("3d".toLowerCase()=="flat")?oTop+oHeight+1+0:oTop+oHeight+cellBorderOffset+0;}
        }
      
       highlightMenu('main',n,'','hover')
       if (subMenu[param].length > 0)
       {
         for (x=0; x<subMenu[param].length; x++)
         {
           eval (obj+'("subMenu'+param+x+'").className = "rcSubMenuStatic"')
           eval (obj+'("subLink'+param+x+'").className = "rcSubMenuStatic"')         
         }
       }
    }
    else 
    {          
      if (eval(obj+'(menu)'))
      {
        eval(obj+'(menu).style.visibility = "hidden"')            
      }
      highlightMenu ('main',n,'','static')


    }
    n++
  }  
}

function hoverMenu()
{
  if(timer)
  clearTimeout(timer)
}

function clearMenu(menu)
{
  setDelay = 2*1000
  delay = (subMenu[menu].length > 0)?setDelay:1
  
  timer = setTimeout("popDown("+(Menu.length + 1)+")",delay)
}

function tdMouseClick(theElement)
{
  eval(obj+'(theElement).click()')
}
//-->