function build(e,d,a,c,g){var f=document.createElement(e),h,b;if(g!==undefined){f.setAttribute("class",g)}if(d!==undefined){f.style.width=d+"px"}if(a!==undefined){f.style.height=a+"px"}if(c!==undefined){f.style.display=c;if(c==="block"){if(f.style.styleFloat){f.style.styleFloat="left"}else{f.style.cssFloat="left"}}}return f}function position_at_lower_right(a,e){var c,b,g,h,d,i,f;d=a.offsetHeight;h=a.offsetWidth;f=e.offsetHeight;i=e.offsetWidth;b=i-h;g=f-d;a.style.top=(f-d-5)+"px";a.style.left=(750+i-h-5)+"px"}function remove_xbrowser_handler(c,b,a){if(c.removeEventListener){c.removeEventListener(b,a,false)}else{if(c.detachEvent){c.detachEvent("on"+b,a)}else{c["on"+b]=null}}}function attach_xbrowser_handler(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c.attachEvent("on"+b,a)}else{c["on"+b]=a}}}function getXmlHttp(){var a=null;if(window.XMLHttpRequest){a=new XMLHttpRequest();if(a.overrideMimeType){a.overrideMimeType("text/xml")}}else{try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){return null}}}return a}function load_complete(b,d){var a;if(b.readyState==4&&b.status==200){try{a=b.responseXML.getElementsByTagName("Asset");d(a)}catch(c){alert(c.message)}}else{if(b.readyState==4&&b.status!=200){alert("XML Error: XML not found!")}}}function build_from_xml(d,c){var b=getXmlHttp(),a;a=d;if(!b){return}b.open("GET",a,true);b.onreadystatechange=function(){load_complete(b,c)};b.send(null)}function init_banner_display(I,i,G){var C,w,s,f,r,H,h,x,k,D,o,g,F,E,e,q,B,p,j,A;k=i?i:null;g=new Array();H=true;h=false;if(G instanceof String){p=G;j=null}else{j=G;p=null}e=I;q=0;B=I.getElementsByTagName("a")[0];r="play";f=new u();D=new Array();A=4000;F=new Array();E=new Array();function l(b){var L;var K;var J;var c=g;L=b.getElementsByTagName("a");K=L.firstChild;for(J=0;J<L.length;J++){c[J]=new u();c[J].img_file=L[J].getElementsByTagName("img")[0];c[J].img_link=L[J].href}n()}function d(b){var K,J,c=g;J=b;(function L(M){M=M?M:0;c[M]=new u();c[M].img_file=new Image();if(M<J.length){c[M].img_file.onload=function(){if(M+1<J.length){L(M+1)}else{n()}}}c[M].img_file.src=b[M].getElementsByTagName("filename")[0].firstChild.nodeValue;c[M].img_link=b[M].getElementsByTagName("link")[0].firstChild.nodeValue;c[M].img_alt=b[M].getElementsByTagName("alt")[0].firstChild.nodeValue}())}function z(){var L,Q,c,R,b,P;R=null;this.banner_on_state=function(){c.style.background='url("'+b.src+'") no-repeat center'};this.banner_off_state=function(){c.style.background='url("'+P.src+'") no-repeat center'};this.set_container=function(S){if(S===undefined){c=build("div",b.width,b.height);c.style.display="inline-block"}else{c=S;c.style.width=b.width+"px";c.style.height=b.height+"px";c.style.display="inline-block"}};this.get_container=function(){return c};this.set_on_img=function(S){b=S};this.set_off_img=function(S){P=S};this.set_banner_num=function(S){Q=S};this.set_sister_container=function(S){L=S};this.activate=function(){c.style.background='url("'+b.src+'") no-repeat center';R=P;P=b};this.deactivate=function(){if(R!==null){P=R;R=null}c.style.background='url("'+P.src+'") no-repeat center'};function M(){c.style.background='url("'+b.src+'") no-repeat center'}function J(){c.style.background='url("'+P.src+'") no-repeat center'}function N(){c.style.display="none";L.style.display="inline-block";c.style.background='url("'+b.src+'") no-repeat center';r="stop";if(C){clearTimeout(C)}}function K(){c.style.display="none";L.style.display="inline-block";c.style.background='url("'+b.src+'") no-repeat center';r="play";n()}function O(){var S=r;r="stop";if(C){clearTimeout(C)}q=Q.valueOf();r=S;y()}this.set_banner_btn_defaults=function(){attach_xbrowser_handler(c,"mouseover",M);attach_xbrowser_handler(c,"mouseout",J);attach_xbrowser_handler(c,"click",O);J()};this.set_stop_btn_defaults=function(){attach_xbrowser_handler(c,"mouseover",M);attach_xbrowser_handler(c,"mouseout",J);attach_xbrowser_handler(c,"click",N);J()};this.set_play_btn_defaults=function(){attach_xbrowser_handler(c,"mouseover",M);attach_xbrowser_handler(c,"mouseout",J);attach_xbrowser_handler(c,"click",K);J()}}function v(){this.select_on=new Image();this.select_off=new Image();this.stop_on=new Image();this.stop_off=new Image();this.play_on=new Image();this.play_off=new Image()}function u(){this.opacity=0;this.img_alt=null;this.img_path=null;this.img_link=null;this.img_file=null}function a(J,K){var b,c;b=typeof(document.all)!="undefined";c=(b)?"filter":"opacity";K=(b)?"alpha(opacity="+K+")":K/100;J.style[c]=K}function t(c,L,J){var K;if(J!==undefined){K=J}else{K=100}if(w){clearTimeout(w)}(function b(){if((K>0)&&(r==="play")){K-=10;a(c,K);w=setTimeout(b,30)}else{L()}}())}function y(){var M,c,J,O,b,L,N;function K(){B.removeChild(M);a(M,100);B.href=g[q].img_link;if(C){clearTimeout(C)}C=setTimeout(n,A)}M=e.getElementsByTagName("img")[0];M.style.position="absolute";B=e.getElementsByTagName("a")[0];g[q].img_file.style.position="absolute";B.insertBefore(g[q].img_file,M);if(h===true){for(J=0;J<F.length;J++){F[J.valueOf()].deactivate()}F[q.valueOf()].activate()}if(M!==g[q].img_file){t(M,O=K,100)}}function n(){if((H)&&(k)){m();q=g.length-1}if(r==="play"){if((++q)>=g.length){q=0}y()}}function m(){var M,J=0,c=0;H=false;x=new v();F=new Array();E=new Array();function K(){var R;var P;var Q;var O,N;R=document.createElement("div");do{F[c]=new z();F[c].set_on_img(x.select_on);F[c].set_off_img(x.select_off);F[c].set_banner_num(c.valueOf());F[c].set_container();F[c].set_banner_btn_defaults();R.appendChild(F[c.valueOf()].get_container())}while((++c)<g.length);P=document.createElement("div");Q=document.createElement("div");E[0]=new z();E[0].set_on_img(x.stop_on);E[0].set_off_img(x.stop_off);E[0].set_container(P);E[0].set_sister_container(Q);E[0].set_stop_btn_defaults();R.appendChild(E[0].get_container());E[1]=new z();E[1].set_on_img(x.play_on);E[1].set_off_img(x.play_off);E[1].set_container(Q);E[1].set_sister_container(P);E[1].set_play_btn_defaults();E[1].get_container().style.display="none";R.appendChild(E[1].get_container());R.style.position="absolute";R.style.zIndex="2";e.parentNode.insertBefore(R,e);position_at_lower_right(R,e);R.style.position="absolute";F[0].activate();h=true}function b(){if((++J)==6){K()}}for(var L in k){x[L].onload=function(){b()};x[L].src=k[L]}}if(p!==null){build_from_xml(p,d)}else{l(j)}};
