var IE=document.all?true:false;IE||document.captureEvents(Event.MOUSEMOVE);document.onmousemove=GetMouseXY;var tempX=0,tempY=0,oldTempX,oldTempY,floatDown=false,showPrefs=false,makeSticky=false,makeStream=true,addSpatter=false,useSmoke=false,sizeMultiplier=2,mixColors=false,spreadMultiplier=1,mixTimer,makeBlurry=false,speedFactor=10,makeSlow=false,allowPaint=false,captureArea=false,freeAllButterflies=false,icon=71,showWhiteCircleFirst=false,wandOn=true,randomTimer,marquee;
function AddCss(a){var b=document.createElement("style");b.type="text/css";if(b.styleSheet)b.styleSheet.cssText=a;else b.appendChild(document.createTextNode(a));document.getElementsByTagName("head")[0].appendChild(b)}function randomizeTimer(){randomTimer=9E3+Math.floor(Math.random()*25E3)}
function StartWand(){randomizeTimer();window.setTimeout(DisplayParticles,randomTimer);document.createElement("div");wandDiv=document.createElement("div");wandDiv.style.width="100%";wandDiv.style.height=window.innerHeight+"px";wandDiv.style.position="fixed";wandDiv.style.top="0px";wandDiv.style.left="0px";wandDiv.style.zIndex="1";wandDiv.style.pointerEvents="none";document.body.insertBefore(wandDiv,document.body.firstChild);freeAllButterflies=allowPaint=true;AddCss("\n.wandParticle {\n\tposition: absolute;-webkit-background-size:  0% 0%;pointer-events:  none;\n}\n}\n");
document.onkeydown=function(a){a=window.event||a;switch(a.keyCode){case 17:allowPaint=true;break;case 32:freeAllButterflies=true}};document.onkeyup=function(){};CreateLegend()}
function CreateLegend(){var a=document.createElement("div");AddCss("div#prefs {\n\tcursor:pointer; background: rgba(0,0,0,1);\n\topacity: .7; display: block;\n\twidth: 150px;\n\tline-height: 17px;\n\toverflow: hidden; margin: 0px;\n\tposition: fixed; top: 10px; right: -10px; text-shadow: none;\n\tcolor: #fff; font-size: 12px;\n\t-webkit-transition: all .35s ease-out;\n\t -webkit-border-radius:  6px;\n}\ndiv#prefs {\n\topaciy: 1;\n}\ndiv#prefs h3 {\n\tfont-size: 12px;\n\tfont-weight: normal;\n\tmargin: 0px 0px 10px 0px;\n}\ndiv#prefs div {\n\t-webkit-transition-property: all;\n\topacity: 1; margin: 20px 20px 20px 20px;\n}\n#prefs a {\n\tborder: none;padding:  0px; color: #0ff; text-decoration: none;\n\ttext-wrap: none; display: block; white-space: none;\n}\n#prefs a:hover {\n\tcolor: #fff;\n}\n#prefs a.on {\n\tcolor: #0f0;\n}\n#prefs a.disabled {\n\tcolor: #777;\n\tcursor: default;\n}\ndiv#prefs .disabled {\n\tcursor: default;\n\tpointer-events:  none;\n}\ndiv#prefs .disabled a {\n\tcolor: #777;\n}");a.id=
"prefs";a.onmouseover=function(){showPrefs=true};a.onmouseout=function(){showPrefs=false};a.innerHTML="<div id='contents'><h3>Metamorphasis</h3><a href='javascript:;' onclick='BumpSize();' id='size'>1 &nbsp;&nbsp;size (1-5)</a><a href='javascript:;' onclick='ToggleSpatter();' id='spatter'>spatter (r)</a><a href='javascript:;' class='disabled' style='margin-left: 24px;' onclick='BumpSpread();' id='spread'>1 &nbsp;spread (p)</a><a href='javascript:;' onclick='icon=66;'>bubbles (b)</a><a href='javascript:;' onclick='icon=71;'>grins (g)</a><a href='javascript:;' onclick='icon=83;'>stars (s)</a><a href='javascript:;' onclick='icon=84;'>tiefighters (t)</a><a href='javascript:;' onclick='icon=87;'>wings (w)</a></div>"}
function ToggleSpatter(){document.getElementById("spatter");var a=document.getElementById("spread");addSpatter=!addSpatter;if(addSpatter==true){a.className="";a.disabled="";spatter.className="on"}else{a.className="disabled";a.disabled="";spatter.className=""}}function BumpSize(){if(sizeMultiplier==5)sizeMultiplier=0;sizeMultiplier++;document.getElementById("size").innerHTML=sizeMultiplier+" &nbsp;&nbsp;size (1-5)"}
function BumpSpread(){if(addSpatter==true){if(spreadMultiplier==5)spreadMultiplier=0;spreadMultiplier++;document.getElementById("spread").innerHTML=spreadMultiplier+" &nbsp;spread (p)"}}function ToggleWand(){}var count=1;
function DisplayParticles(){if(tempX!=0&&tempY!=0)if(wandOn&&showPrefs==false&&allowPaint==true&&(makeStream==true||oldTempX!=tempX&&oldTempY!=tempY)){randomizeTimer();window.setTimeout(DisplayParticles,randomTimer);var a=document.createElement("div");a.className="wandParticle";wandDiv.appendChild(a);var b=15*sizeMultiplier+Math.floor(Math.random()*30*sizeMultiplier);a.evolveMe=false;a.style.webkitBorderRadius=b/2+"px";a.style.background="rgba(255,255,255,0 ) center center no-repeat";if(showWhiteCircleFirst==
true)a.style.background="rgba(255,255,255,0.25 ) center center no-repeat";a.style.borderRadius=b/2+"px";a.style.width=b+"px";a.style.height=b+"px";a.id=count;a.notStopMe=true;count++;a.onmouseover=function(){if(allowPaint!=true)a.evolveMe=true};a.onclick=function(){a.notStopMe=true};a.shinkFunction=new function(){var e,f,g,d=function(){if(a.notStopMe==true){a.removeEventListener("webkitTransitionEnd",d,false);window.clearInterval(e);if(icon!=84&&icon!=66)a.style.webkitTransform="rotate("+(-30+Math.floor(Math.random()*
60))+"deg)";a.style.webkitTransition="all 3.5s ease-in";a.style.MozTransition="all 3.5s ease-in";a.style.left=10+Math.floor(Math.random()*wandDiv.offsetWidth)+"px";a.style.top=-a.offsetHeight-2+"px";g=window.setInterval(k,3500)}},c,h=function(){a.removeEventListener("webkitTransitionEnd",h,false);e=window.setInterval(d,0)},k=function(){wandDiv.removeChild(a);window.clearInterval(g)};f=window.setInterval(function(){if(a.evolveMe==true||freeAllButterflies==true){a.style.pointerEvents="none";a.style.opacity=
1;switch(icon){case 65:c=1+Math.floor(Math.random()*12);break;case 87:c=1+Math.floor(Math.random()*8);break;case 71:c=11;break;case 83:c=10;break;case 84:c=9;break;case 66:c=12+Math.floor(Math.random()*2);c!=13&&c!=12&&alert(c)}if(icon!=84&&icon!=66)a.style.webkitTransform="rotate("+(-25+Math.floor(Math.random()*50))+"deg)";if(c==13){a.style.zIndex="-1";a.style.opacity=0.3}a.style.background="rgba(0,0,0,0) url(images/butterfly"+c+".png) center center no-repeat";if(Math.floor(Math.random()*50)>45&&
icon!=66)a.style.backgroundImage="url(images/butterfly12.png), url(images/butterfly"+c+".png)";a.style.webkitTransition="all .25s ease-in";a.style.MozTransition="all .25s ease-in";a.style.webkitBackgroundSize="100% 100%, 80% 80%";a.addEventListener("webkitTransitionEnd",d,false);a.notStopMe==false&&a.addEventListener("webkitTransitionEnd",h,false);window.clearInterval(f)}},0)};oldTempX=tempX;oldTempY=tempY;b=0.2+Math.floor(Math.random()*0.9);var i=0,j=0;if(addSpatter==true)i=Math.floor(Math.random()*
20*sizeMultiplier*spreadMultiplier);if(addSpatter==true)j=Math.floor(Math.random()*20*sizeMultiplier*spreadMultiplier);a.style.opacity=b;a.style.left=tempX-a.offsetWidth/2+i+"px";a.style.top=tempY-a.offsetHeight/2+j+"px"}}function GetMouseXY(a){tempX=a.clientX;tempY=a.clientY;if(tempX<0)tempX=0;if(tempY<0)tempY=0;return true}if(navigator.userAgent.toUpperCase().indexOf("WEBKIT")!=-1)window.load=StartWand();

