<!-- //
/* 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");
         }

//ie mac fix for drop downs
         function menuFix1() {
         var sfEls = document.getElementById("topmenu").getElementsByTagName("li");
         for (var i=0; i<sfEls.length; i++) {
         sfEls[i].onmouseover=function() {
         this.className+=(this.className.length>0? " ": "") + "sfhover";
         }
         sfEls[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
         }
         }
         }



function menuFix() {
        var sfEls = document.getElementById("nav").getElementsByTagName("LI");
        for (var i=0; i<sfEls.length; i++) {
                sfEls[i].onmouseover=function() {
                this.className+=(this.className.length>0? " ": "") + "sfhover";
                }

                sfEls[i].onMouseDown=function() {
                this.className+=(this.className.length>0? " ": "") + "sfhover";
                }

                sfEls[i].onMouseUp=function() {
                this.className+=(this.className.length>0? " ": "") + "sfhover";
                }

                sfEls[i].onmouseout=function() {
                this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
                }
        }
}

   function getWindowHeight() {
                        var windowHeight = 0;
                        if (typeof(window.innerHeight) == 'number') {
                                windowHeight = window.innerHeight;
                        }
                        else {
                                if (document.documentElement && document.documentElement.clientHeight) {
                                        windowHeight = document.documentElement.clientHeight;
                                }
                                else {
                                        if (document.body && document.body.clientHeight) {
                                                windowHeight = document.body.clientHeight;
                                        }
                                }
                        }
                        return windowHeight;
                }

                function getStoryHeight() {
                        var storyHeight = 0;
                        if(document.getElementById('story1')){
                        storyHeight = document.getElementById('story1').offsetHeight;
                        }
                        else {
                                storyHeight = 0;
                                }
                        return storyHeight;
                }

                function getLeftHeight() {
                        var leftHeight = 0;
                        if(document.getElementById('campaign4')){
                        leftHeight = document.getElementById('campaign4').offsetHeight;
                        }
                         else {
                                leftHeight = 0;
                                }
                        return leftHeight;
                }

                function getRightHeight() {
                        var rightHeight = 0;
                         if(document.getElementById('column3')){
                        rightHeight = document.getElementById('column3').offsetHeight;
                         }
                         else {
                                rightHeight = 0;
                                }
                        return rightHeight;
                }
                function getDeckHeight() {
                        var deckHeight = 0;
                         if(document.getElementById('story2')){
                        deckHeight = document.getElementById('story2').offsetHeight;
                         }
                         else {
                                deckHeight = 0;
                                }
                        return deckHeight;
                }

                function getOtherHeight() {
                        var otherHeight = 0;
                         if(document.getElementById('otherNews')){
                       otherHeight = document.getElementById('otherNews').offsetHeight;
                         }
                         else {
                                otherHeight = 0;
                                }
                        return otherHeight;
                }


function placeFooterKhtml(){
var top=0;
var w=getWindowHeight();
var s=getStoryHeight();
var l=getLeftHeight();
var r=getRightHeight();
var d=getDeckHeight();
var o=getOtherHeight();
var footr='<div style="padding-top:10px;width:808px;height:24px;background:#900;color:white;font-size:xx-small;">';
footr += '<div align="center">NUJ, 308-312 Gray\'s Inn Rd, London WC1X 8DP. Tel: 0207 278 7916. Fax: 0207 837 8143. ';
footr += 'Email:<a style="color:white;font-size:xx-small;" href="mailto:info@nuj.org.uk">info@nuj.org.uk</a>&nbsp;|&nbsp;';
footr += '<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=74">Website policy and disclaimers</a>';
footr += '&nbsp;|&nbsp;<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=70">Accessibility</a></div></div>';
if(s>=l && s>=r) {
        top=s+170;
        } else if(r>=l && r>=s) {
                top=r+240;
                } else {
                        top=l+170;
                        }
/* alert(w +'>' +s +'>' +l +'>' +r +'>' +d +'>' +o +' top:' +top); */
document.write('<div style="clear:both;position:absolute;z-index:80;left:-142px;top:' +top +'px;">'  +footr  +'</div>');
}

function placeInnerFooterKhtml(){
var top=0;
var w=getWindowHeight();
var s=getStoryHeight();
var l=getLeftHeight();
var r=getRightHeight();
var d=getDeckHeight();
var o=getOtherHeight();
var footr='<div style="padding-top:10px;width:808px;height:20px;background:#900;color:white;font-size:xx-small;">';
footr += '<div align="center">NUJ, 308-312 Gray\'s Inn Rd, London WC1X 8DP. Tel: 0207 278 7916. Fax: 0207 837 8143. ';
footr += 'Email:<a style="color:white;font-size:xx-small;" href="mailto:info@nuj.org.uk">info@nuj.org.uk</a>&nbsp;|&nbsp;';
footr += '<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=74">Website policy and disclaimers</a>';
footr += '&nbsp;|&nbsp;<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=70">Accessibility</a></div></div>';
if(s>=l && s>=r) {
        top=s+200;
        } else if(r>=l && r>=s) {
                top=r+300;
                } else {
                        top=l+350;
                        }
/* alert(w +'>' +s +'>' +l +'>' +r +'>' +d +'>' +o +' top:' +top);  190 above */
document.write('<div style="clear:both;position:absolute;z-index:80;left:0px;top:' +top +'px;"><br /><br />'  +footr  +'</div>');
}


function placeFooter(){
var top=0;
var w=getWindowHeight();
var s=getStoryHeight();
var l=getLeftHeight();
var r=getRightHeight();
var d=getDeckHeight();
var o=getOtherHeight();
var footr='<div style="padding-top:2px;width:808px;height:20px;background:#900;color:white;font-size:xx-small;">';
footr += '<div align="center">NUJ, 308-312 Gray\'s Inn Rd, London WC1X 8DP. Tel: 0207 278 7916. Fax: 0207 837 8143. ';
footr += 'Email:<a style="color:white;font-size:xx-small;" href="mailto:info@nuj.org.uk">info@nuj.org.uk</a>&nbsp;|&nbsp;';
footr += '<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=74">Website policy and disclaimers</a>';
footr += '&nbsp;|&nbsp;<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=70">Accessibility</a></div></div>';
if(s>=l && s>=r) {
        top=s+200;
        } else if(r>=l && r>=s) {
                top=r+280;
                } else {
                        top=l+350;
                        }
// alert(w +'>' +s +'>' +l +'>' +r +'>' +d +'>' +o +' top:' +top);
//s+d+o
document.write('<div style="clear:both;position:absolute;z-index:80;left:0px;top:' +top +'px;">'  +footr  +'</div>');
}

function placeFooterhp(){
var top=0;
var w=getWindowHeight();
var s=getStoryHeight();
var l=getLeftHeight();
var r=getRightHeight();
var d=getDeckHeight();
var o=getOtherHeight();
var footr='<div style="padding-top:2px;width:808px;height:20px;background:#900;color:white;font-size:xx-small;">';
footr += '<div align="center">NUJ, 308-312 Gray\'s Inn Rd, London WC1X 8DP. Tel: 0207 278 7916. Fax: 0207 837 8143. ';
footr += 'Email:<a style="color:white;font-size:xx-small;" href="mailto:info@nuj.org.uk">info@nuj.org.uk</a>&nbsp;|&nbsp;';
footr += '<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=74">Website policy and disclaimers</a>';
footr += '&nbsp;|&nbsp;<a style="color:white;font-size:xx-small;" href="innerPagenuj.html?docid=70">Accessibility</a></div></div>';
if(s>=l && s>=r) {
        top=s+40;
        } else if(r>=l && r>=s) {
                top=r+80;
                } else {
                        top=l+40;
                        }
//alert(w +'>' +s +'>' +l +'>' +r +'>' +d +'>' +o +' top:' +top);
//s+d+o
document.write('<div style="position:absolute;z-index:80;left:-142px;top:' +top +'px;">'  +footr  +'</div>');
}

// -->