if(self.jvsRunway) jvsRunway();

thedocurl= jvsDocURL();

if(self.docsubcookie) gcid= docsubcookie("pingc", "gcid");
else
	if(self.jvsdocsubcookie2) gcid= jvsdocsubcookie2("pingc", "gcid");

if(gcid== "") {
	gcid= new Date().getTime();
	gcid= ""+ gcid+ "_"+ Math.random()* gcid;
	docsubcookie("pingc", "gcid", gcid)
	}

if(thedocurl.match(/^(http|https):\/\//)) {
	drop= new Image();
	drop.src= "http://pingc.leadware.com/cgi-bin/togencount.pl"+ "?gcid="+ gcid+ "_"+ thedocurl;
	}



var fw, fh;
var sx, sy;
var oball2;
var mball2;
var pball2;

function showball2() {
	mball2= new objMALine("showball2b()", "", "", oball2, fw-parseInt(pball2.width)-24, 97, 1, 300, -1, 30, false, 1);
	mball2.run();
	}

function showball2b() {
//	mball1= new objMAEllips("mball1.reverse(); mball1.run()", "", "", oball1, parseInt((fw-parseInt(pball.width)-24)/2), parseInt((fh-parseInt(pball.height)-24)/2), parseInt((fw-parseInt(pball.width)-24)/3), parseInt((fh-parseInt(pball.height)-24)/1.8), 0, 2, 3, 1, 320, -1, 30, false, 1);
//	mball2= new objMASine("mball2.reverse(); showball2b()", "", "", oball2, fw-parseInt(pball2.width)-24, 97, 14, 0, 8, 1, 300, -1, 30, false, 1);
	mball2= new objMASine("mball2.reverse(); showball2b()", "", "", oball2, parseInt(oball2.left), parseInt(oball2.top), parseInt((fw-parseInt(pball2.width)-20)/2), 0.25, 1, 1, 200, -1, 30, false, 1);
	mball2.run();
	}

function winresize() {
	jvsWinsize();

	fw= jvs.framewidth, fh= jvs.frameheight;
	}

function showball3c() {
	var nx, ny;

	nx= parseInt((fw-parseInt(pball2.width)-20)/2);
	ny= 140-parseInt(pball2.height);
	mball3= new objMALine("mball2.rerun();", "", "", oball2, nx, ny, 1.2, 6, -1, 20, false, 1);
	mball3.run();
	return true;
	}

function winonclick() {
	var nx, ny, tx, ty, sw, sh, tr, dx, dy;

	mball2.freeze()
	sx= parseInt(oball2.left);
	sy= parseInt(oball2.top);
	switch(jvsRunway()) {
		case 1:
			nx= window.event.pageX;
			ny= window.event.pageY;
			break;

		case 2:
			nx= window.event.x;
			ny= window.event.y;
			nx= nx+ document.body.scrollLeft;
			ny= ny+ document.body.scrollTop;
			break;
		}

	sw= parseInt(pball2.width);
	sh= parseInt(pball2.height);
	tx= sx+ sw/2;
	ty= sy+ sh/2;

	tr= Math.sqrt(Math.pow(Math.abs(tx- nx), 2)+ Math.pow(Math.abs(ty- ny), 2));
	dr= pball2.height/2;
	dx= (tx-nx)*dr/tr;
	dy= (ty-ny)*dr/tr;

//	alert("tx= "+ tx+ ", ty= "+ ty+ ", nx= "+ nx+ ", ny= "+ ny+ ", tr= "+ tr+ ", dx= "+ dx+ ", dy= "+ dy);

	if(tr>= dr) {
		nx+= dx;
		ny+= dy;
		}

	nx-= parseInt(parseInt(pball2.width)/2);
	ny-= parseInt(parseInt(pball2.height)/2);

//	oball2.left= nx;
//	oball2.top= ny;
	mball3= new objMALine("showball3c()", "", "", oball2, nx, ny, 1.2, 6, -1, 20, false, 1);
	mball3.run();
	return true;
	}

function main() {
	var i, p, o;

	pball2= objFromLayer("lyball2", "iball2");

	winresize();
	oball2= objLayer("lyball2");
	oball2.zIndex= 5;
	mball2= null;

	oball2.left= parseInt((fw-parseInt(pball2.width)-20)/2);
	oball2.top= 140-parseInt(pball2.height);
	oball2.visibility= show;
	showball2b();
	document.onmousedown= winonclick;
	}

document.write("<layer VISIBILITY=\"hide\" NAME=\"lyball2\">\n");
document.write("<div id=\"lyball2\" style=\"position:absolute; width=29; visibility=hidden;\">\n");
document.write("<img src=\"image/ifootprints.gif\" name=\"iball2\" border=\"0\" width=\"29\" height=\"29\">\n");
document.write("</div>\n");
document.write("</layer>\n");
