window.addEvent("domready",function() {
	var cssPrefix = "";
	switch(Browser.name) {
		case "safari":
			cssPrefix = "webkit";
			break;
		case "chrome":
			cssPrefix = "webkit";
			break;
		case "firefox":
			cssPrefix = "moz";
			break;
		case "opera":
			cssPrefix = "o";
			break;
		case "ie":
			cssPrefix = "ms";
			break;
	}

	// Spin them rays!
	if(cssPrefix) {
		speed = 0.05;
		var periodical;
		var running = false;
		var rays = $("rays"), d = 0, dir = 1;
		
		var fx = function() {
			d += speed * dir;
			rays.set("style","-" + cssPrefix + "-transform:rotate(" + d + "deg)");
		}
		fx();
		periodical = fx.periodical(20);
		running = true;
		
		
		$('assos').setStyle('cursor', 'pointer');
		$('assos').set('title', 'click to stop rotation');
		
		$("assos").addEvents({
			mouseenter: function() { // 5x! Warp speed!
			//	alert('enter');
				speed = 1.0;
			},
			mouseleave: function() { // Back to normal;
			//	alert('speed');
				speed = 0.05;
			},
			click: function() {
				if (running) {
					$clear(periodical);
					$('assos').set('title', 'click to start rotation');
					running = false;
				} else {
					fx();
					periodical = fx.periodical(20);
					dir = (dir == 1) ? -1 : 1;
					$('assos').set('title', 'click to stop rotation');
					running = true;
				}
			}
		});	
	}
	
});



