var useBSNns; if (useBSNns)
{ if (typeof(bsn) == "undefined")
bsn = {}
var _bsn = bsn;}
else
{ var _bsn = this;}
_bsn.Crossfader = function (divs, fadetime, delay )
{ this.nAct = -1; this.aDivs = divs; for (var i=0;i<divs.length;i++)
{ document.getElementById(divs[i]).style.opacity = 0; document.getElementById(divs[i]).style.position = "absolute"; document.getElementById(divs[i]).style.filter = "alpha(opacity=0)";}
this.nDur = fadetime; this.nDelay = delay; this._newfade();}
_bsn.Crossfader.prototype._newfade = function()
{ if (this.nID1)
clearInterval(this.nID1); this.nOldAct = this.nAct; this.nAct++; if (!this.aDivs[this.nAct]) this.nAct = 0; this.nInt = 50; this.nTime = 0; var p=this; this.nID2 = setInterval(function() { p._fade() }, this.nInt);}
_bsn.Crossfader.prototype._fade = function()
{ this.nTime += this.nInt; var op = this._easeInOut(this.nTime, 0, 1, this.nDur); var ieop = op*100; document.getElementById( this.aDivs[this.nAct] ).style.opacity = op; document.getElementById( this.aDivs[this.nAct] ).style.filter = "alpha(opacity="+ieop+")"; if (this.nOldAct > -1)
{ document.getElementById( this.aDivs[this.nOldAct] ).style.opacity = 1 - op; document.getElementById( this.aDivs[this.nOldAct] ).style.filter = "alpha(opacity="+(100 - ieop)+")";}
if (this.nTime == this.nDur)
{ clearInterval( this.nID2 ); var p=this; this.nID1 = setInterval(function() { p._newfade() }, this.nDelay);}
}
_bsn.Crossfader.prototype._easeInOut = function(t,b,c,d)
{ return c/2 * (1 - Math.cos(Math.PI*t/d)) + b;}
function getObj(name)
{ if (document.getElementById)
{ this.obj = document.getElementById(name); this.style = document.getElementById(name).style;}
else if (document.all)
{ this.obj = document.all[name]; this.style = document.all[name].style;}
else if (document.layers)
{ this.obj = document.layers[name]; this.style = document.layers[name];}
}
function divScroller(id, direction, speed, delay)
{ if (document.getElementById)
{ var scroller = new getObj(id); scroller.style.position = "relative"; scroller.style.overflow = "hidden"; scroller.obj.innerHTML = "<div id=\"" + id + "_inner\">" + scroller.obj.innerHTML + "</div>"; var inner = new getObj(id + "_inner"); inner.style.position = "absolute"; inner.style.left = parseInt(scroller.style.width) + "px"; inner.style.top = parseInt(scroller.style.height) + "px"; if (direction == "h" || direction == "horizontal")
{ scroller.obj.onmouseover = function() { divScroll_onMouseOver(id);}; scroller.obj.onmouseout = function() { divScroll_onMouseOut(id);}; fxpatch = navigator.userAgent.indexOf("Firefox") > -1 ? " left: -9000px;" : ""; spanContent = "<span id=\"" + id + "_widthEval\" style=\"visibility: hidden; position: absolute; top: -100px; left: -1px; z-index: -10; white-space: nowrap;" + fxpatch + "\"><nobr>" + inner.obj.innerHTML + "</nobr></span>"; if (document.createElement)
{ var span = document.createElement('span'); span.innerHTML = spanContent; scroller.obj.appendChild(span);}
else
{ document.write(spanContent);}
var widthEval = new getObj(id + "_widthEval"); inner.style.top = "0px"; inner.style.whiteSpace = "nowrap"; inner.style.width = widthEval.obj.offsetWidth + "px"; limit = parseInt(inner.style.width); setTimeout("divScrollHelperH(\"" + id + "\", " + limit + ", " + speed + ", " + delay + ")", parseInt(speed));}
else if (direction == "v" || direction == "vertical")
{ inner.style.left = "0px"; inner.style.width = parseInt(scroller.style.width) + "px"; limit = inner.obj.getElementsByTagName('div').length * parseInt(scroller.style.height); setTimeout("divScrollHelperV(\"" + id + "\", " + limit + ", " + speed + ", " + delay + ")", parseInt(speed));}
}
}
function divScrollHelperH(id, limit, speed, delay)
{ if (document.getElementById)
{ var scroller = new getObj(id); var inner = new getObj(id + "_inner"); nextTick = speed; if (!inner.style.left) inner.style.left = "0px"; if (parseInt(inner.style.left) < -limit)
{ inner.style.left = parseInt(scroller.style.width) + "px";}
else if (!scroller.obj.pause || scroller.obj.pause == false)
{ inner.style.left = (parseInt(inner.style.left) - 1) + "px";}
setTimeout("divScrollHelperH(\"" + id + "\", " + limit + ", " + speed + ", " + delay + ")", parseInt(nextTick));}
}
function divScrollHelperV(id, limit, speed, delay)
{ var scroller = new getObj(id); var inner = new getObj(id + "_inner"); nextTick = speed; if (!inner.style.top) inner.style.top = "0px"; if (parseInt(inner.style.top) < -limit)
{ inner.style.top = parseInt(scroller.style.height) + "px";}
else
{ inner.style.top = (parseInt(inner.style.top) - 1) + "px";}
if (!(parseInt(inner.style.top) == parseInt(scroller.style.height)) &&
!(parseInt(inner.style.top) == -limit) &&
(parseInt(inner.style.top) % parseInt(scroller.style.height)) == 0)
{ nextTick = delay;}
setTimeout("divScrollHelperV(\"" + id + "\", " + limit + ", " + speed + ", " + delay + ")", parseInt(nextTick));}
function divScroll_onMouseOver(id)
{ var scroller = new getObj(id); scroller.obj.pause = true;}
function divScroll_onMouseOut(id)
{ var scroller = new getObj(id); scroller.obj.pause = false;}
function divScrollItemsStyler(id, direction)
{ var scroller = new getObj(id); var inner = new getObj(id + "_inner"); elements = inner.obj.getElementsByTagName('div'); for (var i = 0; i < elements.length; i++)
{ var item = elements.item(i); item.style.width = scroller.style.width;}
}
