<!--//




/* Browser Detection Script begins here. */
var theDOM1 = (document.getElementById) ? true : false;
/* theApp will contain the browser name */
var theApp = navigator.appName.toLowerCase();
/* UA (user agent) contains detailed browser info. For example,
UA for Internet Explorer on Mac would be 'mozilla/4.0 (compatible;
msie 5.0; mac_powerpc)' */
var UA = navigator.userAgent.toLowerCase();
/* variables for the two major browsers in existence today. */
var isIE = (UA.indexOf('msie') >= 0) ? true : false;
var isNS = (UA.indexOf('mozilla') >= 0) ? true : false;
/* 'compatible' text string is only in non-Netscape browsers */
if (UA.indexOf('compatible')>0){
isNS = false;
}
/* platform */
var thePlatform = navigator.platform.toLowerCase();
var isMAC = (UA.indexOf('mac') >= 0) ? true : false;
var isWIN = (UA.indexOf('win') >= 0) ? true : false;
/* Most UNIX users use X-Windows so this detects UNIX most of
the time.*/
var isUNIX = (UA.indexOf('x11') >= 0) ? true : false;
/* browser version */
var version = navigator.appVersion;
var isMajor = parseInt( version );
/* Internet Explorer version 5 on the Mac reports itself as version
4. This code corrects the problem. */
if(isIE && isMAC) {
if(UA.indexOf("msie 5")) {
isMajor = 5;
var stringLoc = UA.indexOf("msie 5");
version = UA.substring(stringLoc + 5, stringLoc + 8);
}
}
/* Internet Explorer version 6 on Windows reports itself as version
4. This code corrects the problem. */
if(isIE && isWIN) {
if(UA.indexOf("msie 6")) {
isMajor = 6;
var stringLoc = UA.indexOf("msie 6");
version = UA.substring(stringLoc + 5, stringLoc + 8);
}

if(UA.indexOf("msie 5.5")) {
isMajor = 5;
var stringLoc = UA.indexOf("msie 5.5");
version = UA.substring(stringLoc + 5, stringLoc + 8);
}
}
/* Netscape 6 reports itself as version 5 on all platforms.
This code corrects the problem. */
if(isNS && isMajor>4) {
if(UA.indexOf("netscape6")) {
isMajor = 6;
var stringLoc = UA.indexOf("netscape6");
version = UA.substring(stringLoc + 10, stringLoc + 14);
}
}
var isMinor = parseFloat( version );
/* a function to report browser info */
function getBrowserInfo(){
var temp="<p>";
temp += "User Agent: " + UA + "<br>";
temp += "Platform: " + thePlatform + "<br>";
temp += "Macintosh: " + isMAC + "<br>";
temp += "Windows: " + isWIN + "<br>";
temp += "Application: " + theApp + "<br>";
temp += "Version: " + version + "<br>";
temp += "Netscape: " + isNS + "<br>";
temp += "Internet Explorer: " + isIE + "<br>";
temp += "Major Version: " + isMajor + "<br>";
temp += "Full Version: " + isMinor + "<br>";
temp += "<br>";
if (theDOM1){
temp += "You appear to have a modern browser.<br>";
temp += "Netscape 6, IE 6, or IE5Mac are recommended.";
}else{
temp += "Alert! Your browser is obsolete.<br>";
temp += "You may enjoy the Web more if you upgrade.";
}
temp +="<\/p>";
return temp;
}
/* End of browser detection code */

/* Convert object name string or object reference
into a valid object reference */
function getObj(elementID){
if (typeof elementID == "string") {
return document.getElementById(elementID);
}else{
return elementID;
}
}
/* Object Motion and Position Scripts */
/*This function places a positionable object (obj) in
three dimensions (x,y, and z).*/
function shiftTo(obj,x,y,z){
var newObj = getObj(obj);
newObj.style.left = x + "px";
newObj.style.top = y + "px";
newObj.style.zIndex = z;
}
/*This function gets the x coordinate of a positionable
object.*/
function getObjX(obj){
return parseInt(getObj(obj).style.left);
}
/*This function gets the y coordinate of a positionable
object.*/
function getObjY(obj){
return parseInt(getObj(obj).style.top);
}
/*This function gets the z-index of a positionable
object.*/
function getObjZ(obj){
return parseInt(getObj(obj).style.zIndex);
}
/*The emptyNode() function loops through the array of
child nodes and removes each one.*/
function emptyNode(elementID){
var theNode = getObj(elementID);
for (i=0;i<theNode.childNodes.length;i++){
theNode.removeChild(theNode.childNodes[i]);
}
}

/*This function gets the available width of the window.*/
function getAvailableWidth(){
var theWidth=null;
/*Netscape uses window.innerWidth */
if (window.innerWidth) {
theWidth = window.innerWidth;
}
/*IE uses document.body.clientWidth */
if (document.body.clientWidth) {
theWidth = document.body.clientWidth;
}
return theWidth;
}
/*This function gets the available height of the window.
IE6.0 on Windows has a bug and returns null.*/
function getAvailableHeight(){
var theHeight = null;
/*Netscape uses window.innerHeight */
if (window.innerHeight) {
theHeight = window.innerHeight;
}
/*IE uses document.body.clientHeight */
if (document.body.clientHeight) {
theHeight = document.body.clientHeight;
}
return theHeight;
}
/*This function sets the total height and width of the
window.*/
function setWindowSize(w,h){
window.resizeTo(w,h);
}
/*This function sets the size of the window to cover all
of the screen.*/
function maximizeWindow(){
window.moveTo(0,0);
window.resizeTo(screen.availWidth,screen.availHeight);
}

/* Redirects visitors who are using outdated browsers.*/
function checkDOM(newlocation){
if (!theDOM1){
window.location.replace(newlocation);
}
}
/* This function changes the cursor.
The second argument is optional. */
    function setCursor(cursortype,thisobj){
             if (UA.indexOf("msie 5")>=0){
             if (cursortype == 'pointer') { cursortype='hand'; }
             }
             if (thisobj==null){
             document.body.style.cursor = cursortype;
             }else{
             getObj(thisobj).style.cursor = cursortype;
             }
             }
/*Set the background color of an object*/
      function setBackground(thisobj, color){
               getObj(thisobj).style.background = color;
               }

/*Set the text color of an object*/
function setColor(thisobj, color){
getObj(thisobj).style.color = color;
}
/*Setting the visibility of an object*/
function setVisibility(obj,vis){
var theObj = getObj(obj);
if (vis == true || vis=='visible' || vis=='y'){
theObj.style.visibility = "visible";
}else{
theObj.style.visibility = "hidden";
}
}
/*Getting the visibility of an object*/
function isVisible(obj) {
var theObj = getObj(obj);
return theObj.style.visibility;
}

/*Setting the display of an object*/
function setDisplay(obj,dis){
var theObj = getObj(obj);
if (dis==true || dis=='block' || dis=='y') {
   theObj.style.display = 'block';
}else{
if (dis==false || dis=='n'){
theObj.style.display = "none";
}else{
theObj.style.display = dis;
             }
       }
}

/*Getting the display of an object*/
function isDisplayed(obj) {
var theObj = getObj(obj);
return theObj.style.display;
}

/*Set the clip region of an object*/
function setClip(obj,top,right,bottom,left){
var theObj = getObj(obj);
var r = 'rect('+top+'px,'+right+'px,'+bottom+'px,'+left+'px)';
theObj.style.clip = r;
}

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

        //add to favourites
        function addbookmark()
        {
                if (document.all)
                window.external.AddFavorite(location.href,document.title)
        }

        //validates the search input
        function validateSearch()
        {
                if (searchForm.searchInput.value == "search..." || searchForm.searchInput.value == "" || searchForm.searchInput.value.length <1)
                {
                        alert("Please enter search term");
                        searchForm.searchInput.value = "";
                        searchForm.searchInput.focus();
                        return(false);
                }
                return true;
        }

        //validates the login input
        function validateLogin()
        {
                if (loginForm.loginUsername.value == "username..." || loginForm.loginUsername.value == "" || loginForm.loginUsername.value.length <1)
                {
                        alert("Please enter username");
                        loginForm.loginUsername.value = "";
                        loginForm.loginUsername.focus();
                        return(false);
                }
                else if (loginForm.loginPassword.value == "username..." || loginForm.loginPassword.value == "" || loginForm.loginPassword.value.length <1)
                {
                        alert("Please enter password");
                        loginForm.loginPassword.value = "";
                        loginForm.loginPassword.focus();
                        return(false);
                }
                return true;
        }

        function togglemenu(menuID)
        {
                 var themenu="dropdown"+menuID;
                 if (isDisplayed(themenu)=="block"){
                 hidemenu(menuID);
                 }else{
                 showmenu(menuID);
                 }
         }


         function showmenu(menuID)
         {
                  var themenu="dropdown"+menuID;
                  setCursor("pointer");
                  setDisplay(themenu,"block");
         }

         function hidemenu(menuID)
         {
                  var themenu="dropdown"+menuID;
                  setCursor("auto");
                  setDisplay(themenu,"none");
         }


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.stjerome.co.uk"
var bookmarktitle="St. Jerome Publishing"

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

//expand contract menu
var crntItem = new Array();

function expandMNU(divID){
        if (document.all(divID).style.display == "none"){
                document.all(divID).style.display = "";
                contractMNU(divID);
                crntItem[crntItem.length] = new Array(divID);
        }
        else {
                document.all(divID).style.display = "none";
        }
}

level=1000;

function contractMNU(divID){
        for (i=0;i<crntItem.length;i++){
                if ((crntItem[i][0] >= level) && (crntItem[i][1]!= divID)){
                        document.all(crntItem[i][1]).style.display = "none";
                }
        }
}

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];}}
}

//-->