<!--

//image loading
if (document.images)
{
  pic1= new Image(27,27);
  pic1.src="images/boxBaseL_img.gif";
  pic2= new Image(27,27);
  pic2.src="images/boxBaseR_img.gif";
  pic3= new Image(27,27);
  pic3.src="images/boxTopL_img.gif";
  pic4= new Image(27,27);
  pic4.src="images/boxTopR_img.gif";
  pic5= new Image(1,27);
  pic5.src="images/boxTop_img.gif";
  pic6= new Image(1,27);
  pic6.src="images/boxBase_img.gif";
  pic7= new Image(27,1);
  pic7.src="images/boxLeft_img.gif";
  pic8= new Image(27,1);
  pic8.src="images/boxRight_img.gif";
  }

        //image swapping
        function MM_findObj(n, d) { //v4.01
          var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
            d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
          if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
          for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
          if(!x && d.getElementById) x=d.getElementById(n); return x;
        }
        function MM_swapImage() { //v3.0
          var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
           if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
        }
        function MM_swapImgRestore() { //v3.0
          var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
        }

        function MM_preloadImages() { //v3.0
         var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
           var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
           if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
        }

        //print function
        function printit(){
        if (window.print) {
            window.print() ;
        } else {
            var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
        document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
            WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";
        }
        }

        //clears the search box
        function clearText(thefield){
                if (thefield.defaultValue==thefield.value)
                thefield.value = ""
        }

        //add to favourites
        var bookmarkurl="http://www.learners.org.uk"
        var bookmarktitle="learners.org.uk - free courses and games"

        function addbookmark(){
        if (document.all)
        window.external.AddFavorite(bookmarkurl,bookmarktitle)
        }

        // site preferences script
                var expDays = 30;
                var exp = new Date();
                exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

                // read values from the cookie
                var background = GetCookie('background');
                var color = GetCookie('color');
                var fontSize = GetCookie('font-size');
                var fontFamily = GetCookie('font-family');

                function defaults(){
                        SetCookie ('background', '', exp);
                        SetCookie ('color', '', exp);
                        SetCookie ('font-size', '', exp);
                        SetCookie ('font-family', '', exp);
                        document.location.reload();
                }

           function pagestart(){
                var background = GetCookie('background');
                var color = GetCookie('color');
                var fontSize = GetCookie('font-size');
                var fontFamily = GetCookie('font-family');
                var alignr = "right";
                       if (background != null || color != null || fontSize != null || fontFamily != null) {
                                document.styleSheets.styles.addRule('body','margin: 0; background-color:'+ background+';color:'+color+';font-size:'+fontSize+';font-family:'+fontFamily);
                                document.styleSheets.styles.addRule('p','font-size:'+fontSize);
                                document.styleSheets.styles.addRule('td','font-size:'+fontSize);
                                document.styleSheets.styles.addRule('td','background-color:'+background);
                                document.styleSheets.styles.addRule('td.inner','background-color:'+background);
                                document.styleSheets.styles.addRule('td.accessLink','font-size:'+fontSize);
                                document.styleSheets.styles.addRule('td.accessLink','text-align:' +alignr);
                                document.styleSheets.styles.addRule('td.breadcrumb', 'font-size:' +fontSize);
                                document.styleSheets.styles.addRule('select','font-size:'+fontSize+';font-family:'+fontFamily);
                                document.styleSheets.styles.addRule('input','font-size:'+fontSize+';font-family:'+fontFamily);
                                document.styleSheets.styles.addRule('h2','color:'+color+';font-size:'+fontSize);
                                document.styleSheets.styles.addRule('h3','color:'+color+';font-size:'+fontSize);
                                document.styleSheets.styles.addRule('a','color:'+color);
                                document.styleSheets.styles.addRule('a:visited','color:'+color);
                                document.styleSheets.styles.addRule('a:hover','color:'+color);
                                document.styleSheets.styles.addRule('hr','color:'+color);
                                document.styleSheets.styles.addRule('li','list-style-type:disc');
                                document.styleSheets.styles.addRule('div.lev1selected','background-color:'+background);
                         } else {
                         var background = "white";
                         var background1 = "#ebeada";
                         var highlight = "#ebebeb";
                         var color = "black";
                         var color2 = "#ff3300";
                         var color3 = "#ff3300";
                         var fontSize = "x-small";
                         var fontSize1 = "xx-small";
                         var fontSize2 = "medium";
                         var fontSize3 = "small";
                         var fontFamily = "Arial, Helvetica, sans-serif";
                         var alignr = "right";
                                document.styleSheets.styles.addRule('body','margin: 0; background-color:'+ background+';color:'+color+';font-size:'+fontSize+';font-family:'+fontFamily);
                                document.styleSheets.styles.addRule('p','font-size:'+fontSize);
                                document.styleSheets.styles.addRule('td','font-size:'+fontSize);
                                document.styleSheets.styles.addRule('td','background-color:'+background);
                                document.styleSheets.styles.addRule('td.inner','background-color:'+background1);
                                document.styleSheets.styles.addRule('td.accessLink','font-size:'+fontSize);
                                document.styleSheets.styles.addRule('td.accessLink','text-align:' +alignr);
                                document.styleSheets.styles.addRule('td.breadcrumb', 'font-size:' +fontSize1);
                                document.styleSheets.styles.addRule('select','font-size:'+fontSize+';font-family:'+fontFamily);
                                document.styleSheets.styles.addRule('input','font-size:'+fontSize+';font-family:'+fontFamily);
                                document.styleSheets.styles.addRule('h2','color:'+color2+';font-size:'+fontSize2);
                                document.styleSheets.styles.addRule('h3','color:'+color3+';font-size:'+fontSize3);
                                document.styleSheets.styles.addRule('a','color:'+color);
                                document.styleSheets.styles.addRule('a:visited','color:'+color);
                                document.styleSheets.styles.addRule('a:hover','color:'+color);
                                document.styleSheets.styles.addRule('hr','color:'+color);
                                document.styleSheets.styles.addRule('li','list-style-type:disc');
                                document.styleSheets.styles.addRule('div.lev1selected','background-color:'+highlight);
                }
                }


                function set(preference){
                        //collect values from drop down and split into an array
                        var preference_array = preference.options[preference.selectedIndex].value.split("/");

                        // count through the array and set cookie values and document properties
                        for (i=0; i<preference_array.length; i=i+2) {
                                SetCookie (preference_array[i], preference_array[i+1], exp);
                                //document.getElementById('sampleText').style[preference_array[i]]=preference_array[i+1];
                                document.styleSheets.styles.addRule('#sampleText', [preference_array[i]]+':'+ preference_array[i+1], 0);
                                //document.styleSheets.styles.addRule('td', [preference_array[i]]+':'+ preference_array[i+1]);
                                //document.styleSheets.styles.addRule('p', [preference_array[i]]+':'+ preference_array[i+1]);
                        }
                }

                function getCookieVal (offset) {
                        var endstr = document.cookie.indexOf (";", offset);
                        if (endstr == -1)
                        endstr = document.cookie.length;
                        return unescape(document.cookie.substring(offset, endstr));
                }

                function GetCookie (name) {
                        var arg = name + "=";
                        var alen = arg.length;
                        var clen = document.cookie.length;
                        var i = 0;
                        while (i < clen) {
                                var j = i + alen;
                                if (document.cookie.substring(i, j) == arg)
                                return getCookieVal (j);
                                i = document.cookie.indexOf(" ", i) + 1;
                                if (i == 0) break;
                        }
                        return null;
                }

                function SetCookie (name, value) {
                        var argv = SetCookie.arguments;
                        var argc = SetCookie.arguments.length;
                        var expires = (argc > 2) ? argv[2] : null;
                        var path = (argc > 3) ? argv[3] : null;
                        var domain = (argc > 4) ? argv[4] : null;
                        var secure = (argc > 5) ? argv[5] : false;
                       document.cookie = name + "=" + escape (value) +
                        ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
                        ((path == null) ? "" : ("; path=" + path)) +
                        ((domain == null) ? "" : ("; domain=" + domain)) +
                        ((secure == true) ? "; secure" : "");
                }

                function DeleteCookie (name) {
                        var exp = new Date();
                        exp.setTime (exp.getTime() - 1);
                        var cval = GetCookie (name);
                        document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
                }
        // end site preferences script
               function newSrc(url) {
                        var new_url = url;
                        parent.document.getElementById("mainframe").src=new_url;
               }

              function getSrc() {
                          return parent.document.getElementById("mainframe");
                        }

//-->

