    //Variables used for fixing Transparent PNG files in IE.
    var strRootPath = '';
    
    var curcontentindex=0
    var messages=new Array()
    
    var Pcurcontentindex=0
    var ProductImages=new Array()
    var PintervalID = 0;
    
    //The master load function.
    function Load(RootPath) {
        if (document.all || document.getElementById){
            SlideShow_getElementByClass("dyncontent")
            setInterval("SlideShow_rotatecontent()", 2000)
            
            Presentation_getElementByClass("ProductPresentation")
            PintervalID = setInterval("Presentation_rotatecontent()", 5000)
        }

        strRootPath = RootPath;
        
		//Fix Internet Explorer Absolute positioning. Pass true to tell it that it's the first load.
		//Also does the work to fix PNG and a few other things.
		//Must be called AFTER any sets of the .right and .bottom properties.
		FixIE(true);
		
		//Does buttons with prefetch in all browsers
		SetupButtons(); 
			
		//Allows text boxes to display help.
		SetupTextBoxes();	
		
		CenterImageGallery();
		
		if (document.getElementById("NavFrame") != null) {
		    document.getElementById("NavFrame").onscroll = Scroll;
		    Scroll();
		}
    }
    
    function SlideShow_getElementByClass(classname){
        var inc=0
        var alltags=document.all? document.all : document.getElementsByTagName("*")
        for (i=0; i<alltags.length; i++){
            if (alltags[i].className==classname)
            messages[inc++]=alltags[i]
        }
    }

    function SlideShow_rotatecontent(){
        //get current message index (to show it):
        curcontentindex=(curcontentindex<messages.length-1)? curcontentindex+1 : 0
        //get previous message index (to hide it):
        prevcontentindex=(curcontentindex==0)? messages.length-1 : curcontentindex-1
        try{
        messages[prevcontentindex].style.display="none" //hide previous message
        messages[curcontentindex].style.display="block" //show current message
        } catch (e) {} //will error if page has no content for the script to rotate
    }
    
    function Presentation_getElementByClass(classname){
        var inc=0
        var alltags=document.all? document.all : document.getElementsByTagName("*")
        for (i=0; i<alltags.length; i++){
            if (alltags[i].className==classname)
            ProductImages[inc++]=alltags[i]
        }
    }

    function Presentation_rotatecontent(){
        //get current message index (to show it):
        Pcurcontentindex=(Pcurcontentindex<ProductImages.length-1)? Pcurcontentindex+1 : 0
        //get previous message index (to hide it):
        prevcontentindex=(Pcurcontentindex==0)? ProductImages.length-1 : Pcurcontentindex-1
        try{
        ProductImages[prevcontentindex].style.display="none" //hide previous message
        ProductImages[Pcurcontentindex].style.display="block" //show current message
        } catch (e) {} //will error if page has no content for the script to rotate
    }
    
    function Presentation_rotateBack(){
        //get current message index (to show it):
        Pcurcontentindex=(Pcurcontentindex==0)? ProductImages.length-1 : Pcurcontentindex-1
        //get previous message index (to hide it):
        prevcontentindex=(Pcurcontentindex<ProductImages.length-1)? Pcurcontentindex+1 : 0
        try{
        ProductImages[prevcontentindex].style.display="none" //hide previous message
        ProductImages[Pcurcontentindex].style.display="block" //show current message
        } catch (e) {} //will error if page has no content for the script to rotate
    }

    function Presentation_Stop(){
        clearInterval(PintervalID);
    }

  	function Highlight(e) {
		e.style.backgroundColor="#FADADA";
		e.style.color="Black";
	}
	
	function Reset(e) {
		e.style.backgroundColor="#e2b9b9";
		e.style.color="Black";
	}
    
    function GetCurrentStyleValue(Element, Property) {
        if (Element.currentStyle) {
            return Element.currentStyle[Property];
        } else {
            return window.getComputedStyle(Element, null).getPropertyValue(Property);
        }

    }
    
    function Scroll() {
        if (document.getElementById("NavFrame") != null) {
            eFrame = document.getElementById("NavFrame");
            e = document.getElementById("ctl00_HelpContent_NavBar_div");
            if (e == null)
                e = document.getElementById("ctl00_HelpContent_PRMenu1_NavBar_div");

            if (e == null)
                e = document.getElementById("ctl00_HelpContent_Contents1_NavBar_div");
            
            if (e != null) {
                e.style.width = eFrame.clientWidth - 10;                                
            }
        }
    }

    
    //Resize function  If you need to do any other resizing functionality, put it in here.
    function Resize() {
        FixIE(false);
        
        CenterImageGallery();
    }
    
    function BeforePrint() {   
        for(var i = 0; i < document.body.all.length; i++) {
            var e = document.body.all[i];
            
        if (e.style.width)
            e.style.width = null;
        
        if (e.style.height)
            e.style.height = null;
        
        }
    }
    
   
    function AfterPrint() {
        window.location.reload();
    }

    function CenterImageGallery() {
     	if (document.getElementById('ImageGallery')) {
		    var ImageGallery = document.getElementById('ImageGallery');
		    var ItemCount;
    		
	        ItemCount = parseInt(ImageGallery.parentNode.offsetWidth / 185);
		    ImageGallery.style.width = ItemCount * 180 + "px";
		    ImageGallery.style.left = (ImageGallery.parentNode.offsetWidth - ImageGallery.offsetWidth) /2 + "px";
		}
    }
    
    function SetupButtons() {
        var ImgElements = document.getElementsByTagName('img');
        var BtnElements = document.getElementsByTagName('input');
        
        for(var i = 0; i < ImgElements.length; i++) {
            AssignButtonProperties(ImgElements[i]);
        }    
        
        for(var i = 0; i < BtnElements.length; i++) {
            if (BtnElements[i].getAttribute("type") == "image") {
                AssignButtonProperties(BtnElements[i]);    
            }
        }     
    }
    
    function SetupTextBoxes() {
        if (document.getElementById('help')) {
            document.getElementById('help').setAttribute("OriginalText", document.getElementById('help').innerHTML);
            
            var txtElements = document.getElementsByTagName('input');
            
            for(var i = 0; i < txtElements.length; i++) {
                txtElements[i].onfocus = txtFocus;
            }
            
            var SelectElements = document.getElementsByTagName('select');
            for(var i = 0; i < SelectElements.length; i++) {
                SelectElements[i].onfocus = txtFocus;
            }

        }
    }
    
    function txtFocus(e) {
        var eHelp = document.getElementById('help');
        
        if (eHelp && GetCurrentStyleValue(eHelp, "visibility") != "hidden") {
            if (this.getAttribute("HelpText")) {
                eHelp.innerHTML = this.getAttribute("HelpText");
            } else {
                eHelp.innerHTML = eHelp.getAttribute("OriginalText");
            }
        }
    }
    
    function AssignButtonProperties(Element) {
        if (Element.getAttribute("srcdown") || Element.getAttribute("srcover")) {
            //We have a winner
            //Pre-load the images and set the mouse events.
            
            Element.onmouseup = ButtonUp;
            Element.onmouseout = ButtonOut;
            Element.onmouseover = ButtonOver;

            if (Element.getAttribute("srcdown")) {
                Element.onmousedown = ButtonDown;
                var img = new Image();
                img.src = GetRootPath(Element.getAttribute("srcdown"));
            }

            if (Element.getAttribute("srcover")) {
                var img = new Image();
                img.src = GetRootPath(Element.getAttribute("srcover"));
            }               
        }
    }
      
    function ButtonDown(e) {
        if (!this.onmousedown) return;
        
        SetButtonImage(this, GetRootPath(this.getAttribute("srcdown")));        
    }
    
    function ButtonUp(e) {
        if (!this.onmouseup) return;
        
        if (this.getAttribute("srcup")) //Only need to call it if the srcup exists, otherwise it hasn't been changed anyhow.
            SetButtonImage(this, GetRootPath(this.getAttribute("srcup")));    
    }
    
    function ButtonOut(e) {
        if (!this.onmouseout) return;
        
        if (this.getAttribute("srcup")) //Only need to call it if the srcup exists, otherwise it hasn't been changed anyhow.
            SetButtonImage(this, GetRootPath(this.getAttribute("srcup")));    
    }
    
    function ButtonOver(e) {
        if (!this.onmouseover) return;
        
        var ButtonDown = false;
        
        //This one is a little trickier, because we have to figure out if the mouse button is down or now.
        if (!e) var e = window.event;
        var ButtonDown = GetMouseButton(e);       
        
        if (ButtonDown > 0 && this.getAttribute("srcdown")) {
            SetButtonImage(this, GetRootPath(this.getAttribute("srcdown")));
        } else {
            if (this.getAttribute("srcover")) {
                SetButtonImage(this, GetRootPath(this.getAttribute("srcover")));
            } else if (this.getAttribute("srcup")) {
                SetButtonImage(this, GetRootPath(this.getAttribute("srcup")));
            } 
        }
    }
      
    function SetButtonImage(e, Src) {
        if (e.style.filter && navigator.appVersion.indexOf("MSIE") != -1) {
  	        e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + Src  + "', sizingMethod='image')";
        } else {
            if (!e.getAttribute("srcup"))
                e.setAttribute("srcup", e.src);
            e.src = Src;
        }
    }
    
    function FixIE(Load) {
		window.status = document.documentElement.clientWidth + ", " + document.documentElement.clientHeight;
        if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Opera") == -1 && navigator.userAgent.indexOf("MSIE 8.0") == -1) {
            FixElement(document.body, Load); 
            Scroll();           
        }
    }
    
    
    function FixElement(e, Load) {
        var right = -1;
        var left = -1;
        var top = -1;
        var bottom = -1;

        if (Load && e.tagName && navigator.userAgent.indexOf("MSIE 7.0") == -1) {
            if (e.tagName.toLowerCase() == "img") {        
                if (e.src.toLowerCase().search(/\.png$/) >= 0) {
                    e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + e.src  + "', sizingMethod='image')";
                    e.setAttribute('srcup', e.src); //Used for the up and downs
                    e.src= strRootPath + 'Images/Empty.gif';
                }
            } else if (e.tagName.toLowerCase() == "input" && e.getAttribute("type") == "image") {
                if (e.getAttribute("src").toLowerCase().search(/\.png$/) >= 0) {
                    e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + e.src  + "', sizingMethod='image')";
                    e.setAttribute('srcup', e.src); //Used for the up and downs
                    e.src = strRootPath + 'Images/Empty.gif';
                }
            } else if (e.currentStyle && e.currentStyle.backgroundImage && e.currentStyle.backgroundImage.toLowerCase() != "none" && e.currentStyle.backgroundImage.toLowerCase().search(/png/) >= 0) { 
                var pngFileName = e.currentStyle.backgroundImage.substring(5, e.currentStyle.backgroundImage.length -2);
                if (pngFileName != "") {
                    e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + pngFileName  + "', sizingMethod='image')";
                    e.style.backgroundImage = "url('" + strRootPath + "Images/Empty.gif" + "')";
                }
            }
        }
        
        if (e.currentStyle && e.currentStyle.position && e.currentStyle.position == "absolute") {
            if (e.currentStyle.left && e.currentStyle.left.toLowerCase() != "auto")
                left = parseInt(e.currentStyle.left);
            
            if (e.currentStyle.right && e.currentStyle.right.toLowerCase() != "auto")
                right = parseInt(e.currentStyle.right);
                
            if (e.currentStyle.top && e.currentStyle.top.toLowerCase() != "auto")
                top = parseInt(e.currentStyle.top);
                
            if (e.currentStyle.bottom && e.currentStyle.bottom.toLowerCase() != "auto")
                bottom = parseInt(e.currentStyle.bottom);

            if (e.currentStyle.position.toLowerCase() == "absolute") {
                if (e.currentStyle.right && e.currentStyle.right.toLowerCase() != "auto" && e.currentStyle.left && e.currentStyle.left.toLowerCase() != "auto") {
                    var Parent = FindWidthSizedParent(e);
                    
                    if (Parent) {
                        var BorderWidth = 0;
                        if (e.currentStyle.borderRightWidth)
                            BorderWidth = parseInt(e.currentStyle.borderRightWidth);                           
                        
                        if (e.currentStyle.borderLeftWidth)
                            BorderWidth += parseInt(e.currentStyle.borderLeftWidth);
                            
                        if (BorderWidth.toString() == "NaN")
                            BorderWidth = 0;
                        
                        e.style.width = Parent.offsetWidth - right - left - BorderWidth;
                    }
                } 
                    
                if (e.currentStyle.bottom && e.currentStyle.bottom.toLowerCase() != "auto" && e.currentStyle.top && e.currentStyle.top.toLowerCase() != "auto") {
                    var Parent = FindHeightSizedParent(e);
                    
                    if (Parent) {
                        var BorderHeight = 0;
                        if (e.currentStyle.borderBottomWidth)
                            BorderHeight = parseInt(e.currentStyle.borderBottomWidth) + 1;
                        
                        if (e.currentStyle.borderTopWidth)
                            BorderHeight += parseInt(e.currentStyle.borderTopWidth) + 1;

                        if (BorderHeight.toString() == "NaN")
                            BorderHeight = 0;
                            
                        
                        e.style.height = Parent.offsetHeight - bottom - top - BorderHeight;
                    } else {
						if (parseFloat(document.documentElement.clientHeight /2) == parseInt(document.documentElement.clientHeight /2)) {
							e.style.height = document.documentElement.clientHeight - bottom - top;
                        } else {
							e.style.height = document.documentElement.clientHeight - bottom - top - 1;
                        }
                    }
                }
            }
        }
        
        for(var i = 0; i < e.childNodes.length; i++) {
            FixElement(e.childNodes[i], Load);
        }
    }
    
    function FindWidthSizedParent(e) {
        if (!e.parentNode) {
            return null;
        } else if (e.parentNode.currentStyle && e.parentNode.currentStyle.width && e.parentNode.currentStyle.width.toLowerCase() != "auto" && e.parentNode.offsetWidth > 0) {
            return e.parentNode;
        } else {
            return FindWidthSizedParent(e.parentNode);
        }
    }

    function FindHeightSizedParent(e) {
        if (!e.parentNode) {
            return null;
        } else if (e.parentNode.currentStyle && e.parentNode.currentStyle.height && e.parentNode.currentStyle.height.toLowerCase() != "auto" && e.parentNode.offsetHeight > 0) {
            return e.parentNode;
        } else {
            return FindHeightSizedParent(e.parentNode);
        }
    }       

    //Email obviscation functions
    var tld_ = new Array()
    tld_[0] = "com";
    tld_[1] = "org";
    tld_[2] = "net";
    tld_[3] = "ws";
    tld_[4] = "info";
    tld_[10] = "co.uk";
    tld_[11] = "org.uk";
    tld_[12] = "gov.uk";
    tld_[13] = "ac.uk";
    var topDom_ = 13;
    var m_ = "mailto:";
    var a_ = "@";
    var d_ = ".";

    function mail(name, dom, tl, params) {
	    var s = e(name,dom,tl);
	    document.write('<a href="'+m_+s+params+'">'+s+'</a>');
    }
    function mail2(name, dom, tl, params, display) {
	    document.write('<a href="'+m_+e(name,dom,tl)+params+'">'+display+'</a>');
    }
    function e(name, dom, tl) {
	    var s = name+a_;
	    if (tl!=-2)
	    {
		    s+= dom;
		    if (tl>=0)
			    s+= d_+tld_[tl];
	    }
	    else
		    s+= swapper(dom);
	    return s;
    }
    function swapper(d) {
	    var s = "";
	    for (var i=0; i<d.length; i+=2)
		    if (i+1==d.length)
			    s+= d.charAt(i)
		    else
			    s+= d.charAt(i+1)+d.charAt(i);
	    return s.replace(/\?/g,'.');
    }

    function GetRootPath(Path) {
        if (Path.indexOf('~/') > -1) {
            return strRootPath + Path.substring(2, Path.length);
        } else {
            return Path;    
        }
    }
        
     ///Returns the button that is down in all browsers consistantly. Amazing.
    function GetMouseButton(theEvent) {
        if (theEvent.which && theEvent.which == 1) {
            ButtonDown = true;
        } else if (navigator.appVersion.indexOf("MSIE") != -1) {
            if (theEvent.button) {
                return theEvent.button;
            } else {
                return 0;
            }
        } else {
            if (theEvent.button) {
                if (theEvent.button == 0) {
                    return 1;
                } else if (theEvent.button == 1) {
                    return 4
                } else if (theEvent.button == 2) {
                    return 2;
                } else {
                    return 0;
                }
            } else {
                return 0;
            }
        }
    }
    
    function uppercase(e) {
        var key;
        if (e.keyCode)
            key = e.keyCode;
        else if (e.which) 
            key = e.which;

        
        if ((key > 0x60) && (key < 0x7B)) {
            if (navigator.appVersion.indexOf("MSIE") != -1)
                e.keyCode = key-0x20;
        }
    }
    
    function uppercaseexit(e) {
        e.value = e.value.toUpperCase();
    }

	window.onresize = Resize;
	window.onbeforeprint = BeforePrint;
	window.onafterprint = AfterPrint;