
var p=0;var r=250;var origPos=[];var mouseOffset={top:0,left:0};var offset3D={x:180,y:25};function split(){splitToSpan($("#main p b"),"div");splitToSpan($("#main p:gt(1):lt(2)"),"div");splitToSpan($("#main p a"),null);splitToSpan($("#main p:gt(3) span:not([class*=3dpoint])"),null);}
function splitToSpan(toSplit,wrapper){var smsg="";toSplit.each(function(idx){var h=$(this).text();var rpl="";if(wrapper!=null)rpl="<"+wrapper+">";for(var i=0;i<h.length;i++){var x=h.substr(i,1);var sclass=((x!=" ")?"3dpoint":"");rpl+="<span class='"+$(this).attr("class")+" "+sclass+"' style='position: relative;'>"+x+"</span>";}
if(wrapper!=null)rpl+="</"+wrapper+">";$(this).html(rpl);});}
var rotationAngles={x:0,y:0,z:0};var rotationVector={x:0.01,y:0.01,z:0.01};var animationStep=0.05;var objectPoints=[];function setWTLogo(){rotationAngles={x:0,y:0,z:0};rotationVector={x:0,y:0,z:0.03};animationStep=0.03;objectPoints=WTLogo();}
function setSphere(){rotationAngles={x:0,y:0,z:0};rotationVector={x:0.03,y:0.05,z:0.08};animationStep=0.05;objectPoints=MakeSphere(126);}
function setSpiral(){rotationAngles={x:0,y:0,z:0};rotationVector={x:0.03,y:0.05,z:0.08};animationStep=0.05;var sp=Math.PI*4;objectPoints=[];var b=0.078;for(var i=sp;i>0;i-=sp/120){var point={x:b*i*Math.cos(i*2),y:b*i*Math.sin(i*2),z:Math.sin(i/4)};objectPoints.push(point);}}
var animationStopCallback=null;function step(){var o=$("span.3dpoint");var to=Math.PI*2;if(p==0){if(o.length>objectPoints.length){alert("Have "+o.length+" display objects, got only "+objectPoints.length+" in the model");return;}
o.each(function(idx){var pos=$(this).position();origPos[idx]=pos;});}
if(p>to){o.each(function(idx){$(this).css('position','relative').css('left','').css('top','').css('opacity','').css('z-index','0');if($.browser.msie)$(this).get(0).style.removeAttribute('filter');});p=0;if(animationStopCallback!=null){animationStopCallback();}
return;}
var easing=Math.sin((p/to)*Math.PI);o.each(function(idx){var op=origPos[idx];var sph=objectPoints[idx];var rotatedPoint=Rotate(sph,rotationAngles.x,rotationAngles.y,rotationAngles.z);var dr=r*easing;var x=rotatedPoint.x*dr;var y=rotatedPoint.y*dr;x-=op.left*easing;y-=op.top*easing;x+=offset3D.x*easing;y+=offset3D.y*easing;$(this).css('left',x+'px');$(this).css('top',y+'px');});p+=animationStep;var p2=Math.PI*2;rotationAngles.z+=rotationVector.z;rotationAngles.y+=rotationVector.y;rotationAngles.x+=rotationVector.x;if(rotationAngles.z>p2)
{rotationAngles.z=(rotationAngles.z%p2);}
if(rotationAngles.y>p2)
{rotationAngles.y=(rotationAngles.y%p2);}
if(rotationAngles.x>p2)
{rotationAngles.x=(rotationAngles.x%p2);}
setTimeout("step()",20);}
function MakeSphere(wantPoints){var sqrtp=Math.sqrt(wantPoints);var sphere=[];for(var ia=0;ia<Math.PI*2;ia+=(Math.PI*2)/sqrtp)
{for(var ib=0;ib<Math.PI;ib+=(Math.PI)/sqrtp)
{var a=ia;var b=ib;var x=Math.cos(a)*Math.sin(b);var y=Math.sin(a)*Math.sin(b);var z=Math.cos(b);var p={x:x,y:y,z:z};sphere.push(p);}}
return sphere;}
function WTLogo(){return[{x:-0.172616873169352,y:1,z:-0.0978147001962237},{x:-0.252337027605676,y:0.932867032443726,z:-0.0978147001962237},{x:-0.305165964664055,y:0.800267077304921,z:-0.0978147001962237},{x:-0.382594907562983,y:0.605920223261446,z:-0.0978147001962237},{x:-0.462127257774931,y:0.40629372296018,z:-0.0978147001962237},{x:-0.520658009337148,y:0.243469416719542,z:-0.0978147001962237},{x:-0.57960975536901,y:0.0223776760896155,z:-0.0978147001962237},{x:-0.580737363232872,y:-0.13096916821961,z:-0.0978147001962237},{x:-0.581707685058819,y:-0.262937240395148,z:-0.0978147001962237},{x:-0.544257566424091,y:-0.398568277463634,z:-0.0978147001962237},{x:-0.504085460312303,y:-0.544055906241493,z:-0.0978147001962237},{x:-0.438464708021062,y:-0.627472282568833,z:-0.0978147001962237},{x:-0.380309173648798,y:-0.701398676683135,z:-0.0978147001962237},{x:-0.246488491051544,y:-0.766080407852491,z:-0.0978147001962237},{x:-0.0991905078024527,y:-0.797902268637928,z:-0.0978147001962237},{x:0.045799831039609,y:-0.801902107358352,z:-0.0978147001962237},{x:0.205005384631787,y:-0.806293987397163,z:-0.0978147001962237},{x:0.349035965635524,y:-0.753519044053292,z:-0.0978147001962237},{x:0.511299206755836,y:-0.638461568506478,z:-0.0978147001962237},{x:0.620489756584881,y:-0.467000224238514,z:-0.0978147001962237},{x:0.674935375008103,y:-0.31748262981257,z:-0.0978147001962237},{x:0.645564750609583,y:-0.197902202528683,z:-0.0978147001962237},{x:0.632977563729532,y:-0.0489511508462756,z:-0.0978147001962237},{x:0.573907657539833,y:0.0192065235092539,z:-0.0978147001962237},{x:0.496613698927176,y:0.108391619595366,z:-0.0978147001962237},{x:0.390582563914469,y:0.20062344796319,z:-0.0978147001962237},{x:0.341369249434144,y:0.282517436296676,z:-0.0978147001962237},{x:0.406403896041808,y:0.330769036644672,z:-0.0978147001962237},{x:0.467243074528656,y:0.368531379802426,z:-0.0978147001962237},{x:0.458851747028222,y:0.4356643473587,z:-0.0978147001962237},{x:0.372837803522472,y:0.488111807086313,z:-0.0978147001962237},{x:0.213397103391022,y:0.448251534238751,z:-0.0978147001962237},{x:0.0555331762267348,y:0.353956989473189,z:-0.0978147001962237},{x:-0.0991905078024527,y:0.26153853065739,z:-0.0978147001962237},{x:-0.185158674028511,y:0.175550018973691,z:-0.0978147001962237},{x:-0.249558698861303,y:0.0724979284701605,z:-0.0978147001962237},{x:-0.195693708498445,y:0.0118880276405724,z:-0.0978147001962237},{x:-0.037690493201079,y:-0.0165987431269742,z:-0.0978147001962237},{x:0.12948108957508,y:-0.0342660342764161,z:-0.0978147001962237},{x:0.223886751840065,y:-0.00699294830890425,z:-0.0978147001962237},{x:0.36025022538362,y:-0.0342660342764161,z:-0.0978147001962237},{x:0.412114318239264,y:-0.201069442521036,z:-0.0978147001962237},{x:0.382341088534736,y:-0.304332812776991,z:-0.0978147001962237},{x:0.343467179123952,y:-0.439160986786266,z:-0.0978147001962237},{x:0.211162624379739,y:-0.525512195378293,z:-0.0978147001962237},{x:0.0686419110882319,y:-0.54825176562111,z:-0.0978147001962237},{x:-0.0476171202357925,y:-0.508451746628869,z:-0.0978147001962237},{x:-0.164225154410117,y:-0.468531611184786,z:-0.0978147001962237},{x:-0.274766329619471,y:-0.339277701310293,z:-0.0978147001962237},{x:-0.357232338319704,y:-0.204195991598109,z:-0.0978147001962237},{x:-0.36756900457764,y:-0.040688938750101,z:-0.0978147001962237},{x:-0.372784093133302,y:0.16083907932298,z:-0.0978147001962237},{x:-0.311547395704857,y:0.352121985697508,z:-0.0978147001962237},{x:-0.264924605744528,y:0.481818018016888,z:-0.0978147001962237},{x:-0.206123885609769,y:0.648042754495147,z:-0.0978147001962237},{x:-0.155833826909683,y:0.790209769830745,z:-0.0978147001962237},{x:-0.122267343131547,y:0.945454219323777,z:-0.0978147001962237},{x:-0.130659061890781,y:0.98531449217134,z:-0.0978147001962237},{x:-0.172616873169352,y:1,z:0.0978147001962237},{x:-0.252337027605676,y:0.932867032443726,z:0.0978147001962237},{x:-0.305165964664055,y:0.800267077304921,z:0.0978147001962237},{x:-0.382594907562983,y:0.605920223261446,z:0.0978147001962237},{x:-0.462127257774931,y:0.40629372296018,z:0.0978147001962237},{x:-0.520658009337148,y:0.243469416719542,z:0.0978147001962237},{x:-0.57960975536901,y:0.0223776760896155,z:0.0978147001962237},{x:-0.580737363232872,y:-0.13096916821961,z:0.0978147001962237},{x:-0.581707685058819,y:-0.262937240395148,z:0.0978147001962237},{x:-0.544257566424091,y:-0.398568277463634,z:0.0978147001962237},{x:-0.504085460312303,y:-0.544055906241493,z:0.0978147001962237},{x:-0.438464708021062,y:-0.627472282568833,z:0.0978147001962237},{x:-0.380309173648798,y:-0.701398676683135,z:0.0978147001962237},{x:-0.246488491051544,y:-0.766080407852491,z:0.0978147001962237},{x:-0.0991905078024527,y:-0.797902268637928,z:0.0978147001962237},{x:0.045799831039609,y:-0.801902107358352,z:0.0978147001962237},{x:0.205005384631787,y:-0.806293987397163,z:0.0978147001962237},{x:0.349035965635524,y:-0.753519044053292,z:0.0978147001962237},{x:0.511299206755836,y:-0.638461568506478,z:0.0978147001962237},{x:0.620489756584881,y:-0.467000224238514,z:0.0978147001962237},{x:0.674935375008103,y:-0.31748262981257,z:0.0978147001962237},{x:0.645564750609583,y:-0.197902202528683,z:0.0978147001962237},{x:0.632977563729532,y:-0.0489511508462756,z:0.0978147001962237},{x:0.573907657539833,y:0.0192065235092539,z:0.0978147001962237},{x:0.496613698927176,y:0.108391619595366,z:0.0978147001962237},{x:0.390582563914469,y:0.20062344796319,z:0.0978147001962237},{x:0.341369249434144,y:0.282517436296676,z:0.0978147001962237},{x:0.406403896041808,y:0.330769036644672,z:0.0978147001962237},{x:0.467243074528656,y:0.368531379802426,z:0.0978147001962237},{x:0.458851747028222,y:0.4356643473587,z:0.0978147001962237},{x:0.372837803522472,y:0.488111807086313,z:0.0978147001962237},{x:0.213397103391022,y:0.448251534238751,z:0.0978147001962237},{x:0.0555331762267348,y:0.353956989473189,z:0.0978147001962237},{x:-0.0991905078024527,y:0.26153853065739,z:0.0978147001962237},{x:-0.185158674028511,y:0.175550018973691,z:0.0978147001962237},{x:-0.249558698861303,y:0.0724979284701605,z:0.0978147001962237},{x:-0.195693708498445,y:0.0118880276405724,z:0.0978147001962237},{x:-0.037690493201079,y:-0.0165987431269742,z:0.0978147001962237},{x:0.12948108957508,y:-0.0342660342764161,z:0.0978147001962237},{x:0.223886751840065,y:-0.00699294830890425,z:0.0978147001962237},{x:0.36025022538362,y:-0.0342660342764161,z:0.0978147001962237},{x:0.412114318239264,y:-0.201069442521036,z:0.0978147001962237},{x:0.382341088534736,y:-0.304332812776991,z:0.0978147001962237},{x:0.343467179123952,y:-0.439160986786266,z:0.0978147001962237},{x:0.211162624379739,y:-0.525512195378293,z:0.0978147001962237},{x:0.0686419110882319,y:-0.54825176562111,z:0.0978147001962237},{x:-0.0476171202357925,y:-0.508451746628869,z:0.0978147001962237},{x:-0.164225154410117,y:-0.468531611184786,z:0.0978147001962237},{x:-0.274766329619471,y:-0.339277701310293,z:0.0978147001962237},{x:-0.357232338319704,y:-0.204195991598109,z:0.0978147001962237},{x:-0.36756900457764,y:-0.040688938750101,z:0.0978147001962237},{x:-0.372784093133302,y:0.16083907932298,z:0.0978147001962237},{x:-0.311547395704857,y:0.352121985697508,z:0.0978147001962237},{x:-0.264924605744528,y:0.481818018016888,z:0.0978147001962237},{x:-0.206123885609769,y:0.648042754495147,z:0.0978147001962237},{x:-0.155833826909683,y:0.790209769830745,z:0.0978147001962237},{x:-0.122267343131547,y:0.945454219323777,z:0.0978147001962237},{x:-0.130659061890781,y:0.98531449217134,z:0.0978147001962237},{x:-0.274766329619471,y:-0.339277701310293,z:0.0978147001962237},{x:-0.357232338319704,y:-0.204195991598109,z:0.0978147001962237},{x:-0.36756900457764,y:-0.040688938750101,z:0.0978147001962237},{x:-0.372784093133302,y:0.16083907932298,z:0.0978147001962237},{x:-0.311547395704857,y:0.352121985697508,z:0.0978147001962237},{x:-0.264924605744528,y:0.481818018016888,z:0.0978147001962237},{x:-0.206123885609769,y:0.648042754495147,z:0.0978147001962237},{x:-0.155833826909683,y:0.790209769830745,z:0.0978147001962237},{x:-0.122267343131547,y:0.945454219323777,z:0.0978147001962237},{x:-0.130659061890781,y:0.98531449217134,z:0.0978147001962237}];}
function Rotate(p,a,b,c){var point={x:0,y:0,z:0};var cosB=Math.cos(b);var cosA=Math.cos(a);var sinA=Math.sin(a);var sinB=Math.sin(b);var sinC=Math.sin(c);var cosC=Math.cos(c);point.x=(cosB*(p.x*cosA+p.y*sinA)-p.z*sinB);point.y=(cosC*(p.y*cosA-p.x*sinA)+
(p.z*cosB+(p.x*cosA+p.y*sinA)*sinB)*sinC);point.z=(cosC*(p.z*cosB+(p.x*cosA+p.y*sinA)*sinB)-
(p.y*cosA-p.x*sinA)*sinC);return point;}
$(document).ready(function(){split();if(document.URL.indexOf("?debug")!=-1){$("body").append("<div style='z-index: 5000; position: absolute; left: 150px;'><a id='linkwtlogo'>wt logo</a> | <a id='linksphere'>sphere</a> | <a id='linkspiral'>spiral</a> | <a id='3dgo'>RUN</a></div>");$("#linkwtlogo").click(function(){setWTLogo();});$("#linksphere").click(function(){setSphere();});$("#linkspiral").click(function(){setSpiral();});$("#3dgo").click(function(e){step();return false;});setSphere();}});var gesturesCanvas;var gesturesColor="#FF0000";var gesturesPreviousPos=null;var gestureMatch=false;var gesturesIsDebug=false;var gesturesEnabled=false;function drawline(previous,cur){var context=document.getElementById('gesturesCanvasElement').getContext('2d');context.strokeStyle=gesturesColor;context.beginPath();context.moveTo(previous.x,previous.y);context.lineTo(cur.x,cur.y);context.closePath();context.stroke();}
function GesturesResize(){gesturesCanvas.hide().css({position:'fixed',top:0,left:0,}).attr({height:$(window).height(),width:$(window).width()}).show();gesturesCanvasDebug.hide().css({position:'fixed',top:0,left:0,}).attr({height:100,width:100}).show();}
function GesturesStart(){if(gesturesIsDebug){$('body').append('<canvas id="gesturesCanvasElement"/>');gesturesCanvas=$('#gesturesCanvasElement');$('body').append('<canvas id="gesturesCanvasDebug" style="border: 1px solid black;"/>');gesturesCanvasDebug=$('#gesturesCanvasDebug');$.each(gesturesData,function(idx,g){var id="gesturesCanvasGesture"+idx;$('body').append('<canvas id="'+id+'" style="float: left; margin-top: 100px; border: 1px solid black; width: 100px; height: 100px; padding: 2px;"/>');var c=document.getElementById(id).getContext('2d');var p=copyPoints(g.points);$.each(p,function(ii,point){point.x=Math.floor((point.x*200)+30);point.y=Math.floor((point.y*100)+25);});drawShape(c,p);});$(window).resize(GesturesResize);GesturesResize();$("body").append("<pre id='console'></pre>");}
$("body").append("<div style='width: 100%; height: 100%; position: absolute; left: 0px; top: 0px; z-index: -5000; overflow: hidden'></div>");GesturesEnable();}
function GesturesEnable(){$('body').mousemove(function(e){gesturesMousePosition={x:e.clientX,y:e.clientY};});gesturesSampleIntervalID=setInterval("GesturesSampleMouse()",70);gesturesEnabled=true;}
var gesturesSampleIntervalID;function GesturesDisable(){$('body').unbind('mousemove');clearTimeout(gesturesSampleIntervalID);gesturesMousePositionHistory=[];gesturesEnabled=false;}
var gesturesMousePosition=null;var gesturesMousePositionPrev=null;var gesturesMousePositionHistory=[];function getGestureColor(i,l){var f=i/l;var d=Math.floor(f*255);var x=(l-i)/l;var g=Math.floor(x*255);var c="#"+d.toString(16)+g.toString(16)+d.toString(16);return c;}
function d2h(x){if(x==0)return"0";return x.toString(16);}
function drawShape(context,points){if(points.length<=2)return;var hasStarted=false;$.each(points,function(idx,pos){context.beginPath();context.strokeStyle=getGestureColor(idx,points.length);if(idx==0){}else{context.moveTo(points[idx-1].x,points[idx-1].y);context.lineTo(pos.x,pos.y);}
context.stroke();});}
function GesturesSampleMouse(){gestureMatch=false;if(gesturesIsDebug){var context=document.getElementById('gesturesCanvasElement').getContext('2d');context.clearRect(0,0,2000,2000);if(gesturesMousePositionHistory.length>1){drawShape(context,gesturesMousePositionHistory);}}
if(gesturesMousePosition!=null)gesturesMousePositionHistory.push(gesturesMousePosition);if(gesturesMousePositionHistory.length>40){gesturesMousePositionHistory.shift();}
if(gesturesMousePositionHistory.length>1){if(gesturesIsDebug){var cc=document.getElementById('gesturesCanvasDebug').getContext('2d');cc.clearRect(0,0,100,100);}
if(TryToMatch(copyPoints(gesturesMousePositionHistory))){gesturesMousePositionHistory=[];}
if(gesturesIsDebug&&gesturesMousePositionHistory.length!=0){var ppp=copyPoints(gesturesMousePositionHistory);recenter(ppp);$.each(ppp,function(idx,point){point.x=point.x*100;point.y=point.y*100;});drawShape(cc,ppp);}}}
function copyPoints(points){var outPoints=[];$.each(points,function(idx,point){outPoints.push({x:point.x,y:point.y});});return outPoints;}
function getMinMax(points){var min={x:5000,y:5000};var max={x:-5000,y:-5000};$.each(points,function(idx,point){min.x=Math.min(point.x,min.x);min.y=Math.min(point.y,min.y);max.x=Math.max(point.x,max.x);max.y=Math.max(point.y,max.y);});return{min:min,max:max};}
function recenter(points){if(points.length<2){return;}
var minMax=getMinMax(points);var min=minMax.min;var max=minMax.max;var avg={x:(min.x+max.x)/2,y:(min.y+max.y)/2};var screenDelta={x:max.x-min.x,y:max.y-min.y};$.each(points,function(idx,point){point.x=point.x-avg.x;point.y=point.y-avg.y;});min.x=min.x-avg.x;min.y=min.y-avg.y;max.x=max.x-avg.x;max.y=max.y-avg.y;var fitMin={x:0,y:0};var fitMax={x:1,y:1};var fmax=Math.max(Math.abs(min.x),Math.abs(min.y),Math.abs(max.x),Math.abs(max.y));$.each(points,function(idx,point){point.x=point.x/fmax;point.x=(point.x/2)+0.5;point.y=point.y/fmax;point.y=(point.y/2)+0.5;});if(screenDelta.x<=10||screenDelta.y<=10)return false;return true;}
function TryToMatch(points){var l=points.length;for(var i=0;i<points.length;i++){if(gestureMatch==true)return;var newPoints=copyPoints(points.slice(i));if(!recenter(newPoints))continue;var bestMatch=null;var bestMatchAvg=1000;$.each(gesturesData,function(idx,data){var m=DoMatching(newPoints,data);if(m<bestMatchAvg){bestMatch=data;bestMatchAvg=m;}});if(bestMatch!=null){bestMatch.onMatch();return true;}}
return false;}
var consoleMsg=0;function ConsoleWrite(msg){if(consoleMsg++>30)ConsoleClear();$("#console").append(msg+"\n");}
function ConsoleClear(){$("#console").html("");consoleMsg=0;}
function DoMatching(screen,gesture){var maxDist=0.20;gestureMatch=false;var i=0;var j=1;var iMax=gesture.points.length-1;var penalty=0;var maxMissedGesturePoints=2;var maxMissedScreenPoints=5;var gestureAdvance=0;var screenAdvance=0;var isMatch=false;var avgDistance=0;while(true){if(gestureAdvance>maxMissedGesturePoints||screenAdvance>maxMissedScreenPoints){break;}
if(j>screen.length-1){break;}
if(i>gesture.points.length-1){break;}
var gesturePoint=gesture.points[i];var screenPoint=screen[j];if(gestureAdvance==0&&(i==0||i==iMax)){var d=pointToSegment(screen[j-1],screen[j],gesturePoint);if(d<maxDist){avgDistance=(avgDistance+d)/2;if(i==iMax){isMatch=true;break;}
i++;continue;}else if(i==iMax){j++;screenAdvance++;continue;}else{break;}}
var d=pointToSegment(gesture.points[i-1],gesture.points[i],screenPoint);if(d<maxDist){avgDistance=(avgDistance+d)/2;j++;gestureAdvance=0;}else{i++;gestureAdvance++;}}
if(isMatch){gesturesMousePositionHistory=[];gestureMatch=true;return avgDistance;}
return 1000;}
function pointToSegment(a,b,p){if(a==null||b==null||p==null){ConsoleWrite("something is null");return 999;}
var dX=b.x-a.x;var dY=b.y-a.y;var segmentLen=Math.sqrt(dX*dX+dY*dY);var halfLen=segmentLen/2;var pX=p.x-a.x;var pY=p.y-a.y;if(segmentLen<0.000001){return Math.sqrt(pX*pX+pY*pY);}
var newX=Math.abs((pX*dX+pY*dY)/segmentLen-halfLen);var newY=Math.abs(-pX*dY+pY*dX)/segmentLen;if(newX>halfLen){newX=newX-halfLen;return Math.sqrt(newX*newX+newY*newY);}
return newY;}
function SetGesturesDebug(){gesturesIsDebug=true;}
var gesturesData=[{onMatch:function(){GesturesDisable();setSphere();step();},points:[{x:0,y:0.5},{x:0.16,y:0.87},{x:0.5,y:1},{x:0.85,y:0.85},{x:1,y:0.5},{x:0.87,y:0.16},{x:0.5,y:0},{x:0.15,y:0.15},{x:0,y:0.5}]},{onMatch:function(){GesturesDisable();setSphere();step();},points:[{x:0,y:0.5},{x:0.15,y:0.15},{x:0.5,y:0},{x:0.87,y:0.16},{x:1,y:0.5},{x:0.85,y:0.85},{x:0.5,y:1},{x:0.16,y:0.87},{x:0,y:0.5}]},{onMatch:function(){GesturesDisable();setWTLogo();step();},points:[{x:0.39,y:0.04},{x:0.24,y:0.45},{x:0.25,y:0.79},{x:0.49,y:0.93},{x:0.77,y:0.78},{x:0.74,y:0.52},{x:0.45,y:0.45}]}];$(document).ready(function(){if(document.URL.indexOf("?debug")!=-1)gesturesIsDebug=true;GesturesStart();animationStopCallback=function(){GesturesEnable();};});$(document).ready(function(){var img=$("#main img");$(img).wrap("<span id='wtLogoInverted'></span>");var s="";s+="#wtLogoInvImg { margin-left: auto; margin-right: auto; width: 266px; text-indent: -9999px; height: 128px; display: block; } ";s+="#wtLogoInv1, #wtLogoInv2, #wtLogoInv3 { float: left; background-image: url('logo.png'); background-repeat: repeat-x; display: block; height: 128px; } ";s+="#wtLogoInv1 { width: 128px; background-position: -138px; } ";s+="#wtLogoInv2 { width: 10px; background-position: -128px; } ";s+="#wtLogoInv3 { width: 128px; background-position: 0px; } ";s+="#wtLogoInverted { margin-left: auto; margin-right: auto; display: block; width: 266px; height: 128px; } ";s+="p, div { clear: left; } ";$("head").append("<style type='text/css'>"+s+"</style>");var wl=$("<span id='wtLogoInvImg'><a id='wtLogoInv1'></a><a id='wtLogoInv2'></a><a id='wtLogoInv3'></a></span>");$("#wtLogoInverted").append(wl);wl.hide();$("#wtLogoInverted").mouseenter(function(){$("#main img").toggle();$("#wtLogoInvImg").toggle();});});