var menuDropped=null;
var menuTimeOut=null;
var picWidth=155;

function menuGetItem(obj) {
        if (obj.all)                              return obj.all.tags('div')[0];
        if (obj.getElementsByTagName) return obj.getElementsByTagName('div')[0];
}

function menuItemOver(obj) {
        obj=menuGetItem(obj);
        menuCancelTimeOut();
        obj.className="menuItemOver";
       // window.status=obj.title;
}
function menuItemOut(obj) {
        obj=menuGetItem(obj);
        menuPullUpTimeOut();
        obj.className="menuItem";
     //   window.status="";
}
function menuItemClick(obj) {
        obj=menuGetItem(obj);
        menuCancelTimeOut();
        menuPullUp();
        if (obj.href) document.location=obj.href;
        if (obj.getAttribute('href')) document.location=obj.getAttribute('href');
}
function menuDropDown(obj) {
        menuCancelTimeOut();
        obj=menuGetItem(obj);
        if (menuDropped!=obj) menuPullUp();
        obj.style.display="block";
        menuDropped=obj;
}
function menuPullUp() {
        if (menuDropped) menuDropped.style.display="none";
        menuDropped=null;
}
function menuCancelTimeOut() {
        if (menuTimeOut) {
                clearTimeout(menuTimeOut);
                menuTimeOut=null;
        }
}
function menuPullUpTimeOut()
{
        menuCancelTimeOut();
        menuTimeOut=setTimeout("menuPullUp()",300);
}
function menuBar(items) {
        document.write('<div class="menuBar"><table border="0" cellpadding="0" cellspacing="0"><tr>');
        for (var i=0;i<items.length;i++) document.write(items[i]);
        document.write('</tr></table></div><div class="menuBarContainer"></div>');
        document.onclick=menuPullUp;
}
function menuBarItem(nr,img,alt,items) {
        var width=(nr-1)*picWidth;
        var rv='<td><div class="Bar" style="left:'+width+'" onmouseover="menuDropDown(this)" onmouseout="menuPullUpTimeOut()"><img src="../Images/'+img+'" alt="'+alt+'" border="0"><div class="menu1"><table border="0" cellpadding="0" cellspacing="1" width="100%">';
        for (var i=0;i<items.length;i++) rv+=items[i];
        return rv+'</table></div></div></td>';
}
function menuItem(title,href)        {
        return '<tr><td onmouseover="menuItemOver(this)" onmouseout="menuItemOut(this)" onclick="menuItemClick(this)" width="100%"><div class="menuItem" title="'+title+'" href="'+href+'">'+title+'</div></td></tr>';
}

