var winModalWindow;

function IgnoreEvents(e)
{
        return false;
}

function ShowWindow(mylink, btntext, lbltext, x, y)
{

    if(document.all)
    {
        param = "?btn=" + btntext + "&lbl=" + lbltext;
        if (window.showModalDialog)
        {
                window.showModalDialog(mylink + param,null,
                        "dialogWidth="+ x +"px;dialogHeight="+ y +"px;status:no;");
        }
        else
        {
                window.top.captureEvents(Event.CLICK|Event.FOCUS);
                window.top.onclick=IgnoreEvents;
                window.top.onfocus=HandleFocus;
                winModalWindow = window.open(mylink + param,"ModalChild",
                        "dependent=yes,width="+x+",height="+y);
                winModalWindow.focus();
        }
    }
    else
    {
        wnd = window.open(mylink+param,"","width=" + x + ", height=" + y + ", toolbar=no, menubar=no,scrollbars=no,resizable=no,location=center, directories=no,status=yes");
        wnd.moveTo(screen.availWidth/2-width/2,screen.availHeight/2-height/2);
        wnd.focus();
    }
}

function ShowSignUpError(mylink, btntext, lbltext, x, y)
{
    param = "?btn=" + btntext + "&lbl=" + lbltext;
    window.open(mylink+param,"","width=" + x + ", height=" + y + ", toolbar=no, menubar=no,scrollbars=no,resizable=yes,location=center, directories=no,status=yes");
}

function HandleFocus()
{
        if (winModalWindow)
        {
                if (!winModalWindow.closed)
                {
                        winModalWindow.focus()
                }
                else
                {
                        window.top.releaseEvents(Event.CLICK|Event.FOCUS)
                        window.top.onclick="";
                }
        }
       
        return false
}