        /* browser check for either IE or Netscape 4+*/
<!--//
        var tabItem=new Array('home','people','community','activities','diary','history','search');
        var tab_selected='home';
        if(parseInt(navigator.appVersion) >= 4) 
                {
                        if(navigator.platform.slice(0,3) == 'Win')
                                {
                                        isPC = true;
                                        if(navigator.appName == "Netscape") 
                                                {
                                                        isNav = true;
                                                }
                                        else 
                                                {
                                                        isIE = true;
                                                }
                                }
                        else if(navigator.platform.slice(0,3) == 'Mac')
                                {
                                        isMac = true;
                                        if(navigator.appName == "Netscape") 
                                                {
                                                        isNav = true;
                                                }
                                        else 
                                                {
                                                        isIE = true;
                                                }
                                }
                }
        else 
                {
                        alert('Welcome. This site requires a version 4 browser or above to function correctly. You can download the latest version of Microsoft Internet Explorer from http://www.microsoft.com/or Netscape Navigator from http://www.netscape.com/');
                }
//-->
        
        /* window close */
<!--//
        function windowclose() 
                {
                        window.close();
                }
//-->

        /* new window */
<!--//
        function Start(page) 
                {
                        OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes,status=yes,screenX=0,screenY=0");
                }
//-->
        
        /* rollover image functionality */
<!--//
        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];
                                        }
                        }
                }
        function MM_findObj(n, d) 
                { //v4.0
                        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 && document.getElementById) x=document.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 leftMenuItem(menuType,menuURL)
                {
                        var blueImage='images/' + menuType + '_blue.gif';
                        var blackImage='images/' + menuType + '_black.gif';
                        var string1="<div align='center'><a href=\"" + menuURL + "\"";
                        var string2=" onMouseover=\"MM_swapImage('" + menuType + "','','" + blueImage + "',1);\"";
                        var string3=" onMouseout=\"MM_swapImage('" + menuType + "','','" + blackImage + "',1);\"";
                        var string5="><img SRC=\"Images/" + menuType;
                        var string6="_black.gif\" NAME=\"" + menuType;
                        var string7="\" BORDER=0 ID=\"" + menuType;
                        var string8="\" ALT=\"" + menuType;
                        var string9="\" ></a></div>"
                        var string=string1 + string2 + string3 + string5 + string6 + string7 + string8 + string9;
                        document.writeln(string);
                }
                function error()
                {
                        alert('the program got this far');
                }
                function loadFrame(loc)
                {
                        var i;
                        for (i in tabItem)
                        {
                                var redImage='images/' + tabItem[i] + '_red.gif';
                                var blackImage='images/' + tabItem[i] + '_black.gif';
                                var navFrame=tabItem[i] + 'nav.html';
                                MM_swapImage(tabItem[i],'',blackImage,1);
                                if (loc == tabItem[i]) 
                                {
                                MM_swapImage(tabItem[i],'',redImage,1); 
                                parent.frames['sideNavigation'].location.href = navFrame;
                                tab_selected=tabItem[i];
                                }                               
                        }
                }
                function loadFrameMenu(loc)
                {
                        var i;
                        for (i in tabItem)
                        {
                                var redImage='images/' + tabItem[i] + '_red.gif';
                                var blackImage='images/' + tabItem[i] + '_black.gif';
                                var navFrame=tabItem[i] + 'nav.html';
                                MM_swapImage(tabItem[i],'',blackImage,1);
                                if (loc == tabItem[i]) 
                                {
                                MM_swapImage(tabItem[i],'',redImage,1); 
                                tab_selected=tabItem[i];
                                }                               
                        }
                }
                function clearImage(loc)
                {
                        var i;
                        for (i in tabItem)
                        {
                                var blackImage='images/' + tabItem[i] + '_black.gif';
                                if (tab_selected!=tabItem[i]) 
                                {
                                MM_swapImage(tabItem[i],'',blackImage,1); 
                                }
                        }
                }
                function swapImage(loc)
                {
                        var i;
                        for (i in tabItem)
                        {
                                var blueImage='images/' + tabItem[i] + '_blue.gif';
                                if (loc==tabItem[i] && tab_selected!=tabItem[i]) 
                                {
                                MM_swapImage(tabItem[i],'',blueImage,1); 
                                }
                        }
                }
//-->

        /* centered popup */
<!--//
        function NewWindow(mypage, myname, w, h, scroll) 
                {
                        var winl = (screen.width - w) / 2;
                        var wint = (screen.height - h) / 2;
                        winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
                        win = window.open(mypage, myname, winprops)
                        if (parseInt(navigator.appVersion) >= 4) 
                                { 
                                        win.window.focus(); 
                                }
                }
//-->

        /* bookmark */
<!--//
        function addbookmark()
                {
                        bookmarkurl="http://www.beckford-village.org"
                        bookmarktitle="Beckford Village - your gateway to Bredon Hill"
                        if (document.all)
                        window.external.AddFavorite(bookmarkurl,bookmarktitle)
                }
//-->

        /* displays a default message on the status bar */
<!--//
        window.defaultStatus="Beckford Village - your gateway to Bredon Hill";
//-->
        
        /* feedback */
<!--//
        function backStep()
                {
                        history.back();
                }
//-->


/* defines the date functionality */
<!--//
                d = new Array   (
                "Sunday ",
                "Monday ",
                "Tuesday ",
                "Wednesday ",
                "Thursday ",
                "Friday ",
                "Saturday ");
                m = new Array(
                "January",
                "February",
                "March",
                "April",
                "May",
                "June",
                "July",
                "August",
                "September",
                "October",
                "November",
                "December");
                today = new Date();
                day = today.getDate();
                year = today.getYear();
        if (year < 2000)
                year = year + 1900;
                end = "th";
        if (day==1 || day==21 || day==31) end="st";
        if (day==2 || day==22) end="nd";
        if (day==3 || day==23) end="rd";
                day+=end;
//-->

        /* random image rotation */
<!-- //
        function RandomImageLong(images,iparams)
                {
                        si=0; 
                        ci=0;
                        cc=0;
                        imageSet = new Array();
                        ei = images.length;
                        for (i=1;i<ei;i++) 
                                {
                                        if (images.charAt(i) == ' ' || images.charAt(i) == ',') 
                                                {
                                                        imageSet[cc] = images.substring(si,i);
                                                        cc++;
                                                        si=i+1;
                                        }
                                }
                        ind = Math.floor(Math.random() *cc);
                        document.write("<img "+iparams+" src="+imageSet[ind]+">");
                }

        function RandomImage(images)
                {
                        RandomImageLong(images," ");
                }

        function RandomImageLinkLongTarget(images,urls,iparams,hparams)
                {
                        imageSet = new Array();
                        urlSet = new Array();
                        si=0; 
                        ci=0;
                        cc=0;
                        ei = images.length;
                        for (i=1;i<ei;i++) 
                                {
                                        if (images.charAt(i) == ' ' || images.charAt(i) == ',') 
                                                {
                                                        imageSet[cc] = images.substring(si,i);
                                                        cc++;
                                                        si=i+1;
                                        }
                                }
                        ind = Math.floor(Math.random() *cc);
                        si=0; 
                        ci=0;
                        cc=0;
                        ei = urls.length;
                        for (i=1;i<ei && cc <=ind ;i++) 
                                {
                                        if (urls.charAt(i) == ' ' || urls.charAt(i) == ',') 
                                                {
                                                urlSet[cc] = urls.substring(si,i);
                                                cc++;
                                                        si=i+1;
                                        }
                                }

                        document.write("<a "+hparams+" href=\""+urlSet[ind]+"\"><img "+iparams+" src="+imageSet[ind]+"></a>");
                }

        function RandomImageLinkLong(images,urls,iparams)
                {
                        RandomImageLinkLongTarget(images,urls,iparams,"");
                }

        function RandomImageLink(images,urls)
                {
                        RandomImageLinkLongTarget(images,urls,"border=0","");
                }
// -->

<!--//
function changeFontSize(fontSizeChange){
        var fontsize=getCookie("fontsize");
        if (isNaN(parseInt(fontsize))){
                fontsize = 11;
        }
        if (!((fontsize == 11) || (fontsize == 14))){
                        var theFontSize = parseInt(fontsize) + fontSizeChange;
                        setCookie("fontsize",theFontSize,exp);
                        window.location.reload();
        }
        if((fontsize==11) && (fontSizeChange==1)){
        setCookie("fontsize",12,exp);
        window.location.reload();
        }
        if((fontsize==14) && (fontSizeChange==-1)){
                setCookie("fontsize",13,exp);
                window.location.reload();
        }
}

function opacity(id, opacStart, opacEnd, millisec) {
        //speed for each frame
        var speed = Math.round(millisec / 100);
        var timer = 0;

        //determine the direction for the blending, if start and end are the same nothing happens
        if(opacStart > opacEnd) {
                for(i = opacStart; i >= opacEnd; i--) {
                        setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
                        timer++;
                }
        } else if(opacStart < opacEnd) {
                for(i = opacStart; i <= opacEnd; i++)
                        {
                        setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
                        timer++;
                }
        }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
        var object = document.getElementById(id).style; 
        object.opacity = (opacity / 100);
        object.MozOpacity = (opacity / 100);
        object.KhtmlOpacity = (opacity / 100);
        object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
        //if an element is invisible, make it visible, else make it ivisible
        if(document.getElementById(id).style.opacity == 0) {
                opacity(id, 0, 100, millisec);
        } else {
                opacity(id, 100, 0, millisec);
        }
}

function blendimage(divid, imageid, imagefile, millisec) {
        var speed = Math.round(millisec / 100);
        var timer = 0;
        
        //set the current image as background
        document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
        
        //make image transparent
        changeOpac(0, imageid);
        
        //make new image
        document.getElementById(imageid).src = imagefile;

        //fade in image
        for(i = 0; i <= 100; i++) {
                setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
                timer++;
        }
}

function currentOpac(id, opacEnd, millisec) {
        //standard opacity is 100
        var currentOpac = 100;
        
        //if the element has an opacity set, get it
        if(document.getElementById(id).style.opacity < 100) {
                currentOpac = document.getElementById(id).style.opacity * 100;
        }

        //call for the function that changes the opacity
        opacity(id, currentOpac, opacEnd, millisec)
}