1var radius = 65; 2var d = 200; 3var dtr = Math.PI / 180; 4var mcList = []; 5var lasta = 1; 6var lastb = 1; 7var distr = true; 8var tspeed = 11; 9var size = 200; 10var mouseX = 0; 11var mouseY = 10; 12var howElliptical = 1; 13var aA = null; 14var oDiv = null; 15window.onload=function () 16{ 17 var i=0; 18 var oTag=null; 19 oDiv=document.getElementById('tagscloud'); 20 aA=oDiv.getElementsByTagName('a'); 21 for(i=0;i<aA.length;i++) 22 { 23 oTag={}; 24 aA[i].onmouseover = (function (obj) { 25 return function () { 26 obj.on = true; 27 this.style.zIndex = 9999; 28 this.style.color = '#fff'; 29 this.style.padding = '0px 10px'; 30 this.style.filter = "alpha(opacity=100)"; 31 this.style.opacity = 1; 32 } 33 })(oTag) 34 aA[i].onmouseout = (function (obj) { 35 return function () { 36 obj.on = false; 37 this.style.zIndex = obj.zIndex; 38 this.style.color = '#fff'; 39 this.style.padding = '0px 10px'; 40 this.style.filter = "alpha(opacity=" + 100 * obj.alpha + ")"; 41 this.style.opacity = obj.alpha; 42 this.style.zIndex = obj.zIndex; 43 } 44 })(oTag) 45 oTag.offsetWidth = aA[i].offsetWidth; 46 oTag.offsetHeight = aA[i].offsetHeight; 47 mcList.push(oTag); 48 } 49 sineCosine( 0,0,0 ); 50 positionAll(); 51 (function () { 52 update(); 53 setTimeout(arguments.callee, 40); 54 })(); 55}; 56function update() 57{ 58 var a, b, c = 0; 59 a = (Math.min(Math.max(-mouseY, -size), size) / radius) * tspeed; 60 b = (-Math.min(Math.max(-mouseX, -size), size) / radius) * tspeed; 61 lasta = a; 62 lastb = b; 63 if (Math.abs(a) <= 0.01 && Math.abs(b) <= 0.01) { 64 return; 65 } 66 sineCosine(a, b, c); 67 for (var i = 0; i < mcList.length; i++) { 68 if (mcList[i].on) { 69 continue; 70 } 71 var rx1 = mcList[i].cx; 72 var ry1 = mcList[i].cy * ca + mcList[i].cz * (-sa); 73 var rz1 = mcList[i].cy * sa + mcList[i].cz * ca; 74 75 var rx2 = rx1 * cb + rz1 * sb; 76 var ry2 = ry1; 77 var rz2 = rx1 * (-sb) + rz1 * cb; 78 79 var rx3 = rx2 * cc + ry2 * (-sc); 80 var ry3 = rx2 * sc + ry2 * cc; 81 var rz3 = rz2; 82 83 mcList[i].cx = rx3; 84 mcList[i].cy = ry3; 85 mcList[i].cz = rz3; 86 87 per = d / (d + rz3); 88 89 mcList[i].x = (howElliptical * rx3 * per) - (howElliptical * 2); 90 mcList[i].y = ry3 * per; 91 mcList[i].scale = per; 92 var alpha = per; 93 alpha = (alpha - 0.6) * (10 / 6); 94 mcList[i].alpha = alpha * alpha * alpha - 0.2; 95 mcList[i].zIndex = Math.ceil(100 - Math.floor(mcList[i].cz)); 96 } 97 doPosition(); 98} 99function positionAll() 100{ 101 var phi = 0; 102 var theta = 0; 103 var max = mcList.length; 104 for (var i = 0; i < max; i++) { 105 if (distr) { 106 phi = Math.acos(-1 + (2 * (i + 1) - 1) / max); 107 theta = Math.sqrt(max * Math.PI) * phi; 108 } else { 109 phi = Math.random() * (Math.PI); 110 theta = Math.random() * (2 * Math.PI); 111 } 112 //åæ åæ¢ 113 mcList[i].cx = radius * Math.cos(theta) * Math.sin(phi); 114 mcList[i].cy = radius * Math.sin(theta) * Math.sin(phi); 115 mcList[i].cz = radius * Math.cos(phi); 116 117 aA[i].style.left = mcList[i].cx + oDiv.offsetWidth / 2 - mcList[i].offsetWidth / 2 + 'px'; 118 aA[i].style.top = mcList[i].cy + oDiv.offsetHeight / 2 - mcList[i].offsetHeight / 2 + 'px'; 119 } 120} 121function doPosition() 122{ 123 var l = oDiv.offsetWidth / 2; 124 var t = oDiv.offsetHeight / 2; 125 for (var i = 0; i < mcList.length; i++) { 126 if (mcList[i].on) { 127 continue; 128 } 129 var aAs = aA[i].style; 130 if (mcList[i].alpha > 0.1) { 131 if (aAs.display != '') 132 aAs.display = ''; 133 } else { 134 if (aAs.display != 'none') 135 aAs.display = 'none'; 136 continue; 137 } 138 aAs.left = mcList[i].cx + l - mcList[i].offsetWidth / 2 + 'px'; 139 aAs.top = mcList[i].cy + t - mcList[i].offsetHeight / 2 + 'px'; 140 //aAs.fontSize=Math.ceil(12*mcList[i].scale/2)+8+'px'; 141 //aAs.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+100*mcList[i].alpha+")"; 142 aAs.filter = "alpha(opacity=" + 100 * mcList[i].alpha + ")"; 143 aAs.zIndex = mcList[i].zIndex; 144 aAs.opacity = mcList[i].alpha; 145 } 146} 147function sineCosine( a, b, c) 148{ 149 sa = Math.sin(a * dtr); 150 ca = Math.cos(a * dtr); 151 sb = Math.sin(b * dtr);
152 cb = Math.cos(b * dtr); 153 sc = Math.sin(c * dtr); 154 cc = Math.cos(c * dtr); 155}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.