var m3D=function(){var g="";var l=[];var m=[];var n=[];var q=0;var s=0;var t=0;var u=0;var v=0;var z=0;var A=0;var B=0;var C=0;var D=0;var E=0;var F=0;var G="";var H,structure;var I=function(){this.target=0;this.position=0};I.prototype.move=function(a,b){this.position+=(a-this.position)*b};var J={x:new I(),y:new I(),focalLength:300};var K=function(i,p){if(p[0]=="text"){this.img=document.getElementById(p[4]).cloneNode(true);this.img.className="txt";this.img.style.zIndex=Math.round(1100);v.className="b_"+p[4];this.wt=true}else{this.img=document.createElement('img');this.img.className="img";
this.img.src=g+p[0]+(p[0].indexOf(".")>0?"":".png");if(i>=0)t++}H.appendChild(this.img);this.ims=this.img.style;if(i<0){this.particle=true;this.active=true}else{this.moving=true;if(p[6]*1==1)this.originFountain=true;this.active=false;this.startDelay=Math.round(i*(100/structure.length))};
var a=p[1]*20*(p[7]||1);var b=p[2]*5*(p[7]||1);this.point3D={x:a,y:b,z:p[3]*1,x0:p[1]*1,y0:p[2]*1,z0:p[3]*1,vx:a-p[1]*1,vy:b-p[2]*1,vz:0,w:0,h:0,zi:(p[8]||0)*1};
this.id=i;this.xs=1;this.i=0;this.frm=0;this.timeout=0;
this.loading=true;this.loaded=false;if(p[9]||p[10]){this.lx=p[9]*1;this.ly=p[10]*1;
this.sx=p[11]*1;this.sy=p[12]*1;
this.rx=p[13]*1||(Math.random()*Math.PI);
this.lis=true}};K.prototype.animParticle=function(){var p=this.point3D;if(!this.initParticle){this.initParticle=true;this.life=Math.random()*200};
var a=.5/this.life--;p.x+=p.vx;p.y+=p.vy;p.z+=p.vz;
p.vx+=(Math.random()*50-25)*a;p.vy+=(Math.random()*50-25)*a;p.vz+=-Math.random()*a;
if(this.life<0){p.x=p.x0;p.y=p.y0;p.z=p.z0;this.life=200;p.vx=0;p.vy=0;p.vz=0}};K.prototype.animate=function(){if(this.loaded){if(this.active){var p=this.point3D;
if(this.moving){if(this.frm<=100){this.i+=this.xs;p.x-=(p.vx*this.i*.0004);p.y-=(p.vy*this.i*.0004);if(this.i==50)this.xs=-1}else{p.x=p.x0;p.y=p.y0;this.moving=false;if(this.originFountain){for(var i=0;i<n.length;i++){var o=n[i];if(o.particle){o.point3D.x0=p.x0;o.point3D.y0=p.y0;o.point3D.z0=p.z0}}}if(this.remove){H.removeChild(this.img);return false}if(this.wt)z=230}};var x=p.x+J.x.position;var y=p.y+J.y.position;var a=J.focalLength/(J.focalLength+p.z);x*=a;y*=a;if(this.lis){x+=Math.sin(this.frm*this.sx)*this.lx;y+=Math.sin(this.rx+this.frm*this.sy)*this.ly}this.ims.left=Math.round((-J.x.position*.9)+x+C-p.w)+'px';this.ims.top=Math.round((-J.y.position*.9)+y+D-p.h)+'px';this.frm++}else{this.startDelay--;if(this.startDelay<0)this.active=true}}else{if(this.loading){if(this.img.complete){if(!this.particle)u++;this.loading=false;this.point3D.w=this.img.width*.5;this.point3D.h=this.img.height*.5;this.img.style.zIndex=Math.round(1000-(this.particle?-1000:(this.point3D.z0+this.point3D.zi)));v.style.width=Math.round(u/t*235)+'px'}this.timeout++}if(u==t){loaded=true;for(var i=0;i<n.length;i++){var o=n[i];o.loaded=true;o.loading=false;if(o.remove){o.frm=0;o.moving=true}}}if(this.timeout>1000){this.remove=true;this.img.style.display="none";t--}}return true};var L=function(a){var i=0,o;while(o=a[i++]){var b=document.getElementById(o[0])||o[0];if(o.length>3){b.style.width=Math.round(o[3])+"px";b.style.height=Math.round(o[4])+"px"}b.style.left=Math.round(o[1])+"px";b.style.top=Math.round(o[2])+"px"}};var M=function(a){structure=m[a].split(";");for(var i=0;i<structure.length;i++){var p=structure[i].replace(/^\s+/g,'').replace(/\s+$/g,'').split(",");if(p!="")n.push(new K(i,p))}};var N=function(p){if(u==t){z=0;v.style.width="0px";if(p)q=p-1;else q=++q%s;if(G)document.getElementById("d_"+G).src=document.getElementById("n_all").src;document.getElementById("d_"+l[q]).src=document.getElementById("n_"+l[q]).src;G=l[q];var j=0;for(var i=0;i<n.length;i++){var o=n[i];if(!o.particle)o.remove=true}M(q)}};var O=function(){for(var i=0;i<40;i++)n.push(new K(-1,[Math.random()>.7?"sphere_moy_v3":"sphere_min_v3",-999,-999,0,'','',1]));var d=document.getElementById("data");if(d){s=0;for(var i=0,k=0;i<d.childNodes.length;i++){if(d.childNodes[i].nodeType==1){var c=m[s++]=d.childNodes[i].innerHTML;c=c.split(";");c=c[c.length-2].split(',');if(c[c.length-1]!="")l[k++]=c[c.length-1];if(G=="")G=c[c.length-1]}}}M(0)};function addEvent(o,e,f){if(window.addEventListener)o.addEventListener(e,f,false);else if(window.attachEvent)r=o.attachEvent('on'+e,f)}function resize(){var h=document.body.offsetHeight-100;var w=document.body.offsetWidth-267;E=Math.round(27+(document.body.offsetWidth-w)*0);F=Math.round(27+(document.body.offsetHeight-h)*0);C=(w-60)*0.6;D=(h-100)*0.6;document.getElementById("design").style.visibility="visible";L([[H,E,F,w+211,h+50],["br_top",E-2,F-29,5+C*2,30],["br_bottom",E-4,F+D*2,7+C*2,30],["br_left",E-28,F-3,27,7+D*2],["br_right",E+C*2,F-4,27,10+D*2],["c_tr",E+C*2,F-31],["c_tl",E-29,F-30],["c_bl",E-31,3+F+D*2],["c_br",E+C*2,3+F+D*2],["b_preload",E+C-122,10+F+D*2],["ILB_bar",E+C-118,12+F+D*2],["nav",E+C-40,F-19]]);return false};var P=function(){addEvent(H,'mousemove',function(e){if(window.event)e=window.event;A=e.clientX;B=e.clientY});resize();addEvent(window,'resize',resize);H.onselectstart=function(){return false};H.ondrag=function(){return false};H.ondblclick=function(){return false}};var Q=function(){J.x.move(A-C-E,.1);J.y.move(B-D-F,.1);var i=0,o;while(o=n[i++]){if(o.particle)o.animParticle();if(!o.animate())n.splice(--i,1)}if(z){z*=.9;if(z<1)z=0;v.style.width=Math.round(z)+"px"}setTimeout(Q,16)};return{init:function(){addEvent(window,'load',function(){if(!document.getElementById('ie6')){H=document.getElementById("screen");v=document.getElementById('ILB_bar');P();O();Q()}})},button:function(o,a,i){if(i!=q){if(!a)a="b_"+l[q];o.src=document.getElementById(a).src}},next:function(){N()},goto:function(p){if(p!=q)N(p+1)}}}();m3D.init();
