/*************************************
 http://www.nofunc.com/Universal_Fade
 Accepts three variables: 
 id (referencing the HTML)
 ln (length of fade in ms)
 s (0==none || 1==inline)
 **************************************/

function $(v) { return(document.getElementById(v)); }
function $S(v) { return($(v).style); }
function uni(v,id,s,top) { var ob=$S(id),b=v/100; ob.opacity=b; ob.MozOpacity=b; ob.KhtmlOpacity=b; ob.filter="alpha(opacity="+v+")"; }
function zero(v) { v=parseInt(v); return(!isNaN(v)?v:0); }

function fade(id,ln,s) { var top=zero(parseInt($S(id).top));
  mod=2; // looping from 1 to 100 takes up too many resources, mod=2 divides this by two
  function opacity(oStart,oEnd,ln) { var speed=Math.round(ln/100*mod),timer=0;
    
    if(oStart>oEnd) { for(i=oStart; i>=oEnd; i=i-mod) { setTimeout("uni("+i+",'"+id+"','','"+(top--)+"')",timer*speed); timer++; } setTimeout("$S('"+id+"').display='none';",timer*speed); }
    else if(oStart<oEnd) { $S(id).display='inline'; for(i=oStart; i<=oEnd; i=i+mod) { setTimeout("uni("+i+",'"+id+"','"+1+"','"+(top++)+"')",timer*speed); timer++; } }
  //alert("uni("+i+",'"+id+"','','"+(top--)+"')");  exit;
  }

  if(s==1) opacity(0,99,ln); else opacity(99,0,ln);
  
  //if(s==1 || (!s && $S(id).opacity==0)) opacity(0,99,ln); else opacity(99,0,ln);

}

/*
 Osborne Wood Products Banner Config
 Matthew Osborne
 EDIT BELOW THIS LINE
*************************************/ 

// All time values are in milliseconds (1000ms = 1 second)

// When you add/remove a banner, change [count] below and add/remove
// the associated div in header.inc

count   =3;
        //\\ Total number of banners

thisnum =1;
thisnum = Math.floor(Math.random()*count+1)
        //\\ Banner to start with

time    =1000; //ms
         //\\ After page loads, wait this long before starting the first banner
         
fadeIn  =3000; //ms
         //\\ time to spend transitioning to visible
         
interval=5000; //ms
         //\\ time to display the banner
         
fadeOut =500; //ms
         //\\ time to spend transitioning to hidden
         
pause   =100; //ms
         //\\ time to wait whilst showing nothing

/*************************************
 STOP EDITING AT THIS LINE
*/ 

function bannerswap() {
  thisnum++;
  if (thisnum > count) thisnum=1;
  setTimeout('fade("banner" + thisnum,'+fadeIn+',1)',time);
  setTimeout('fade("banner"+thisnum,'+fadeOut+')',interval);
  setTimeout('bannerswap()',interval+pause);
}

thisnum--;

if (typeof(hidemenu) == 'undefined')
  setTimeout('bannerswap()',time);


/*************************************
 End Banner Swap
*/ 



function setStyle( obj, prop, value )
    {
    if (obj && obj.style && obj.style[prop])
        {
        obj.style[prop] = value;
        }
    }

function criteriaFocus(obj)
    {
    if ('Search' == obj.value)
        {
        setStyle(obj, 'color', 'black');
        obj.value = '';
        }
    }

if (typeof deconcept == "undefined")
    {
    var deconcept = new Object()
    }

if (typeof deconcept.util == "undefined")
    {
    deconcept.util = new Object()
    }

if (typeof deconcept.SWFObjectUtil == "undefined")
    {
    deconcept.SWFObjectUtil = new Object()
    }
deconcept.SWFObject = function(L, K, M, E, I, J, H, G, F, D, C)
    {
    if (!document.getElementById)
        {
        return
        }
    this.DETECT_KEY = C ? C : "detectflash";
    this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
    this.params = new Object();
    this.variables = new Object();
    this.attributes = new Array();

    if (L)
        {
        this.setAttribute("swf", L)
        }

    if (K)
        {
        this.setAttribute("id", K)
        }

    if (M)
        {
        this.setAttribute("width", M)
        }

    if (E)
        {
        this.setAttribute("height", E)
        }

    if (I)
        {
        this.setAttribute("version", new deconcept.PlayerVersion(I.toString().split(".")))
        }
    this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();

    if (J)
        {
        this.addParam("bgcolor", J)
        }
    var A = G ? G : "high";
    this.addParam("quality", A);
    this.setAttribute("useExpressInstall", H);
    this.setAttribute("doExpressInstall", false);
    var B = (F) ? F : window.location;
    this.setAttribute("xiRedirectUrl", B);
    this.setAttribute("redirectUrl", "");

    if (D)
        {
        this.setAttribute("redirectUrl", D)
        }
    };
deconcept.SWFObject.prototype =
    {
    setAttribute: function(B, A)
        {
        this.attributes[B] = A
        },
    getAttribute: function(A)
        {
        return this.attributes[A]
        },
    addParam: function(B, A)
        {
        this.params[B] = A
        },
    getParams: function()
        {
        return this.params
        },
    addVariable: function(B, A)
        {
        this.variables[B] = A
        },
    getVariable: function(A)
        {
        return this.variables[A]
        },
    getVariables: function()
        {
        return this.variables
        },
    getVariablePairs: function()
        {
        var B = new Array();
        var A;
        var C = this.getVariables();

        for (A in C)
            {
            B.push(A + "=" + C[A])
            }
        return B
        },
    getSWFHTML: function()
        {
        var B = "";

        if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length)
            {
            if (this.getAttribute("doExpressInstall"))
                {
                this.addVariable("MMplayerType", "PlugIn")
                }
            B = '<embed type="application/x-shockwave-flash" src="' + this.getAttribute("swf") + '" width="'
                + this.getAttribute("width") + '" height="' + this.getAttribute("height") + '"';
            B += ' id="' + this.getAttribute("id") + '" name="' + this.getAttribute("id") + '" ';
            var A = this.getParams();

            for (var F in A)
                {
                B += [F] + '="' + A[F] + '" '
                }
            var E = this.getVariablePairs().join("&");

            if (E.length > 0)
                {
                B += 'flashvars="' + E + '"'
                }
            B += "/>"
            }

        else
            {
            if (this.getAttribute("doExpressInstall"))
                {
                this.addVariable("MMplayerType", "ActiveX")
                }
            B = '<object id="' + this.getAttribute("id")
                + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.getAttribute("width")
                + '" height="' + this.getAttribute("height") + '">';
            B += '<param name="movie" value="' + this.getAttribute("swf") + '" />';
            var D = this.getParams();

            for (var F in D)
                {
                B += '<param name="' + F + '" value="' + D[F] + '" />'
                }
            var C = this.getVariablePairs().join("&");

            if (C.length > 0)
                {
                B += '<param name="flashvars" value="' + C + '" />'
                }
            B += "</object>"
            }
        return B
        },
    write: function(B)
        {
        if (this.getAttribute("useExpressInstall"))
            {
            var A = new deconcept.PlayerVersion(
                [
                6,
                0,
                65
                ]);

            if (this.installedVer.versionIsValid(A) && !this.installedVer.versionIsValid(this.getAttribute("version")))
                {
                this.setAttribute("doExpressInstall", true);
                this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
                document.title = document.title.slice(0, 47) + " - Flash Player Installation";
                this.addVariable("MMdoctitle", document.title)
                }
            }

        if (this.skipDetect || this.getAttribute("doExpressInstall")
            || this.installedVer.versionIsValid(this.getAttribute("version")))
            {
            var C = ( typeof B == "string") ? document.getElementById(B) : B;
            C.innerHTML = this.getSWFHTML();
            return true
            }

        else
            {
            if (this.getAttribute("redirectUrl") != "")
                {
                document.location.replace(this.getAttribute("redirectUrl"))
                }
            }
        return false
        }
    };
deconcept.SWFObjectUtil.getPlayerVersion = function()
    {
    var C = new deconcept.PlayerVersion(
        [
        0,
        0,
        0
        ]);

    if (navigator.plugins && navigator.mimeTypes.length)
        {
        var B = navigator.plugins["Shockwave Flash"];

        if (B && B.description)
            {
            C = new deconcept.PlayerVersion(
                B.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."))
            }
        }

    else
        {
        try
            {
            var A = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
            }
        catch (D)
            {
            try
                {
                var A = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                C = new deconcept.PlayerVersion(
                    [
                    6,
                    0,
                    21
                    ]);

                A.AllowScriptAccess = "always"
                }
            catch (D)
                {
                if (C.major == 6)
                    {
                    return C
                    }
                }

            try
                {
                A = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
                }
            catch (D)
                {
                }
            }

        if (A != null)
            {
            C = new deconcept.PlayerVersion(A.GetVariable("$version").split(" ")[1].split(","))
            }
        }
    return C
    };
deconcept.PlayerVersion = function(A)
    {
    this.major = A[0] != null ? parseInt(A[0]) : 0;
    this.minor = A[1] != null ? parseInt(A[1]) : 0;
    this.rev = A[2] != null ? parseInt(A[2]) : 0
    };
deconcept.PlayerVersion.prototype.versionIsValid = function(A)
    {
    if (this.major < A.major)
        {
        return false
        }

    if (this.major > A.major)
        {
        return true
        }

    if (this.minor < A.minor)
        {
        return false
        }

    if (this.minor > A.minor)
        {
        return true
        }

    if (this.rev < A.rev)
        {
        return false
        }
    return true
    };
deconcept.util =
    {
    getRequestParameter: function(B)
        {
        var D = document.location.search || document.location.hash;

        if (D)
            {
            var A = D.substring(1).split("&");

            for (var C = 0; C < A.length; C++)
                {
                if (A[C].substring(0, A[C].indexOf("=")) == B)
                    {
                    return A[C].substring((A[C].indexOf("=") + 1))
                    }
                }
            }
        return ""
        }
    };
deconcept.SWFObjectUtil.cleanupSWFs = function()
    {
    if (window.opera || !document.all)
        {
        return
        }
    var B = document.getElementsByTagName("OBJECT");

    for (var C = 0; C < B.length; C++)
        {
        B[C].style.display = "none";

        for (var A in B[C])
            {
            if (typeof B[C][A] == "function")
                {
                B[C][A] = function()
                    {
                    }
                }
            }
        }
    };

deconcept.SWFObjectUtil.prepUnload = function()
    {
    __flash_unloadHandler = function()
        {
        };

    __flash_savedUnloadHandler = function()
        {
        };

    if (typeof window.onunload == "function")
        {
        var A = window.onunload;
        window.onunload = function()
            {
            deconcept.SWFObjectUtil.cleanupSWFs();
            A()
            }
        }

    else
        {
        window.onunload = deconcept.SWFObjectUtil.cleanupSWFs
        }
    };

if (typeof window.onbeforeunload == "function")
    {
    var oldBeforeUnload = window.onbeforeunload;
    window.onbeforeunload = function()
        {
        deconcept.SWFObjectUtil.prepUnload();
        oldBeforeUnload()
        }
    }

else
    {
    window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload
    }

if (Array.prototype.push == null)
    {
    Array.prototype.push = function(A)
        {
        this[this.length] = A;
        return this.length
        }
    }
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;