var ACM={};
function $(i){return document.getElementById(i)}
function $$(e,p){p=p||document; return p.getElementsByTagName(e)}
ACM.slideshow=function(n){
this.name=n;
this.infoSpeed=this.imgSpeed=this.speed=10;
this.navOpacity=25;
this.c=0;
this.a=[]
};
ACM.slideshow.prototype={
init: function(s, z, b, f, q, x){
s=$(s);
var lis = $$('li', s);
this.numOfImages=lis.length;
this.q=$(q);
this.f=$(z);
this.r=$(this.info);
if (this.r) this.r.style.display = 'block';
this.t=$(this.title);
this.d=$(this.desc);
this.o = parseInt(ACM.style.val(z, 'width'));
this.z = parseInt(ACM.style.val(z, 'height'));
if (this.thumbs){
if (this.scrollType<=0){
var u=$(this.left), r=$(this.right);
u.onmouseover = new Function('ACM.scroller.init("' + this.thumbs + '",-1,' + this.scrollSpeed + ',0,' + this.spacing + ',' + this.borderSize + ',' + this.scrollInterval + ')');
u.onmouseout = r.onmouseout = new Function('ACM.scroller.cl("' + this.thumbs + '")');
r.onmouseover = new Function('ACM.scroller.init("' + this.thumbs + '",1,' + this.scrollSpeed + ',0,' + this.spacing + ',' + this.borderSize + ',' + this.scrollInterval + ')');
}
this.p=$(this.thumbs);
if (this.p.hasChildNodes()){
while (this.p.childNodes.length>=1){
this.p.removeChild(this.p.firstChild);
}
}
}
var bc;
var w=0, cw=0, maxcw=0;
if (this.thumbs){
bc=this.p.style.backgroundColor;
this.p.style.backgroundColor = '';
this.p.style.width = '100000px';
}
for (var i=0; i<this.numOfImages; i++){
this.a[i]={};
var li=lis[i], a=this.a[i];
a.t = $$('h3', li)[0].innerHTML;
a.tt = $$('h1', li)[0].innerHTML;
a.d = $$('p', li)[0].innerHTML;
a.dd = $$('h2', li)[0].innerHTML;
a.l = $$('a', li)[0] ? $$('a', li)[0].href : '';
a.p = $$('span', li)[0].innerHTML;
if (this.thumbs){
var g = $$('img', li)[0];
this.p.appendChild(g);
cw=ACM.trueWidth(g);
w+=cw;
if (cw>maxcw) maxcw=cw;
if ((this.scrollType>0) || (i !=this.numOfImages-1)){
g.style.marginRight = this.spacing + 'px';
w+=this.spacing;
}
if ((this.thumbOpacity>0) && (this.thumbOpacity<100)){
g.style.opacity=this.thumbOpacity/100;
g.style.filter = 'alpha(opacity=' + this.thumbOpacity + ')';
g.onmouseover = new Function('ACM.alpha.set(this,100,5)');
g.onmouseout = new Function('ACM.alpha.set(this,' + this.thumbOpacity + ',5)');
}
if (this.clickableThumbs != 0) g.onclick = new Function(this.name + '.pr(' + i + ',1)');
}
}
if (b && f){
b=$(b);
f=$(f);
b.style.opacity=f.style.opacity=this.navOpacity/100;
b.style.filter = f.style.filter = 'alpha(opacity=' + this.navOpacity + ')';
b.onmouseover = f.onmouseover = new Function('ACM.alpha.set(this,' + this.navHover + ',5)');
b.onmouseout = f.onmouseout = new Function('ACM.alpha.set(this,' + this.navOpacity + ',5)');
b.onclick = new Function(this.name + '.mv(-1,1)');
f.onclick = new Function(this.name + '.mv(1,1)');
}
this.auto ? this.is(0, 0) : this.pr(x, 1);
if (this.thumbs){
if (this.scrollType>0){
while (this.maxwidth>w-(maxcw+this.spacing)){
w=this.pad(w);
}
this.p.style.width = w + 2 + 'px';
this.p.onmouseout = new Function('ACM.scroller.init("' + this.thumbs + '",' + (this.scrollType == 1 ? 1 : -1) + ',' + this.scrollSpeed + ',1,' + this.spacing + ',' + this.borderSize + ',' + this.scrollInterval + ')');
this.p.onmouseover = new Function('ACM.scroller.cl("' + this.thumbs + '")');
ACM.scroller.init(this.thumbs, this.scrollType==1 ? 1 :-1, this.scrollSpeed, 1, this.spacing, this.borderSize, this.scrollInterval);
}else{
this.p.style.width = w + 2 + 'px';
}
this.p.style.backgroundColor=bc;
$(this.thumbArea).style.backgroundColor=bc;
}
},
pad: function(w){
var j=this.p.children.length;
for (var i=0; i<j; i++){
var g=this.p.children[i];
var g2 = document.createElement("img");
g2.setAttribute('src', g.src);
g2.setAttribute('alt', g.alt);
g2.style.border=g.style.border; g2.style.padding=g.style.padding;
g2.style.width = 'auto'; g2.style.height = g.style.height;
g2.style.cursor=g.style.cursor;
this.p.appendChild(g2);
w+=ACM.trueWidth(g2);
g2.style.marginRight = this.spacing + 'px';
w+=this.spacing;
}
return w;
},
mv: function(d, c){
var t=this.c+d;
this.c=t=t<0 ? this.numOfImages-1 : t>this.numOfImages-1 ? 0 : t;
this.pr(t, c);
},
pr: function(t, c){
clearTimeout(this.lt);
if (c){
clearTimeout(this.at);
}
this.c=t;
this.is(t, c)
},
ps: function(){
clearTimeout(this.lt);
clearTimeout(this.at);
},
nr: function(n, l){
var nn=Math.round(n * Math.pow(10, l))/Math.pow(10, l);
return nn;
},
is: function(s, c){
if (this.info){
ACM.height.set(this.r, 1, this.infoSpeed / 2, -1, 'is')
}
var i=this.gi();
this.i=i;
i.onload = new Function(this.name + '.le(' + s + ',' + c + ')');
if (s<this.a.length){
i.src=this.a[s].p;
if ((this.thumbs) && (this.active != '')) {
var a = $$('img', this.p), l = a.length, x = 0;
for (x; x<l; x++){
a[x].style.borderColor = x != s ? '' : this.active;
}
}
}
},
gi: function(){
var i=new Image();
if (this.fx==1){
i.style.opacity=0;
i.style.filter = 'alpha(opacity=0)';
}
return i;
},
le: function(s, c){
this.i.onload=null;
var mm = $$('img', this.f);
var wd=this.i.width-(this.maxwidth-(this.borderSize * 2));
var hd=this.i.height-(this.maxheight-(this.borderSize * 2));
if ((wd>0) || (hd>0)){
if (wd<0) wd=0; if (hd<0) hd=0;
var wp=this.nr(wd/this.i.width, 2);
var hp=this.nr(hd/this.i.height, 2);
if (wp>hp){
this.i.width=(this.maxwidth-(this.borderSize * 2));
this.i.style.height = 'auto';
}else{
this.i.height=(this.maxheight-(this.borderSize * 2));
this.i.style.width = 'auto';
}
}
this.si(this.i);
var n = new Function(this.name + '.nf(' + s + ')');
this.lt=setTimeout(n, this.imgSpeed * 100);
if (!c){
this.at = setTimeout(new Function(this.name + '.mv(1,0)'), this.speed * 1000);
}
if (this.a[s].l != '') {
this.i.onclick = new Function('window.open("' + this.a[s].l + '")');
this.i.onmouseover = new Function('this.className="' + this.link + '"');
this.i.onmouseout = new Function('this.className=""');
this.i.style.cursor = 'pointer';
}else{
this.i.onclick=this.q.onmouseover=null;
this.i.style.cursor = 'default';
}
var m = $$('img', this.f);
while (m.length>2){
this.hi(m[m.length-1], 0);
}
if (m.length>1){
this.hi(m[0], this.fx);
}
if (this.t !=null){
this.t.innerHTML=this.a[s].t;
}
if (this.d !=null){
this.d.innerHTML=this.a[s].d;
}
},
nf: function(s){
if (this.info){
s=this.a[s];
$$('h3', this.r)[0].innerHTML = s.tt;
$$('p', this.r)[0].innerHTML = s.dd;
this.r.style.height = 'auto';
var h=parseInt(this.r.offsetHeight);
this.r.style.height = 1 + 'px';
ACM.height.set(this.r, h, this.infoSpeed, 0, 'nf');
}
},
si: function(i){
this.i.style.border=this.imageBorder;
this.f.appendChild(this.i);
var w=this.o-parseInt(this.i.offsetWidth);
if (this.i.offsetHeight<(this.maxheight)){
this.i.style.marginTop = Math.round((this.maxheight - this.i.offsetHeight) / 2) + 'px';
}
if (w>0){
var l=Math.floor(w/2);
this.i.style.marginLeft = l + 'px';
}
if (this.fx==1){
ACM.alpha.set(i, 100, this.imgSpeed, null);
}else if (this.fx==2){
ACM.slide.set(i, 1, this.imgSpeed, i.offsetLeft);
}else if (this.fx==3){
ACM.slide.set(i,-1, this.imgSpeed, i.offsetLeft);
}
},
hi: function(i, fx){
if (fx==1){
i.style.opacity=1;
i.style.filter = 'alpha(opacity=100)';
ACM.alpha.set(i, 0, this.imgSpeed, this.f);
}else{
clearInterval(i.ai);
clearInterval(i.si);
this.f.removeChild(i);
}
}
};
ACM.trueWidth=function(g){
var tw=Math.round(g.getBoundingClientRect().right)-Math.round(g.getBoundingClientRect().left);
var w2=Math.round(g.getBoundingClientRect().right-g.getBoundingClientRect().left);
var w3=g.offsetWidth;
tw=(tw>w2?tw:w2);tw=(tw>w3?tw:w3);
return tw;
};
ACM.slide=function(){
return{
set:function(e,d,s,x){
e=typeof e=='object'?e:$(e);
e.style.marginLeft='0px';
var nl=d>0?e.offsetWidth*-1:parseInt(e.parentNode.style.width);
e.style.left=nl+'px';
e.si=setInterval(function(){ACM.slide.tw(e,d,s,x)},20);
},
tw:function(e,d,s,x){
var l=e.offsetLeft;
if(l==x){
clearInterval(e.si);
}else if((x==0)&&(l==1)){
clearInterval(e.si);
}else{
var nl=l+(s*d);
if((l<nl)&&(nl>x))nl=x;
if((l>nl)&&(nl<x))nl=x;
e.style.left=nl+'px';
}
}
}
}();
ACM.scroller=function(){
return{
init:function(e,d,s,w,m,b,i){
e=typeof e=='object'?e:$(e);
var left=e.style.left||ACM.style.val(e,'left');
e.style.left=left;
var l=d==1?parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth):0;
e.si=setInterval(function(){ACM.scroller.mv(e,l,d,s,w,m,b)},i)
},
mv:function(e,l,d,s,w,m,b){
var c=parseInt(e.style.left);
if(l<0){
ACM.scroller.cl(e);
}else if(c==l){
if(w!=0){
var last=e.lastChild;
e.insertBefore(last,e.firstChild);
var adj=(m-s);
e.style.left=(-1*(ACM.trueWidth(last)+adj))+'px';
}else{
ACM.scroller.cl(e);
}
}else{
var i=Math.abs(l+c);
i=i<s?i:s;
var n=c-i*d;
if(c==n){
if(w!=0){
var first=e.firstChild;
e.appendChild(first);
var adj=(m-s);
e.style.left=(n+ACM.trueWidth(first)+adj)+'px';
}else{
ACM.scroller.cl(e);
}
}else{
e.style.left=n+'px';
}
}
},
cl:function(e){
e=typeof e=='object'?e:$(e);
clearInterval(e.si);
}
}
}();
ACM.height=function(){
return{
set:function(e,h,s,d){
e=typeof e=='object'?e:$(e);
var oh=parseInt(e.style.height||ACM.style.val(e,'height'));
var hd=oh>h?-1:1;
clearInterval(e.si);
e.si=setInterval(function(){ACM.height.tw(e,h,hd,s)},20);
},
tw:function(e,h,hd,s){
var oh=parseInt(e.style.height||ACM.style.val(e,'height'));
if(oh==h){
clearInterval(e.si);
}else{
e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px';
}
}
}
}();
ACM.alpha=function(){
return{
set:function(e,a,s,f){
e=typeof e=='object'?e:$(e);
var o=e.style.opacity||ACM.style.val(e,'opacity');
var d=a>o*100?1:-1;
e.style.opacity=o;
clearInterval(e.ai);
e.ai=setInterval(function(){ACM.alpha.tw(e,a,d,s,f)},20);
},
tw:function(e,a,d,s,f){
var o=Math.round(e.style.opacity*100);
if(o==a){
clearInterval(e.ai);
if((a==0)&&(f!=null)){
f.removeChild(e);
}
}else{
var n=o+Math.ceil(Math.abs(a-o)/s)*d;
e.style.opacity=n/100;
e.style.filter='alpha(opacity='+n+')';
}
}
}
}();
ACM.style=function(){return{val:function(e,p){e=typeof e=='object'?e:$(e); return e.currentStyle?e.currentStyle[p]:document.defaultView.getComputedStyle(e,null).getPropertyValue(p)}}}();
function toggleNavButton(a){
if(a.firstChild.style.display=='none'){
a.firstChild.style.display='inline';
a.lastChild.style.display='none';
}else{
a.firstChild.style.display='none';
a.lastChild.style.display='inline';
}
}
function upNavButton(a){
if(a.firstChild.style.display!='inline'){
a.firstChild.style.display='inline';
a.lastChild.style.display='none';
}
}
function downNavButton(a){
if(a.lastChild.style.display!='inline'){
a.firstChild.style.display='none';
a.lastChild.style.display='inline';
}
}
function playNavButton(){
downNavButton(aNav0);
upNavButton(aNav2);
}
function stopNavButton(){
downNavButton(aNav2);
upNavButton(aNav0);
}
function pauseSlideShow(){
slideshow.ps();
}
function resumeSlideShow(){
slideshow.ps();
slideshow.mv(1,0);
}
function restartSlideShow(){
slideshow.ps();
slideshow.mv(0,0);
}
function backUpSlideShow(){
var m=$$('img',slideshow.f);
if(m.length<2){
slideshow.mv(-1,1);
}
}
function forwardSlideShow(){
var m=$$('img',slideshow.f);
if(m.length<2){
slideshow.mv(1,1);
}
}
function changeSlideShowSpeed(s){
slideshow.speed=s;
}
function setupSlideShow(o,showThumbs,h,w,s,a,fx,showOverlay,ss,st,clickableThumbs,bSize,bColor,thumbSpacing,opac,active,p,smooth){
o.auto=a;
o.speed=s;
if(showThumbs==1){
o.thumbWrapper="thumbwrapper"
o.thumbArea="slidearea"
o.thumbs="slider";
if(st<=0){
o.left="slideleft";
o.right="slideright";
}
}
if(showOverlay==1)o.info="information";
o.title="imgtitle";
o.desc="imgdescription";
o.spacing=thumbSpacing;
o.active=active;
o.maxwidth=w;
o.maxheight=h;
o.fx=fx;
o.scrollType=st;
o.clickableThumbs=clickableThumbs;
o.borderSize=bSize;
o.imageBorder='';if((bSize>0)&&(bColor!=''))o.imageBorder=''+bColor+' '+bSize+'px solid';
o.thumbOpacity=o.navHover=opac;
o.padding=p;
if(ss>9)ss=9;if(ss<1)ss=1;
if(smooth==0){
o.fs=true;
o.scrollSpeed=ss;
o.scrollInterval=20;
}else{
o.fs=false;
var i=40;
for(var xx=2;xx<=ss;xx++)i-=5;
if(i<=0)i=1;
o.scrollSpeed=1;
o.scrollInterval=i;
}
var i=20;
if(!this.fs){
i=40;
for(var ss=2;ss<=this.scrollSpeed;ss++)i-=5;
if(i==0)i=1;
}
}
var slideshow;
function addMyOnloadEvent(fnc){
if(typeof window.addEventListener!="undefined"){
window.addEventListener("load",fnc,false)
}else if(typeof window.attachEvent!="undefined"){
window.attachEvent("onload",fnc)
}else if(window.onload!=null){
var oldOnload=window.onload;
window.onload=function(e){
oldOnload(e);
window[fnc]();
}
}else{
window.onload=fnc;
}
}
addMyOnloadEvent(function(){startSlideShow()});
var clickmessage=String.fromCharCode(169) + ' 2010'
function disableclick(e){
if (document.all){
if (event.button==2||event.button==3){
if (event.srcElement.tagName=="IMG"){
alert(clickmessage);
return false;
}
}
}
else if (document.layers){
if (e.which==3){
alert(clickmessage);
return false;
}
}
else if (document.getElementById)
if (e.which==3&&e.target.tagName=="IMG")
setTimeout("alert(clickmessage)",0)
}
function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}
