function moveAlong(layerName, paceLeft, paceTop, fromLeft, fromTop){
	clearTimeout(eval(layerName).timer)
	if(eval(layerName).curLeft != fromLeft){		
		if((Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft)) < paceLeft){eval(layerName).curLeft = fromLeft}
		else if(eval(layerName).curLeft < fromLeft){eval(layerName).curLeft = eval(layerName).curLeft + paceLeft}
			else if(eval(layerName).curLeft > fromLeft){eval(layerName).curLeft = eval(layerName).curLeft - paceLeft}		
		document.getElementById(layerName).style.left = eval(layerName).curLeft+"px";		
	}
	if(eval(layerName).curTop != fromTop){
		alert("top");
   		if((Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop)) < paceTop){eval(layerName).curTop = fromTop}
		else if(eval(layerName).curTop < fromTop){eval(layerName).curTop = eval(layerName).curTop + paceTop}
			else if(eval(layerName).curTop > fromTop){eval(layerName).curTop = eval(layerName).curTop - paceTop}
		document.getElementById(layerName).style.top = eval(layerName).curTop+"px";
	}
	eval(layerName).timer=setTimeout('moveAlong("'+layerName+'",'+paceLeft+','+paceTop+','+fromLeft+','+fromTop+')',30)
}
function setPace(layerName, fromLeft, fromTop, motionSpeed){
	eval(layerName).gapLeft = (Math.max(eval(layerName).curLeft, fromLeft) - Math.min(eval(layerName).curLeft, fromLeft))/motionSpeed;	
	eval(layerName).gapTop = (Math.max(eval(layerName).curTop, fromTop) - Math.min(eval(layerName).curTop, fromTop))/motionSpeed;	
	moveAlong(layerName, eval(layerName).gapLeft, eval(layerName).gapTop, fromLeft, fromTop);	
}
function FixY(){
	var diffY;
	if (document.documentElement && document.documentElement.scrollTop){
		diffY = document.documentElement.scrollTop;
	}else if (document.body){
		diffY = document.body.scrollTop;
	}
	diffY +=85;
	sidemenu.style.top = diffY+"px";	
}
function expand(){		
  	if(expandState == 0){
	  	setPace('webcall', 0, 10, 10); 	  	
		document.getElementById("expandImg").src ='images/expand1.gif';		 
		expandState = 1;
	}else{
		setPace('webcall', -130, 10, 10); 		
		document.getElementById("expandImg").src='images/expand2.gif';		
		expandState = 0;
	}
}

var webcallUrl='floatBody.php';
var webcallStr='<style type=text/css> #webcall {left: -130px; top: 25px; position: absolute; z-index: 999}</style>'
				+'<table id="webcall" style="width:138px;" cellSpacing="0" cellPadding="0" border="0">'
				+'<tbody>'
				+'    <tr height="6px">'
				+'      <td height="6px"><img height="6px" src="images/top.gif" width="130" border="0"></td>'
				+'      <td valign="top" rowspan="2"><img id="expandImg" onmouseover="expand()" height="129" src="images/expand2.gif" width="24" border="0" /></td>'
				+'    </tr>'
				+'    <tr height="100px">'
				+'      <td style="vertical-align:top; padding:0px;">'
				+'	  		<table style="width:100%; " cellSpacing=0 cellPadding=0>'
				+'				<tbody>'
				+'                 <tr>'
				+'                   <td ><iframe  name="laoxu" src="'+webcallUrl+'" style=" left:0px; top:0px;" frameBorder=0 width="100%" scrolling=no onload="this.height=laoxu.document.body.scrollHeight"></iframe></td>'
				+'                 </tr>'
				+'              </tbody>'
				+'			</table>'
				+'		</td>'
				+'    </tr>'
				+'  </tbody>'
				+'</table>';
document.write(webcallStr);
var webcall = new Object('element')
webcall.curLeft = -130;
webcall.curTop = 10;
webcall.gapLeft = 0;
webcall.gapTop = 0;
webcall.timer = null;
var sidemenu = document.getElementById('webcall');
setInterval('FixY()',100);
var expandState = 0;
