aMenu = new Array('cat000','cat000002','cat00000f','cat000007','cat000000','cat000008','cat000088');
/*
popup for terms & condtions and privacy policy etc...
*/
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=600,left = 340,top = 212');");
}
/*
popup for signupform
*/
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=700,height=500,left = 290,top = 262');");
}
/*
popup for homepage
*/
function popUpWeb1(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=568,height=288,left = 440,top = 262');");
}
/*
Functions to make drop-down menu appear and disappear
*/
function toggleMenu(menuname,menustate,originObj)
{
    if (1)
    {

        //remove all spaces from menuItem names (underscores not acceptable in netscape)
        menuname = menuname.replace(/ /g,'');
        //replace all ampersands with 'and'
        menuname = menuname.replace(/&/g,'and');
        //all to lowercase
        menuname = menuname.toLowerCase();

        //loop through array of menus and hide all except current
        for (i = 0;i < aMenu.length; i++)
        {
             tempMenuname = aMenu[i];
             if ((tempMenuname != menuname)&&(document.all[tempMenuname].style.visibility == 'visible'))
             {
                  document.all[tempMenuname].style.visibility = 'hidden';
             }
        }

        if (menustate == 'visible')
        {
            //if cursor is over link set menu to disappear after delay of 1 second
            if (originObj.tagName == 'TD')
            {
                //calculate position of link
                aPosition = calculatePosition (originObj);

                //place menu adjacent to appropriate link
                document.all[menuname].style.left = aPosition[0];
                document.all[menuname].style.top = aPosition[1]+18;
                //window.timerId = window.setTimeout("alterState('" + menuname + "','hidden')", 1000);
            }
            else
            {
                //alert ('over menu');
                //if cursor is over menu, cancel timeout
                window.clearTimeout(window.timerId);
            }

            document.all[menuname].style.visibility = menustate;
        }
        else
        {
            // upon leaving link or menu set menu to disappear after delay of 1 second
            window.clearTimeout(window.timerId);
            window.timerId = window.setTimeout("alterState('" + menuname + "','hidden')", 2000);
        }

    }
}

function calculatePosition (obj)
{
     var myx = 0;
     var myy = 0;
     //loop out
     while(obj != document.body)
     {
        myx += obj.offsetLeft;
        myy += obj.offsetTop;
        obj = obj.offsetParent;
     }
    result = new Array(myx+30,myy);
    return result;
}

function alterState(menuname,menustate)
{
    document.all[menuname].style.visibility = menustate;
}


function new_doc_window(url)
{
   var features = 'toolbar=0,'+
                  'location=0,'+
                  'directories=0,'+
                  'status=0,'+
                  'resizable=1,'+
                  'menubar=0,'+
                  'scrollbars=1,'+
                  'width=560,' +
                  'height=320,' +
                  'top=0,'+
                  'left=0';

   window.open(url,"new_doc_window",features);
}