
                function tq_getlayer(name)
                {
                        if(ie)
                                return document.all[name];
                        else if(ns)
                                return document.layers[name];
                        else if(ns6 || op5)
                                return document.getElementById(name);
                        return -1;
                }
                function tq_windowwidth()
                {
                         if (ns || ns6 || op5)
                            return window.innerWidth;
                          else if (ie)
                                return document.body.clientWidth;
                          return -1;
                }
                function tq_windowheight()
                {
                        if (ns || ns6 || op5)
                            return window.innerHeight;
                          if (ie)
                            return document.body.clientHeight;
                          return -1;
                }
                function tq_scrolly()
                {
                        if (ns || ns6 || op5)
                                   return window.pageYOffset;
                         if (ie)
                            return document.body.scrollTop;
                          return -1;
                }
                function tq_show(name)
                {
                        var layer = tq_getlayer(name);
                        if(ie || ns6)
                                layer.style.visibility = "visible";
                        if(ns)
                                layer.visibility = "show";
                }
                function tq_hide(name)
                {
                        var mylayer = tq_getlayer(name);
                        if(ie || ns6)
                                mylayer.style.visibility = "hidden";
                        if(ns)
                                mylayer.visibility = "hide";
                }
                function tq_moveto(name, left, top)
                {
                        var layer = tq_getlayer(name);
                        if(ie)
                        {
                                layer.style.posLeft = left;
                                layer.style.posTop = top;
                        }
                        else if(ns6)
                        {
                                layer.style.left = left;
                                layer.style.top = top;
                        }
                        else if(ns)
                        {
                                layer.pageX = left;
                                layer.pageY = top;
                        }
                }
                function tq_setcontent(name, content)
                {
                        var c_layer = tq_getlayer(name);
                        if((ie || ns6) && !op5)
                                c_layer.innerHTML = content;
                        else if(ns)
                        {
                                c_layer.document.open();
                                c_layer.document.write(content);
                                c_layer.document.close();
                        }
                }
                function myerrorwindow()
                {
                        this.hide = tq_hide_msg;
                        this.hide2 = tq_hide;
                        this.setcontent = tq_setcontent;
                        this.moveto = tq_moveto;
                        this.show = tq_show_msg;
                        this.show2 = tq_show;
                        this.windowwidth = tq_windowwidth;
                        this.windowheight = tq_windowheight;
                        this.scrolly = tq_scrolly;
                        this.give_error = tq_give_error;
                        this.succes = tq_load_note;
                }
                function tq_hide_msg()
                {
                        if(this.original == "show" || this.original == "visible")
                                this.show2("notepadformlayer");
                        this.hide2("errormsg");
                }
                function tq_show_msg()
                {
                        if(ns)
                                this.original = document.layers['notepadformlayer'].visibility;
                        if(ie)
                                this.original = document.all['notepadformlayer'].style.visibility;
                        if(ns6)
                                this.original = document.getElementById('notepadformlayer').style.visibility;
                        this.hide2("notepadformlayer");
                        this.show2("errormsg");
                }
                function tq_give_error(message, type, action1, action2)
                {
                        var new_cont = ""; // this should be the new content
                        if(!type || type == "succes")
                        {
                                new_cont += "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\"><tr><td bgcolor=\"#000000\" width=\"252\" align=\"center\">";
                                new_cont += "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"250\">";
                                new_cont += "<tr><td bgcolor=\"#ffffff\">";
                                new_cont += message;
                                new_cont += "</td></tr><tr><td bgcolor=\"#ffffff\" align=\"center\">";
                                if(!action1)
                                        new_cont += "<a href=\"javascript: myerror.hide('errormsg');\">Ok</a>";
                                else
                                        new_cont += "<a href=\"javascript: " + action1 + "; myerror.hide('errormsg');\">Ok</a>";
                                new_cont += "</td></tr></table></td></tr></table>";
                        }
                        else
                        {
                                if(type == 1)
                                {
                                        // we are making a confirmation box
                                        new_cont += "<table border=\"0\" cellpadding=\"1\" cellspacing=\"0\"><tr><td bgcolor=\"#0000ff\">";
                                        new_cont += "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\" width=\"250\">";
                                        new_cont += "<tr><td bgcolor=\"#ffffff\" colspan=\"3\">";
                                        new_cont += message;
                                        new_cont += "</td></tr><tr><td bgcolor=\"#ffffff\" align=\"right\" width=\"115\">";
                                        new_cont += "<a href=\"" + action1 + "\">Ja</a>";
                                        new_cont += "</td><td width=\"20\" bgcolor=\"#ffffff\">&nbsp;</td><td bgcolor=\"#ffffff\" width=\"115\">";
                                        new_cont += "<a href=\"" + action2 + "\">Nee</a></td>";
                                        new_cont += "</tr></table></td></tr></table>";
                                }
                        }
                        this.hide();
                        this.setcontent('errormsg', new_cont);
                       // new_left = (this.windowwidth()/2) - 150;
                        new_left = 400;
                        new_top = (this.windowheight()/2) - 50 + this.scrolly();
                        this.moveto('errormsg', new_left, new_top);
                        this.show();
                }
                function submit_my_form(type)
                {
                        if(type == "with")
                        {
                                if(ns)
                                {
                                        document.layers['notepadformlayer'].document.layers['notepadfrom'].document.forms.addnoteform.hid_overwrite.value = true;
                                        document.layers['notepadformlayer'].document.layers['notepadfrom'].document.forms.addnoteform.submit();
                                }
                                else
                                {
                                        document.forms.addnoteform.hid_overwrite.value = true;
                                        document.forms.addnoteform.submit();
                                }
                        }
                        else
                        {
                                if(ns)
                                {
                                        document.layers['notepadformlayer'].document.layers['notepadform'].document.forms.addnoteform.hid_overwrite.value = false;
                                        document.layers['notepadformlayer'].document.layers['notepadform'].document.forms.addnoteform.submit();
                                }
                                else
                                {
                                        document.forms.addnoteform.hid_overwrite.value = false;
                                        document.forms.addnoteform.submit();
                                }
                        }
                }
                myerror = new myerrorwindow();

                function tq_hide_menu(name)
                {
                         top.topframe[name].hide();
                }
                function tq_show_menu(name)
                {
                         top.topframe[name].show();
                }
                function tq_gourl(url, win)
                {
                        if(win)
                                win.document.location = url + "?referer=" + document.location;
                        else
                                document.location = url + "?referer=" + document.location;
                }
                function tq_show_note(id)
                {
                        if(id)
                        {
                                // show note id # id
                        }
                        else
                        {
                                // show blank note form || note form with existing vars
                                new_top = tq_scrolly() + 40;
                                tq_moveto('notepadformlayer', 20, new_top);
                                tq_show('notepadformlayer');
                        }
                }
                function tq_load(id, form, field)
                {
                        if(id)
                        {
                                if(form)
                                {
                                        top.actionframe.location = "/~lla067/php/notepad/loadnote.php?id=" + id + "&form=" + form + "&field=" + field;
                                }
                                else
                                {
                                        top.actionframe.location = "/~lla067/php/notepad/loadnote.php?id=" + id;
                                        // make html
                                        tq_load_note("loading", "loading");
                                }
                        }
                }
                function tq_load_note(title, note, form, field)
                {
                        if(form)
                        {
                                myform = document.forms[form];
                                myform[field].value = myform[field].value + "\n\n" + note;
                        }
                        else
                        {
                                // set html
                                if(ns)
                                        var myform = document.layers.notepadformlayer.document.layers.notepadform.document.forms.addnoteform;
                                else
                                        var myform = document.forms.addnoteform
                                myform.name.value = title;
                                myform.note.value = note;
                                tq_show('notepadformlayer');
                        }

                }
                function init2()
                {
                        // the init for the glossary part
                        tq_initscroller('definitionwin');
                        tq_initscroller('closewin');

                        // fill the main window (with nothing, so empty it :)
                        uniquename = tq_objects[0]['name'];
                        tq_objects[0][uniquename].setcontent('', 2);
                        // fill the bottom window
                        uniquename = tq_objects[1]['name'];
                        tq_objects[1][uniquename].setcontent('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face=\'Verdana, Arial, Helvetica, sans-serif\' size=\'2\' color=\'#FFFFFF\'><a href="javascript: tq_hide(\'glossaryroot\')">Hide this window</a></font>', 2);
                        // fill the side window
                        parent.actionframe.location = '/~lla067/php/glossary/loadwords.php';

                }
                function update_bottom(name)
                {
                    parent.bottom.mypage.movepage(name, false);
                }
                function MM_jumpMenu(targ,selObj,restore){ //v3.0
                eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
                if (restore) selObj.selectedIndex=0;  }
                function pageOffset() {
                wwidth = tq_windowwidth();
                wheight = tq_windowheight() + tq_scrolly();
                if(ns6)
                   remove = 55;
                else
                   remove = 55;
                tq_moveto('hover', (wwidth-remove), (wheight-80));
                tq_moveto('hovernext', (wwidth-remove), (wheight-45));
                setTimeout("pageOffset()", 10);
                }
                function ReloadIT()
                {
                if (ns || dom)
                    init;
                    // For IE, reload on a timer in case the Windows 'Show window contents while
                    // dragging' display option is on.

                    if (ie)
                    setTimeout('init()', 2000);
                    else
                    init();
               }
               if(ns)
               {
               window.onResize = ReloadIT;
               }
               function replace()
               {
               windowWidth = tq_windowwidth(); // get the window width
               popupleft = windowWidth-150;
               if(ie)
                  tq_moveto('jumpmenu', popupleft, 10);
               else
                   tq_moveto('jumpmenu', popupleft, 0)
               }