// JavaScript Document



function move() {

var dist=findPos(document.getElementById('tdflash')),dist1;
//alert(dist);
//dist=dist/1.74;
//alert(dist/379.6);
	
	
var timer,timer1;
var elapsed=0,elapsed1=0,i=0,i1=0,elapsed2=0,i2=0,elapsed3=0,i3=0;
var apdiv1=document.getElementById("apDiv1");
var apdiv2=document.getElementById("apDiv2");
var img1=document.getElementById("img1");
var fp=document.getElementById("fp");

fp.style.marginLeft=((dist/2.6)*3)+'px';

//var d;

timer=setInterval(function(){
	elapsed++;
	i=i+4;
	//dist=i*5;
//alert(apdiv1.style.marginLeft);
if (elapsed==100) {timer2=setInterval(function(){
	elapsed2++;
	i2=i2+6;
	apdiv2.style.marginLeft=i2+'px';
	if (elapsed2 > dist/5.2) {clearInterval(timer2); apdiv2.style.marginLeft=(dist/2.6)*3+'px'; }
	
}
,1);
}
apdiv1.style.marginLeft=i+'px';
if (elapsed > dist/3.48) {clearInterval(timer); apdiv1.style.marginLeft=(dist/2.6)*3+'px';}

d=apdiv1.style.marginLeft.replace('px','');

//img1.width=img1.width+1;



},2);
	
//fp.style.marginLeft=(dist/2.6)*3+'px';
timer3=setInterval(function(){
	elapsed3++;
	i3=i3+3;
	fp.style.marginTop=i3+'px';
	if (elapsed3 > 210) {clearInterval(timer3);}
	
}
,2);

	
}


function findPos(obj) {
	var curleft = curtop = 0;


	if (obj.offsetParent) {


	do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;


		} while (obj = obj.offsetParent);

	return curleft;
}

}


