// catleg.org , member play
// firefox / IE6 okay, 2007.6 happyman
// circle play
var msg=Array();
var ii=0;

for(var i=0;i< document.links.length ;i++) {
    var member=document.links[i];
    var str=member.toString();
    if (str.indexOf("/Profiles") != -1 )
        msg[ii++]=member;
}


// Circling text trail 
//Visit http://www.rainbow.arch.scriptmania.com for this script and more
// your message here
// var msg='Rainbow Arch Scripts!';

var font='Verdana,Arial';
var size=3; // up to seven
var color='#000000';

// This is not the rotation speed, its the reaction speed, keep low!
// Set this to 1 for just plain rotation w/out drag
var speed=.3;

// This is the rotation speed, set it negative if you want
// it to spin clockwise
var rotation= .02; // slow 

// Alter no variables past here!, unless you are good
//---------------------------------------------------

function Moving() {
           if (moving == 0 ) return;
	   moving=0;
           setTimeout("moving=1",1000);
}

var ns=(document.layers);
var okbrowser=(document.getElementById);
// var msg=msg.split('');
var n=msg.length; 
var a_width=size*100;
var currStep=0;
var ymouse=450;
var xmouse=630;
var scrll=0;
// var props="<font face="+font+" size="+size+" color="+color+">";

var moving=1;

/* writes the DIV
*/
if (okbrowser){
		document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
		for (i=0; i < n; i++) {
			document.write('<div id="iemsg_' + i + '" style="position:absolute;top:0px;left:0;height:'+a_width +';width:'+a_width +';text-align:center;">' + 
 '<img src="http://happyman.idv.tw/catleg/map/twmap/img/cats.php" border=0>' +
            '<a href="' + msg[i] + '"><div style="background:#FFFFFF none repeat scroll 0% 50%; ' +
 ' border-bottom:1px solid #CCCCCC; ' +
 'color:#990033; ' +
 ' font-size:12pt; ' +
 ' line-height:20px; margin:0px; text-decoration: none; width:100px" onMouseOver="Moving()">' +
		    msg[i].innerHTML+'</div></a></div>');
                }
				document.write('</div></div>');
}


y=new Array();
x=new Array();
Y=new Array();
X=new Array();

for (i=0; i < n; i++){
	y[i]=0;
	x[i]=0;
	Y[i]=0;
	X[i]=0;
}
var degree=Math.PI*360/n;

function makecircle(){ // rotation properties
/*
fix position
if (okbrowser) {
   var scrollTop = (document.documentElement&&document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
   document.getElementById("outer").style.top=scrollTop + "px";
}
*/
currStep-=rotation;
	for (i=0; i < n; i++){ // makes the circle
		// var d=(ns)?document.layers['nsmsg'+i]:iemsg[i].style;
		var d=document.getElementById("iemsg_" + i ).style;
		// d.top=y[i]+a*Math.sin((currStep+i*1)/3.8)+window.pageYOffset-15;
		var dtop=y[i]+a_width*Math.sin((currStep+i* degree )/3);
		var dleft=x[i]+a_width*Math.cos((currStep+i* degree )/3);  // remove *2 for just a plain circle, not oval
		d.top= dtop + "px";
		d.left= dleft + "px";
	}
}

function drag(){ // makes the resistance
	// scrll=(ns)?window.pageYOffset:0;
	if (moving==1) {
	scrll=0;
	y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
	x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
	for (var i=1; i < n; i++){
		y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
		x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);

	}
	makecircle();
	// not rotation speed, leave at zero
        }
	setTimeout('drag()',0);
}
// if (okbrowser) window.onload=drag;
drag();

