function flashimage()
{   
	var s1 = setTimeout("FadeInImage('blendimage','images/banner1.jpg','blenddiv');",500);
	var s2 = setTimeout("FadeInImage('blendimage','images/banner2.jpg','blenddiv');",2000);
	var s3 = setTimeout("FadeInImage('blendimage','images/banner3.jpg','blenddiv');",3500);
	var s4 = setTimeout("FadeInImage('blendimage','images/banner4.jpg','blenddiv');",5000);
	var s5 = setTimeout("flashimage2();",6500);	
}

function flashimage2()
{
	var s1 = setTimeout("FadeInImage('blendimage','images/banner5.jpg','blenddiv');",1500);
	var s2 = setTimeout("FadeInImage('blendimage','images/banner6.jpg','blenddiv');",2000);
	var s3 = setTimeout("FadeInImage('blendimage','images/banner7.jpg','blenddiv');",3500);
	var s4 = setTimeout("FadeInImage('blendimage','images/banner8.jpg','blenddiv');",5000);	
	var s5 = setTimeout("FadeInImage('blendimage','images/banner9.jpg','blenddiv');",7500);	
	var s6 = setTimeout("flashimage2();",9000);
}


function SetOpacity(object,opacityPct)
{
  // IE.
  object.style.filter = 'alpha(opacity=' + opacityPct + ')';
  // Old mozilla and firefox
  object.style.MozOpacity = opacityPct/100;
  // Everything else.
  object.style.opacity = opacityPct/100;
}
function ChangeOpacity(id,msDuration,msStart,fromO,toO)
{
  var element=document.getElementById(id);
  var opacity = element.style.opacity * 100;
  var msNow = (new Date()).getTime();
  opacity = fromO + (toO - fromO) * (msNow - msStart) / msDuration;
  if (opacity<0) 
    SetOpacity(element,0)
  else if (opacity>100)
    SetOpacity(element,100)
  else
  {
    SetOpacity(element,opacity);
    element.timer = window.setTimeout("ChangeOpacity('" + id + "'," + msDuration + "," + msStart + "," + fromO + "," + toO + ")",1);
  }
}
function FadeIn(id)
{
  var element=document.getElementById(id);
  if (element.timer) window.clearTimeout(element.timer); 
  var startMS = (new Date()).getTime();
  element.timer = window.setTimeout("ChangeOpacity('" + id + "',1000," + startMS + ",0,100)",1);
}
function FadeOut(id)
{
  var element=document.getElementById(id);
  if (element.timer) window.clearTimeout(element.timer); 
  var startMS = (new Date()).getTime();
  element.timer = window.setTimeout("ChangeOpacity('" + id + "',1000," + startMS + ",100,0)",1);
}
function FadeInImage(foregroundID,newImage,backgroundID)
{
  var foreground=document.getElementById(foregroundID);
  if (backgroundID)
  {
    var background=document.getElementById(backgroundID);
    if (background)
    {
      background.style.backgroundImage = 'url(' + foreground.src + ')';
      //background.style.backgroundRepeat = 'no-repeat';
    }
  }
  SetOpacity(foreground,0);
  foreground.src = newImage;
  if (foreground.timer) window.clearTimeout(foreground.timer); 
  var startMS = (new Date()).getTime();
  foreground.timer = window.setTimeout("ChangeOpacity('" + foregroundID + "',1000," + startMS + ",0,100)",10);
}

    
function addElement(divholder)
{

try
{

  //var body = document.getElementsByTagName("body")[0];
  //var TDM = document.getElementById("TDMenu");
  var MDIV = document.getElementById(divholder);
  
        // creates a <table> element and a <tbody> element
        var tbl     = document.createElement("table");
        var tblBody = document.createElement("tbody");

        // creating all cells
       
            // creates a table row
            var row = document.createElement("tr");
                 
                var cell1 = document.createElement("td");
                var cell2 = document.createElement("td");
                var cell3 = document.createElement("td");
                var cell4 = document.createElement("td");
                var cell5 = document.createElement("td");
                var cell6 = document.createElement("td");
                var cell7 = document.createElement("td");
                var cell8 = document.createElement("td");
                          
                cell1.setAttribute("id","cellitem");
                cell2.setAttribute("id","cellitem");
                cell3.setAttribute("id","cellitem");
                cell4.setAttribute("id","cellitem");
                cell5.setAttribute("id","cellitem");
                
                cell6.setAttribute("id","cellitem");
                cell8.setAttribute("id","cellitem");
                
                var div1 = document.createElement("div");           
                var div2 = document.createElement("div"); 
                var div3 = document.createElement("div"); 
                var div4 = document.createElement("div"); 
                var div5 = document.createElement("div"); 
                var div6 = document.createElement("div"); 
                var div7 = document.createElement("div"); 
                var div8 = document.createElement("div"); 
               
                div1.setAttribute("id","menuitem");
                div2.setAttribute("id","menuitem");
                div3.setAttribute("id","sample_attach_menu_parent");
                div4.setAttribute("id","menuitem");
                div5.setAttribute("id","member_attach_menu_parent");
                div6.setAttribute("id","loc_attach_menu_parent");
                div7.setAttribute("id","menuitem");
                div8.setAttribute("id","contact_attach_menu_parent");
                
                
                var menu1 = document.createElement("a");
                menu1.setAttribute("id","menuitems");
                menu1.setAttribute("href","http://www.donerailegolfclub.com/index.htm");
                var menuText1 = document.createTextNode("Home");
                menu1.appendChild(menuText1);
                
                var menu2 = document.createElement("a");
                menu2.setAttribute("id","menuitems");
                menu2.setAttribute("href","http://www.donerailegolfclub.com/gallery.htm");
                var menuText2 = document.createTextNode("Photo Gallery");
                menu2.appendChild(menuText2);     
                
                var menu3 = document.createElement("a");
                menu3.setAttribute("id","menuitems");
                menu3.setAttribute("href","");
                var menuText3 = document.createTextNode("Visitors");
                menu3.appendChild(menuText3);
                
                        var submenu1 = document.createElement("div");
                        submenu1.setAttribute("id","sample_attach_menu_child");
                    
                        var subdiv1 = document.createElement("div");
                        subdiv1.setAttribute("id", "SubMenuItem");
                    
                        var link1 = document.createElement("a");
                        link1.setAttribute("id", "MenuLinks");
                        link1.setAttribute("href","http://www.donerailegolfclub.com/membership.htm");
                        var link1text = document.createTextNode("Become a Member");                   
                        link1.appendChild(link1text);
                        subdiv1.appendChild(link1);
                         
                        var subdiv2 = document.createElement("div");
                        subdiv2.setAttribute("id", "SubMenuItem");
                    
                        var link2 = document.createElement("a");
                        link2.setAttribute("id", "MenuLinks");
                        link2.setAttribute("href","http://www.donerailegolfclub.com/greenfees.htm");
                        var link2text = document.createTextNode("Green Fees");                   
                        link2.appendChild(link2text);
                        subdiv2.appendChild(link2);
                    
                        var subdiv3 = document.createElement("div");
                        subdiv3.setAttribute("id", "SubMenuItem");
                    
                        var link3 = document.createElement("a");
                        link3.setAttribute("id", "MenuLinks");
                        link3.setAttribute("href","http://www.donerailegolfclub.com/courseguide.htm");
                        var link3text = document.createTextNode("Course Guide");                   
                        link3.appendChild(link3text);
                        subdiv3.appendChild(link3);
                    
                        var subdiv4 = document.createElement("div");
                        subdiv4.setAttribute("id", "SubMenuItem");
                    
                        var link4 = document.createElement("a");
                        link4.setAttribute("id", "MenuLinks");
                        link4.setAttribute("href","http://www.donerailegolfclub.com/openfixtures.aspx");
                        var link4text = document.createTextNode("Open Fixtures");                   
                        link4.appendChild(link4text);
                        subdiv4.appendChild(link4);
                        
                        var subdiv5 = document.createElement("div");
                        subdiv5.setAttribute("id", "SubMenuItem");
                    
                        var link5 = document.createElement("a");
                        link5.setAttribute("id", "MenuLinks");
                        link5.setAttribute("href","index.htm");
                        var link5text = document.createTextNode("Wood");                   
                        link5.appendChild(link5text);
                        subdiv5.appendChild(link5);
                        
                        submenu1.appendChild(subdiv1);
                        submenu1.appendChild(subdiv2);
                        submenu1.appendChild(subdiv3);
                        submenu1.appendChild(subdiv4);
                        //submenu1.appendChild(subdiv5);
                     
                var menu4 = document.createElement("a");
                menu4.setAttribute("id","menuitems");
                menu4.setAttribute("href","http://www.donerailegolfclub.com/noticeboard.aspx");
                var menuText4 = document.createTextNode("Noticeboard");
                menu4.appendChild(menuText3);
                
                var menu5 = document.createElement("a");
                menu5.setAttribute("id","menuitems");
                menu5.setAttribute("href","");
                var menuText5 = document.createTextNode("Members");
                
                        var membermenu = document.createElement("div");
                        membermenu.setAttribute("id","member_attach_menu_child");
                        
                        var memberdiv1 = document.createElement("div");
                        memberdiv1.setAttribute("id", "SubMenuItem");
                    
                        var memberlink1 = document.createElement("a");
                        memberlink1.setAttribute("id", "MenuLinks");
                        memberlink1.setAttribute("href","http://www.donerailegolfclub.com/gentsfixtures.aspx");
                        var memberlink1text = document.createTextNode("Gents Fixtures");                   
                        memberlink1.appendChild(memberlink1text);
                        memberdiv1.appendChild(memberlink1);
                        
                        var memberdiv2 = document.createElement("div");
                        memberdiv2.setAttribute("id", "SubMenuItem");
                    
                        var memberlink2 = document.createElement("a");
                        memberlink2.setAttribute("id", "MenuLinks");
                        memberlink2.setAttribute("href","http://www.donerailegolfclub.com/ladiesfixtures.aspx");
                        var memberlink2text = document.createTextNode("Ladies Fixtures");                   
                        memberlink2.appendChild(memberlink2text);
                        memberdiv2.appendChild(memberlink2);
                        
                        var memberdiv3 = document.createElement("div");
                        memberdiv3.setAttribute("id", "SubMenuItem");
                    
                        var memberlink3 = document.createElement("a");
                        memberlink3.setAttribute("id", "MenuLinks");
                        memberlink3.setAttribute("href","http://www.donerailegolfclub.com/resultspage.aspx");
                        var memberlink3text = document.createTextNode("Gents Results");                   
                        memberlink3.appendChild(memberlink3text);
                        memberdiv3.appendChild(memberlink3);
                        
                        var memberdiv4 = document.createElement("div");
                        memberdiv4.setAttribute("id", "SubMenuItem");
                    
                        var memberlink4 = document.createElement("a");
                        memberlink4.setAttribute("id", "MenuLinks");
                        memberlink4.setAttribute("href","http://www.donerailegolfclub.com/juvenile.htm");
                        var memberlink4text = document.createTextNode("Juvenile Golf");                   
                        memberlink4.appendChild(memberlink4text);
                        memberdiv4.appendChild(memberlink4);
                        
                        var memberdiv5 = document.createElement("div");
                        memberdiv5.setAttribute("id", "SubMenuItem");
                    
                        var memberlink5 = document.createElement("a");
                        memberlink5.setAttribute("id", "MenuLinks");
                        memberlink5.setAttribute("href","http://www.donerailegolfclub.com/weatherforecast.htm");
                        var memberlink5text = document.createTextNode("Weather Forecast");                   
                        memberlink5.appendChild(memberlink5text);
                        memberdiv5.appendChild(memberlink5);
                        
                        var memberdiv6 = document.createElement("div");
                        memberdiv6.setAttribute("id", "SubMenuItem");
                    
                        var memberlink6 = document.createElement("a");
                        memberlink6.setAttribute("id", "MenuLinks");
                        memberlink6.setAttribute("href","http://www.donerailegolfclub.com/existingmembership.htm");
                        var memberlink6text = document.createTextNode("Membership Fees");                   
                        memberlink6.appendChild(memberlink6text);
                        memberdiv6.appendChild(memberlink6);
                        
                        var memberdiv7 = document.createElement("div");
                        memberdiv7.setAttribute("id", "SubMenuItem");
                    
                        var memberlink7 = document.createElement("a");
                        memberlink7.setAttribute("id", "MenuLinks");
                        memberlink7.setAttribute("href","http://www.donerailegolfclub.com/handicaps.htm");
                        var memberlink7text = document.createTextNode("Handicaps");                   
                        memberlink7.appendChild(memberlink7text);
                        memberdiv7.appendChild(memberlink7);
                        
                        var memberdiv8 = document.createElement("div");
                        memberdiv8.setAttribute("id", "SubMenuItem");
                    
                        var memberlink8 = document.createElement("a");
                        memberlink8.setAttribute("id", "MenuLinks");
                        memberlink8.setAttribute("href","http://www.donerailegolfclub.com/ladiesresults.aspx");
                        var memberlink8text = document.createTextNode("Ladies Results");                   
                        memberlink8.appendChild(memberlink8text);
                        memberdiv8.appendChild(memberlink8);
                        
                        membermenu.appendChild(memberdiv1);
                        membermenu.appendChild(memberdiv2);
                        membermenu.appendChild(memberdiv3);
                        membermenu.appendChild(memberdiv8);
                        membermenu.appendChild(memberdiv4);
                        membermenu.appendChild(memberdiv5);
                        membermenu.appendChild(memberdiv6);
                        membermenu.appendChild(memberdiv7);
                
                var menu6 = document.createElement("a");
                menu6.setAttribute("id","menuitems");
                menu6.setAttribute("href","");
                var menuText6 = document.createTextNode("Location");
                
                        var locsubmenu = document.createElement("div");
                        locsubmenu.setAttribute("id","loc_attach_menu_child");
                        
                        var loc1 = document.createElement("div");
                        loc1.setAttribute("id", "SubMenuItem");
                    
                        var loclink1 = document.createElement("a");
                        loclink1.setAttribute("id", "MenuLinks");
                        loclink1.setAttribute("href","http://www.donerailegolfclub.com/location.htm");
                        var loclink1text = document.createTextNode("Locate Us");                   
                        loclink1.appendChild(loclink1text);
                        loc1.appendChild(loclink1);
                         
                        var loc2 = document.createElement("div");
                        loc2.setAttribute("id", "SubMenuItem");
                    
                        var loclink2 = document.createElement("a");
                        loclink2.setAttribute("id", "MenuLinks");
                        loclink2.setAttribute("href","http://www.donerailegolfclub.com/bar.htm");
                        var loclink2text = document.createTextNode("Bar & Clubhouse");                   
                        loclink2.appendChild(loclink2text);
                        loc2.appendChild(loclink2);
                        
                        locsubmenu.appendChild(loc1);
                        locsubmenu.appendChild(loc2);
                
                var menu7 = document.createElement("a");
                menu7.setAttribute("id","menuitems");
                menu7.setAttribute("href","http://www.donerailegolfclub.com/contactpage.aspx");
                var menuText7 = document.createTextNode("Contact Us");
                
                var menu8 = document.createElement("a");
                menu8.setAttribute("id","menuitems");
                menu8.setAttribute("href","");
                var menuText8 = document.createTextNode("About Us");
                
                        var contactsubmenu = document.createElement("div");
                        contactsubmenu.setAttribute("id","contact_attach_menu_child");
                        
                        var contact1 = document.createElement("div");
                        contact1.setAttribute("id", "SubMenuItem");
                    
                        var contactlink1 = document.createElement("a");
                        contactlink1.setAttribute("id", "MenuLinks");
                        contactlink1.setAttribute("href","http://www.donerailegolfclub.com/history.htm");
                        var contactlink1text = document.createTextNode("Course History");                   
                        contactlink1.appendChild(contactlink1text);
                        contact1.appendChild(contactlink1);
                         
                        var contact2 = document.createElement("div");
                        contact2.setAttribute("id", "SubMenuItem");
                    
                        var contactlink2 = document.createElement("a");
                        contactlink2.setAttribute("id", "MenuLinks");
                        contactlink2.setAttribute("href","http://www.donerailegolfclub.com/committee.htm");
                        var contactlink2text = document.createTextNode("Mgmt Committee");                   
                        contactlink2.appendChild(contactlink2text);
                        contact2.appendChild(contactlink2);
                        
                        contactsubmenu.appendChild(contact1);
                        contactsubmenu.appendChild(contact2);
                          
                menu1.appendChild(menuText1);
                menu2.appendChild(menuText2);
                menu3.appendChild(menuText3);
                menu4.appendChild(menuText4);
                menu5.appendChild(menuText5);
                menu6.appendChild(menuText6);
                menu7.appendChild(menuText7);
                menu8.appendChild(menuText8);
               
                div1.appendChild(menu1);
                div2.appendChild(menu2);
                div3.appendChild(menu3);
                div4.appendChild(menu4);
                div5.appendChild(menu5);
                div6.appendChild(menu6);
                div7.appendChild(menu7);
                div8.appendChild(menu8);
                
                cell1.appendChild(div1);
                cell2.appendChild(div2);              
                cell3.appendChild(div3);
                cell3.appendChild(submenu1);
                cell4.appendChild(div4);
                cell5.appendChild(div5);
                cell5.appendChild(membermenu);
                cell6.appendChild(div6);
                cell6.appendChild(locsubmenu);
                cell7.appendChild(div7);
                cell8.appendChild(div8);
                cell8.appendChild(contactsubmenu);
                    
                
                row.appendChild(cell1);
                row.appendChild(cell5);
                row.appendChild(cell4);
                row.appendChild(cell2);
                row.appendChild(cell3);
                row.appendChild(cell6);
                row.appendChild(cell8);
                row.appendChild(cell7);
               
            

            // add the row to the end of the table body
            tblBody.appendChild(row);
        tbl.appendChild(tblBody);
        //TDM.appendChild(tbl);
        MDIV.appendChild(tbl);
        
        //body.appendChild(tbl);
        tbl.setAttribute("id","Menu");
        
        loc_as_attach("hover", "y", "pointer"); 
        contact_as_attach("hover", "y", "pointer");     
        as_attach("hover", "y", "pointer");
        member_as_attach("hover", "y", "pointer"); 
        
        
}
        
        catch(err)
        {
            var txt="There was an error on this page.\n\n";
            txt+="Error description: " + err.description + "\n\n";
            txt+="Click OK to continue.\n\n";
            alert(txt);
        }
}

function at_show_aux(parent, child)
{
    try
    {
        var p = document.getElementById("sample_attach_menu_parent");  
        var c = document.getElementById("sample_attach_menu_child");  

        var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
        var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

        for (; p; p = p.offsetParent)
        {
            top  += p.offsetTop;
            left += p.offsetLeft;
        }
        
        c.style.position   = "absolute";
        c.style.top        = top +'px';
        c.style.left       = left+'px';
        c.style.visibility = "visible";
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function at_show()
{
    try
    {

    var p = document.getElementById("sample_attach_menu_parent");  
    var c = document.getElementById("sample_attach_menu_child");  

    at_show_aux(p.id, c.id);
    clearTimeout(c["at_timeout"]);
    }
    
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

// ***** at_hide *****

function at_hide()
{
    try
    {
        var p = document.getElementById("sample_attach_menu_parent");  
        var c = document.getElementById("sample_attach_menu_child");        
  
        c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function at_click()
{
    try
    {
        var p = document.getElementById("sample_attach_menu_parent");  
        var c = document.getElementById("sample_attach_menu_child");  
  
        if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden";
        return false;
    }
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function as_attach(showtype, position, cursor)
{
    try
    {
        var p = document.getElementById("sample_attach_menu_parent");
        var c = document.getElementById("sample_attach_menu_child");
       
        
        p["at_parent"]     = p.id;
        c["at_parent"]     = p.id;
        p["at_child"]      = c.id;
        c["at_child"]      = c.id;
        p["at_position"]   = position;
        c["at_position"]   = position;

        c.style.position   = "absolute";
        c.style.visibility = "hidden";
       

        if (cursor != undefined) p.style.cursor = cursor;

        switch (showtype)
        {
            case "click":
            p.onclick     = at_click;
            p.onmouseout  = at_hide;
            c.onmouseover = at_show;
            c.onmouseout  = at_hide;
                break;
            case "hover":
            p.onmouseover = at_show;
            p.onmouseout  = at_hide;
            c.onmouseover = at_show;
            c.onmouseout  = at_hide;
        break;
        }
}
catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}






//Contact Details

function contact_at_show_aux(parent, child)
{
    try
    {
        var p = document.getElementById("contact_attach_menu_parent");  
        var c = document.getElementById("contact_attach_menu_child");  

        var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
        var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

        for (; p; p = p.offsetParent)
        {
            top  += p.offsetTop;
            left += p.offsetLeft;
        }
        
        c.style.position   = "absolute";
        c.style.top        = top +'px';
        c.style.left       = left+'px';
        c.style.visibility = "visible";
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function contact_at_show()
{
    try
    {

    var p = document.getElementById("contact_attach_menu_parent");  
    var c = document.getElementById("contact_attach_menu_child");  

    contact_at_show_aux(p.id, c.id);
    clearTimeout(c["at_timeout"]);
    }
    
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

// ***** at_hide *****

function contact_at_hide()
{
    try
    {
        var p = document.getElementById("contact_attach_menu_parent");  
        var c = document.getElementById("contact_attach_menu_child");        
  
        c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function contact_at_click()
{
    try
    {
        var p = document.getElementById("contact_attach_menu_parent");  
        var c = document.getElementById("contact_attach_menu_child");  
  
        if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden";
        return false;
    }
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function contact_as_attach(showtype, position, cursor)
{
    try
    {
        var p = document.getElementById("contact_attach_menu_parent");
        var c = document.getElementById("contact_attach_menu_child");
       
        
        p["at_parent"]     = p.id;
        c["at_parent"]     = p.id;
        p["at_child"]      = c.id;
        c["at_child"]      = c.id;
        p["at_position"]   = position;
        c["at_position"]   = position;

        c.style.position   = "absolute";
        c.style.visibility = "hidden";
       

        if (cursor != undefined) p.style.cursor = cursor;

        switch (showtype)
        {
            case "click":
            p.onclick     = contact_at_click;
            p.onmouseout  = contact_at_hide;
            c.onmouseover = contact_at_show;
            c.onmouseout  = contact_at_hide;
                break;
            case "hover":
            p.onmouseover = contact_at_show;
            p.onmouseout  = contact_at_hide;
            c.onmouseover = contact_at_show;
            c.onmouseout  = contact_at_hide;
        break;
        }
}
catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}


//Member Details

function member_at_show_aux(parent, child)
{
    try
    {
        var p = document.getElementById("member_attach_menu_parent");  
        var c = document.getElementById("member_attach_menu_child");  

        var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
        var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

        for (; p; p = p.offsetParent)
        {
            top  += p.offsetTop;
            left += p.offsetLeft;
        }
        
        c.style.position   = "absolute";
        c.style.top        = top +'px';
        c.style.left       = left+'px';
        c.style.visibility = "visible";
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function member_at_show()
{
    try
    {

    var p = document.getElementById("member_attach_menu_parent");  
    var c = document.getElementById("member_attach_menu_child");  

    member_at_show_aux(p.id, c.id);
    clearTimeout(c["at_timeout"]);
    }
    
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

// ***** at_hide *****

function member_at_hide()
{
    try
    {
        var p = document.getElementById("member_attach_menu_parent");  
        var c = document.getElementById("member_attach_menu_child");        
  
        c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function member_at_click()
{
    try
    {
        var p = document.getElementById("member_attach_menu_parent");  
        var c = document.getElementById("member_attach_menu_child");  
  
        if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden";
        return false;
    }
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function member_as_attach(showtype, position, cursor)
{
    try
    {
        var p = document.getElementById("member_attach_menu_parent");
        var c = document.getElementById("member_attach_menu_child");
       
        
        p["at_parent"]     = p.id;
        c["at_parent"]     = p.id;
        p["at_child"]      = c.id;
        c["at_child"]      = c.id;
        p["at_position"]   = position;
        c["at_position"]   = position;

        c.style.position   = "absolute";
        c.style.visibility = "hidden";
       

        if (cursor != undefined) p.style.cursor = cursor;

        switch (showtype)
        {
            case "click":
            p.onclick     = member_at_click;
            p.onmouseout  = member_at_hide;
            c.onmouseover = member_at_show;
            c.onmouseout  = member_at_hide;
                break;
            case "hover":
            p.onmouseover = member_at_show;
            p.onmouseout  = member_at_hide;
            c.onmouseover = member_at_show;
            c.onmouseout  = member_at_hide;
        break;
        }
}
catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

//Location
function loc_at_show_aux(parent, child)
{
    try
    {
        var p = document.getElementById("loc_attach_menu_parent");  
        var c = document.getElementById("loc_attach_menu_child");  

        var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
        var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

        for (; p; p = p.offsetParent)
        {
            top  += p.offsetTop;
            left += p.offsetLeft;
        }
        
        c.style.position   = "absolute";
        c.style.top        = top +'px';
        c.style.left       = left+'px';
        c.style.visibility = "visible";
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function loc_at_show_aux(parent, child)
{
    try
    {
        var p = document.getElementById("loc_attach_menu_parent");  
        var c = document.getElementById("loc_attach_menu_child");  

        var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
        var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

        for (; p; p = p.offsetParent)
        {
            top  += p.offsetTop;
            left += p.offsetLeft;
        }
        
        c.style.position   = "absolute";
        c.style.top        = top +'px';
        c.style.left       = left+'px';
        c.style.visibility = "visible";
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function loc_at_show()
{
    try
    {

    var p = document.getElementById("loc_attach_menu_parent");  
    var c = document.getElementById("loc_attach_menu_child");  

    loc_at_show_aux(p.id, c.id);
    clearTimeout(c["at_timeout"]);
    }
    
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

// ***** at_hide *****

function loc_at_hide()
{
    try
    {
        var p = document.getElementById("loc_attach_menu_parent");  
        var c = document.getElementById("loc_attach_menu_child");        
  
        c["at_timeout"] = setTimeout("document.getElementById('"+c.id+"').style.visibility = 'hidden'", 333);
    }

    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function loc_at_click()
{
    try
    {
        var p = document.getElementById("loc_attach_menu_parent");  
        var c = document.getElementById("loc_attach_menu_child");  
  
        if (c.style.visibility != "visible") at_show_aux(p.id, c.id); else c.style.visibility = "hidden";
        return false;
    }
    catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}

function loc_as_attach(showtype, position, cursor)
{
    try
    {
        var p = document.getElementById("loc_attach_menu_parent");
        var c = document.getElementById("loc_attach_menu_child");
       
        
        p["at_parent"]     = p.id;
        c["at_parent"]     = p.id;
        p["at_child"]      = c.id;
        c["at_child"]      = c.id;
        p["at_position"]   = position;
        c["at_position"]   = position;

        c.style.position   = "absolute";
        c.style.visibility = "hidden";
       

        if (cursor != undefined) p.style.cursor = cursor;

        switch (showtype)
        {
            case "click":
            p.onclick     = loc_at_click;
            p.onmouseout  = loc_at_hide;
            c.onmouseover = loc_at_show;
            c.onmouseout  = loc_at_hide;
                break;
            case "hover":
            p.onmouseover = loc_at_show;
            p.onmouseout  = loc_at_hide;
            c.onmouseover = loc_at_show;
            c.onmouseout  = loc_at_hide;
        break;
        }
}
catch(err)
    {
        var txt="There was an error on this page.\n\n";
        txt+="Error description: " + err.description + "\n\n";
        txt+="Click OK to continue.\n\n";
        alert(txt);
    }
}
