// JavaScript Document
document.writeln("<OBJECT ID=\"WebCall\"");
document.writeln(" CLASSID=\"CLSID:CEF68671-C1B9-498F-91DD-FCC141175059\" ");
document.writeln(" CODEBASE=\"http://www.web800.tv/call/anyb2c.cab#version=1,0,6,1\">");
document.writeln("<\/OBJECT>");

//////////////////////////////////////////////////////////////////////////////////	
// AnyB2C WebCall frame
	var IE5 = (document.getElementById && document.all) ? true : false;
	var W3C = (document.getElementById) ? true : false;
	var currIDb = null;	
	var currIDc	= null;
	var currID_keybutton = null;
	var xoff = 0;
	var yoff = 0;	
	var timeID;
	
	var _server, _port, _destination, _serial;

	function trackmouse(evt) {
		if((currIDb != null) && (currIDc != null)) {			
			var x = (IE5) ? event.clientX + document.body.scrollLeft : evt.pageX;
			var y = (IE5) ? event.clientY + document.body.scrollTop : evt.pageY;			
			
			anyb2c_webcall_b.style.left = x + xoff + 'px';
			anyb2c_webcall_b.style.top = y + yoff + 'px';						
			mousemove.style.left = x + xoff + 0 + 'px';
			mousemove.style.top = y + yoff + 0 + 'px';
			keyclose.style.left = x + xoff + 175 + 'px'
			keyclose.style.top = y + yoff + 0 + 'px';
			keycall.style.left = x + xoff + 130 + 'px';
			keycall.style.top = y + yoff + 205 + 'px';
			keyuncall.style.left = x + xoff + 135 + 'px';
			keyuncall.style.top = y + yoff + 213 + 'px';
			keynumber.style.left = x + xoff + 69 + 'px';
			keynumber.style.top = y + yoff + 216 + 'px';
			keynumber1.style.left = x + xoff + 70 + 'px';
			keynumber1.style.top = y + yoff + 213 + 'px';
			keybutton.style.left = x + xoff + 50 + 'px';
			keybutton.style.top = y + yoff + 217 + 'px';
			download.style.left = x + xoff + 130 + 'px';
			download.style.top = y + yoff + 95 + 'px';
			keyMessage1.style.left = x + xoff + 18 + 'px';
			keyMessage1.style.top = y + yoff + 90 + 'px';			
			keyMessage2.style.left = x + xoff + 18 + 'px';
			keyMessage2.style.top = y + yoff + 120 + 'px';			
			keyMessage3.style.left = x + xoff + 18 + 'px';
			keyMessage3.style.top = y + yoff + 120 + 'px';			
			keyMessage4.style.left = x + xoff + 18 + 'px';
			keyMessage4.style.top = y + yoff + 120 + 'px';	
			var popoff = 0;			
			if(is_using)
			{
				popoff = 75;
			}
			anyb2c_webcall_c.style.left = x + xoff + 10 + 'px';
			anyb2c_webcall_c.style.top = y + popoff + yoff + 15 + 'px';			
			key1.style.left = x + xoff + 26 + 'px';
			key1.style.top = y + popoff + yoff + 164 + 'px';
			key2.style.left = x + xoff + 74 + 'px';
			key2.style.top = y + popoff + yoff + 166 + 'px';
			key3.style.left = x + xoff + 120 + 'px';
			key3.style.top = y + popoff + yoff + 164 + 'px';			
			key4.style.left = x + xoff + 26 + 'px';
			key4.style.top = y + popoff + yoff + 180 + 'px';
			key5.style.left = x + xoff + 74 + 'px';
			key5.style.top = y + popoff + yoff + 183 + 'px';
			key6.style.left = x + xoff + 120 + 'px';
			key6.style.top = y + popoff + yoff + 180 + 'px';
			key7.style.left = x + xoff + 26 + 'px';
			key7.style.top = y + popoff + yoff + 197 + 'px';
			key8.style.left = x + xoff + 74 + 'px';
			key8.style.top = y + popoff + yoff + 199 + 'px';
			key9.style.left = x + xoff + 120 + 'px';
			key9.style.top = y + popoff + yoff + 196 + 'px';
			keyx.style.left = x + xoff + 26 + 'px';
			keyx.style.top = y + popoff + yoff + 212 + 'px';
			key0.style.left = x + xoff + 74 + 'px';
			key0.style.top = y + popoff + yoff + 215 + 'px';
			keyj.style.left = x + xoff + 120 + 'px';
			keyj.style.top = y + popoff + yoff + 212 + 'px';			

			return false;
		}
	}

	function stopdrag1() {
		currIDb = null;
		currIDc = null;
		NS6bugfix();
		//mousemove.releaseCapture();
	}

	function grab_id(evt) {
		xoff = parseInt(anyb2c_webcall_b.style.left) - ((IE5) ? event.clientX + document.body.scrollLeft : evt.pageX);
		yoff = parseInt(anyb2c_webcall_b.style.top) - ((IE5) ? event.clientY + document.body.scrollTop : evt.pageY);
		currIDb = anyb2c_webcall_b;
		currIDc = anyb2c_webcall_c;		
	}

	function NS6bugfix(){
		if(!IE5) {
			self.resizeBy(0, 1);
			self.resizeBy(0, -1);
		}
	}
	
//////////////////////////////////////////////////////////////////////////////////	
// AnyB2C WebCall Control
	var is_using = false;
	
	function window_onload() {
	}
	
	function window_onunload() {
		try {
			WebCall.Unload();
		} catch (e) {
		}
	}
	
	function dialup(server, port, destination, serial) {		
		_server = server;
		_port = port;
		_destination = destination;
		_serial = serial;
		
		if (is_using) {
			alert("您现在正在通话中，请挂断后再拨打！");
			
			return;
		}
		timeID = setTimeout("on_timer()", 500);
		
		try 
		{
			var iWidth = event.clientX + document.body.scrollLeft;
			var iHeight = event.clientY + document.body.scrollTop;
			anyb2c_webcall_b.style.left = iWidth + 'px';
			anyb2c_webcall_b.style.top = iHeight + 'px';
			anyb2c_webcall_c.style.left = iWidth + 10 + 'px';
			anyb2c_webcall_c.style.top = iHeight + 15 + 'px';
			mousemove.style.left = iWidth + 0 + 'px';
			mousemove.style.top = iHeight + 0 + 'px';

			keyclose.style.left = iWidth + 175 + 'px'
			keyclose.style.top = iHeight + 0 + 'px';
			keycall.style.left = iWidth + 130 + 'px';
			keycall.style.top = iHeight + 205 + 'px';
			keyuncall.style.left = iWidth + 135 + 'px';
			keyuncall.style.top = iHeight + 213 + 'px';
			keynumber.style.left = iWidth + 69 + 'px';
			keynumber.style.top = iHeight + 216 + 'px';
			keynumber1.style.left = iWidth + 70 + 'px';
			keynumber1.style.top = iHeight + 213 + 'px';
			keybutton.style.left = iWidth + 50 + 'px';
			keybutton.style.top = iHeight + 217 + 'px';
			key1.style.left = iWidth + 26 + 'px';
			key1.style.top = iHeight + 164 + 'px';
			key2.style.left = iWidth + 74 + 'px';
			key2.style.top = iHeight + 166 + 'px';
			key3.style.left = iWidth + 120 + 'px';
			key3.style.top = iHeight + 164 + 'px';			
			key4.style.left = iWidth + 26 + 'px';
			key4.style.top = iHeight + 180 + 'px';
			key5.style.left = iWidth + 74 + 'px';
			key5.style.top = iHeight + 183 + 'px';
			key6.style.left = iWidth + 120 + 'px';
			key6.style.top = iHeight + 180 + 'px';
			key7.style.left = iWidth + 26 + 'px';
			key7.style.top = iHeight + 197 + 'px';
			key8.style.left = iWidth + 74 + 'px';
			key8.style.top = iHeight + 199 + 'px';
			key9.style.left = iWidth + 120 + 'px';
			key9.style.top = iHeight + 196 + 'px';
			keyx.style.left = iWidth + 26 + 'px';
			keyx.style.top = iHeight + 212 + 'px';
			key0.style.left = iWidth + 74 + 'px';
			key0.style.top = iHeight + 215 + 'px';
			keyj.style.left = iWidth + 120 + 'px';
			keyj.style.top = iHeight + 212 + 'px';
			download.style.left = iWidth + 130 + 'px';
			download.style.top = iHeight + 95 + 'px';
			keyMessage1.style.left = iWidth + 18 + 'px';
			keyMessage1.style.top = iHeight + 90 + 'px';			
			keyMessage2.style.left = iWidth + 18 + 'px';
			keyMessage2.style.top = iHeight + 120 + 'px';			
			keyMessage3.style.left = iWidth + 18 + 'px';
			keyMessage3.style.top = iHeight + 120 + 'px';			
			keyMessage4.style.left = iWidth + 18 + 'px';
			keyMessage4.style.top = iHeight + 120 + 'px';			
						
			anyb2c_webcall_b.style.display = "";
			anyb2c_webcall_c.style.display = "";
			mousemove.style.display = "";			
			keyclose.style.display = "";
			keycall.style.display = "";
			keyuncall.style.display = "none";
			keynumber1.style.display = "none";			
			keynumber.style.display = "none";
			keybutton.style.display = "";
			key1.style.display = "";
			key2.style.display = "";
			key3.style.display = "";
			key4.style.display = "";
			key5.style.display = "";
			key6.style.display = "";
			key7.style.display = "";
			key8.style.display = "";
			key9.style.display = "";
			keyx.style.display = "";
			key0.style.display = "";
			keyj.style.display = "";
			download.style.display = "none";
			keyMessage1.style.display = "none";
			keyMessage2.style.display = "none";
			keyMessage3.style.display = "none";
			keyMessage4.style.display = "none";
		} 
		catch (e) 
		{
			is_using = false;			
			if(IE5){
			}
			else 
			{
				alert("请使用IE浏览器，才能完全享受这个功能！");
			}
		}		
	}
	
	function hungup() {
		try {
			WebCall.Hangup();
			WebCall.Unload();
			is_using = false;
			anyb2c_webcall_b.style.display = "none";
			anyb2c_webcall_c.style.display = "none";
			mousemove.style.display = "none";
			download.style.display = "none";
			keyclose.style.display = "none";
			keycall.style.display = "none";
			keyuncall.style.display = "none";
			keynumber1.style.display = "none";			
			keynumber.style.display = "none";
			keybutton.style.display = "none";
			key1.style.display = "none";
			key2.style.display = "none";
			key3.style.display = "none";
			key4.style.display = "none";
			key5.style.display = "none";
			key6.style.display = "none";
			key7.style.display = "none";
			key8.style.display = "none";
			key9.style.display = "none";
			keyx.style.display = "none";
			key0.style.display = "none";
			keyj.style.display = "none";
			keyMessage1.style.display = "none";
			keyMessage2.style.display = "none";
			keyMessage3.style.display = "none";
			keyMessage4.style.display = "none";
		} catch (e) {
			is_using = false;			
			if (IE5) {
			} else {
				alert("请使用IE浏览器，才能完全享受这个功能！");
			}
		}
	}
	
	function on_timer() {	
		//if (is_using) {	
			try {
				switch (WebCall.GetStatus()) {
				case 0:
				case 1:
					download.style.display = "none";
					keyMessage1.style.display = "none";
					keyMessage2.style.display = "none";
					keyMessage3.style.display = "none";
					keyMessage4.style.display = "none";
					is_using = false;
					break;
				case 2:
				case 3:
					download.style.display = "none";
					keyMessage1.style.display = "none";
					keyMessage2.style.display = "";
					keyMessage3.style.display = "none";
					keyMessage4.style.display = "none";
					break;
				case 4:
					download.style.display = "none";
					keyMessage1.style.display = "none";
					keyMessage2.style.display = "none";
					keyMessage3.style.display = "none";
					keyMessage4.style.display = "";
					break;
				case 5:
					download.style.display = "none";
					keyMessage1.style.display = "none";
					keyMessage2.style.display = "none";
					keyMessage3.style.display = "";
					keyMessage4.style.display = "none";
					is_using = false;
					break;	
				}
			} catch (e) {
					download.style.display = "";
					keyMessage1.style.display = "";
					keyMessage2.style.display = "none";
					keyMessage3.style.display = "none";
					keyMessage4.style.display = "none";	
					keycall.style.display = "none";
					keyuncall.style.display = "none";
					keynumber1.style.display = "none";
					keynumber.style.display = "none";
					is_using = false;
			}
			timeID = setTimeout("on_timer()", 500);			
		//}
	}
//////////////////////////////////////////////////////////////////////////////////	
	
	function createPopup(x_, y_) {
		if (W3C) {						
			var webcall_control = '';
						
			webcall_control += '<table align="center" valign="top" boder="0" cellpadding=0 cellspacing=0 align="left" valign="top">';
			webcall_control += '<tr>';
			webcall_control += '<td height="30" align="left" valign="top">';
			webcall_control += '</td>';
			webcall_control += '</tr>';
			webcall_control += '<tr>';
			webcall_control += '<td align="left" valign="top">';
			webcall_control += '<table id="how_to_do" align="center" valign="top" cellpadding="0" cellspacing="0" border="0" width="172">';
			webcall_control += '<tr>';
			webcall_control += '<td height="140" align="center" valign="middle" style="font:12px sans-serif; color:white">';			
			webcall_control += '</td>';
			webcall_control += '</tr>';
			webcall_control += '</table>';
			webcall_control += '</td>';
			webcall_control += '</tr>';			
			webcall_control += '<tr>';
			webcall_control += '<td width="180" align="left" valign="top">';
			webcall_control += '</table>';

			var webcall_frame = '';
			
			var width = 180;
			var height = 230;
			var boxcolor = '#72B251';	
			//数字键盘
			webcall_frame += '<div align="cneter" valign="top" id="anyb2c_webcall_c" style="border:outset 0px; position:absolute; overflow:hidden; display:none">';
			webcall_frame += '<table cellspacing="0" cellpadding="0" border="0" width="169" height="90"><tr><td><img name="n" src="http://www.web800.tv/img/keyBoard.jpg" width="169" height="229" border="0" id="n" alt="" />';
			webcall_frame += '</td></tr></table>';
			webcall_frame += '</div>';			
			//数字键		
			webcall_frame += '<div id="key1" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key1.jpg" widht="42" height="15" onclick="keyclick(\'1\');"></div>';
			webcall_frame += '<div id="key2" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key2.jpg" widht="42" height="14" onclick="keyclick(\'2\');"></div>';
			webcall_frame += '<div id="key3" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key3.jpg" widht="42" height="15" onclick="keyclick(\'3\');"></div>';
			webcall_frame += '<div id="key4" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key4.jpg" widht="42" height="15" onclick="keyclick(\'4\');"></div>';
			webcall_frame += '<div id="key5" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key5.jpg" widht="42" height="14" onclick="keyclick(\'5\');"></div>';
			webcall_frame += '<div id="key6" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key6.jpg" widht="42" height="15" onclick="keyclick(\'6\');"></div>';
			webcall_frame += '<div id="key7" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key7.jpg" widht="42" height="15" onclick="keyclick(\'7\');"></div>';
			webcall_frame += '<div id="key8" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key8.jpg" widht="42" height="14" onclick="keyclick(\'8\');"></div>';
			webcall_frame += '<div id="key9" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key9.jpg" widht="42" height="15" onclick="keyclick(\'9\');"></div>';
			webcall_frame += '<div id="keyx" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/keyx.jpg" widht="42" height="15" onclick="keyclick(\'*\');"></div>';
			webcall_frame += '<div id="key0" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/key0.jpg" widht="42" height="14" onclick="keyclick(\'0\');"></div>';
			webcall_frame += '<div id="keyj" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onmousedown="keydown(this);" onmouseup="keyup(this);"><img src="http://www.web800.tv/img/keyj.jpg" widht="42" height="15" onclick="keyclick(\'#\');"></div>';
			//主界面
			webcall_frame += '<div id="anyb2c_webcall_b" style="border:outset 0px; position:absolute; left:'+x_+'px; top:'+y_+'px; overflow:hidden; display:none">';			
			webcall_frame += '<div><table cellspacing="0" cellpadding="0" border="0" width="187" height="240" background="http://www.web800.tv/img/keyMain.gif"><tr><td>';
			//
			webcall_frame += '<div align="center" valign="top" id="anyb2c_webcall_ov" width:'+width+'px; height:'+(height-20)+'px; style="margin:3px;">';
			webcall_frame += webcall_control;						
			webcall_frame += '</div>';
			webcall_frame += '</td></tr></table></div>';			
			webcall_frame += '</div>';	
			//关闭层
			webcall_frame += '<div id="keyclose" style="width:10px; height:10px; border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onclick="closecall();"></div>';
			//拨打层
			webcall_frame += '<div id="keycall" style="width:62px; height:24px; border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onclick="pull();"></div>';
			//挂断层
			webcall_frame += '<div id="keyuncall" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand" onclick="draw();"><img src="http://www.web800.tv/img/keyUncall.jpg" widht="44" height="15"></div>';
			//显示"分机键"层
			webcall_frame += '<div id="keynumber" style="border:outset 0px; position:absolute; overflow:hidden; display:none"><img src="http://www.web800.tv/img/keyShow.jpg" widht="50" height="17"></div>';
			//显示号码层
			webcall_frame += '<div id="keynumber1" style="border:outset 0px; position:absolute; overflow:hidden; display:none; width:50; color:blue "><input type="text" id="num" name="txtNum" size="5" readonly></div>';			
			//调节音量按钮
			webcall_frame += '<div id="keybutton" style="border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand"; onmousedown="init();" onmousemove="moveit();" onmouseup="stopdrag();"><img src="http://www.web800.tv/img/keyButton.jpg" widht="4" height="8"></div>';
			//消息1
			webcall_frame += '<div id="keyMessage1" style="border:outset 0px; position:absolute; overflow:hidden; display:none;"><img src="http://www.web800.tv/img/keyMessage1.gif"></div>';			
			//消息2
			webcall_frame += '<div id="keyMessage2" style="border:outset 0px; position:absolute; overflow:hidden; display:none;"><img src="http://www.web800.tv/img/keyMessage2.gif"></div>';
			//消息3
			webcall_frame += '<div id="keyMessage3" style="border:outset 0px; position:absolute; overflow:hidden; display:none;"><img src="http://www.web800.tv/img/keyMessage3.gif"></div>';
			//消息4
			webcall_frame += '<div id="keyMessage4" style="border:outset 0px; position:absolute; overflow:hidden; display:none;"><img src="http://www.web800.tv/img/keyMessage4.gif"></div>';
			//下载链接层
			webcall_frame += '<div id="download" style="width:30px; height:20px; border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:hand"; onclick="window.open(\'http://dd.web800.tv/Dongda_Web800_Setup.exe\');"><table width="30" height="20"><tr><td></td></tr></table></div>';
			//鼠标拖动
			webcall_frame += '<div id="mousemove" style="width:170px; heidht:1px; border:outset 0px; position:absolute; overflow:hidden; display:none; cursor:move"; onmousedown="grab_id();"; onmouseup="stopdrag1();";></div>';			
			document.write(webcall_frame);
			
			if (IE5) {
				anyb2c_webcall_ov.style.width = width - 6;
				anyb2c_webcall_ov.style.height = height - 26;
				anyb2c_webcall_ov.style.scrollbarBaseColor = boxcolor;
				anyb2c_webcall_ov.style.overflow = "auto";
			} else {
			}					
		}
	}

	if (IE5) {
		document.onmousemove = trackmouse;
		window.onunload = window_onunload;
	}

	createPopup(0, 0);
	
//以下处理键盘移动
function regenerate()
{
	window.location.reload()
}
function regenerate2()
{
	if (document.layers)
		setTimeout("window.onresize=regenerate",400)
}
if (document.all)
{
	thebody=document.all.anyb2c_webcall_b.style
	themenu=document.all.anyb2c_webcall_c.style
	thekey1=document.all.key1.style
	thekey2=document.all.key2.style
	thekey3=document.all.key3.style
	thekey4=document.all.key4.style
	thekey5=document.all.key5.style
	thekey6=document.all.key6.style
	thekey7=document.all.key7.style
	thekey8=document.all.key8.style
	thekey9=document.all.key9.style
	thekeyx=document.all.keyx.style
	thekey0=document.all.key0.style
	thekeyj=document.all.keyj.style
}
else{
	thebody=document.layers.anyb2c_webcall_b
	themenu=document.layers.anyb2c_webcall_c		
}
//点击拨打
function pull(){	
	document.all.txtNum.value = "";
	keycall.style.display = "none";
	keyuncall.style.display = "";
	keynumber.style.display = "";
	bottomboundary = thebody.pixelTop + 90;
	if (window.drawit)
		clearInterval(drawit)
	pullit=setInterval("pullengine()",1)
	
	is_using = true;
	if (0 == WebCall.Load(_server, _port, _destination, _serial) && 0 == WebCall.SetDefaultCodecFormat(3) && 0 == WebCall.Dialup()) {
		setTimeout("on_timer()", 500);
	}
}
//点击挂断
function draw(){
	topboundary = thebody.pixelTop + 15
	clearInterval(pullit)
	drawit=setInterval("drawengine()",1)
	
	keycall.style.display = "";
	keyuncall.style.display = "none";
	keynumber1.style.display = "none";
	keynumber.style.display = "none";		
	download.style.display = "none";
	keyMessage1.style.display = "none";
	keyMessage2.style.display = "none";
	keyMessage3.style.display = "none";
	keyMessage4.style.display = "none";
	
	//挂电话<img src="">	
	WebCall.Hangup();
	WebCall.Unload();
	is_using = false;
}
//弹出分机键盘
function pullengine(){	
	if (document.all&&themenu.pixelTop<bottomboundary)
	{
		themenu.pixelTop+=15;
		thekey1.pixelTop+=15;
		thekey2.pixelTop+=15;
		thekey3.pixelTop+=15;
		thekey4.pixelTop+=15;
		thekey5.pixelTop+=15;
		thekey6.pixelTop+=15;
		thekey7.pixelTop+=15;
		thekey8.pixelTop+=15;
		thekey9.pixelTop+=15;
		thekeyx.pixelTop+=15;
		thekey0.pixelTop+=15;
		thekeyj.pixelTop+=15;
	}
	else if(document.layers&&themenu.top < bottomboundary)
		themenu.top+=5
	else if (window.pullit)
		clearInterval(pullit)
}
//合上分机键盘
function drawengine()
{	
	if (document.all&&themenu.pixelTop>topboundary)
	{
		themenu.pixelTop-=15;
		thekey1.pixelTop-=15;
		thekey2.pixelTop-=15;
		thekey3.pixelTop-=15;
		thekey4.pixelTop-=15;
		thekey5.pixelTop-=15;
		thekey6.pixelTop-=15;
		thekey7.pixelTop-=15;
		thekey8.pixelTop-=15;
		thekey9.pixelTop-=15;
		thekeyx.pixelTop-=15;
		thekey0.pixelTop-=15;
		thekeyj.pixelTop-=15;
	}
	else if(document.layers&&themenu.top > topboundary)
		themenu.top-=5
	else if (window.drawit)
		clearInterval(drawit)		
}
//数字按下
function keydown(key)
{
	key.style.pixelLeft+=1;
	key.style.pixelTop+=1;	
}
//数字抬起
function keyup(key)
{
	key.style.pixelLeft-=1;
	key.style.pixelTop-=1;
}
//数字点击
function keyclick(num)
{	
	keynumber1.style.display = "";
	document.all.txtNum.value += num;
	WebCall.SendDTMF(String(num));
}
//关闭
function closecall()
{
	anyb2c_webcall_b.style.display = "none";
	anyb2c_webcall_c.style.display = "none";
	mousemove.style.display = "none";
	download.style.display = "none";
	keyclose.style.display = "none";
	keycall.style.display = "none";
	keyuncall.style.display = "none";
	keynumber1.style.display = "none";	
	keynumber.style.display = "none";
	keybutton.style.display = "none";
	key1.style.display = "none";
	key2.style.display = "none";
	key3.style.display = "none";
	key4.style.display = "none";
	key5.style.display = "none";
	key6.style.display = "none";
	key7.style.display = "none";
	key8.style.display = "none";
	key9.style.display = "none";
	keyx.style.display = "none";
	key0.style.display = "none";
	keyj.style.display = "none";
	keyMessage1.style.display = "none";
	keyMessage2.style.display = "none";
	keyMessage3.style.display = "none";
	keyMessage4.style.display = "none";		
	
	clearTimeout(timeID);

	return hungup();
}

var x,down=false;
function init()
{ 	
	keybutton.setCapture();            //设置属于当前对象的鼠标捕捉
	x=event.offsetX;   //获取鼠标指针位置相对于触发事件的对象的X坐标 	
	down=true;         //布尔值，判断鼠标是否已按下，true为按下，false为未按下 
}

function moveit()
{	
	if(down) 
	{
		var iLeft = event.x-x-parseInt(anyb2c_webcall_b.style.left);
		if(iLeft >= 20 && iLeft <= 50)
		{
			keybutton.style.left=event.x-x;
		}
	}
} 
function stopdrag()
{ 
	down=false;  	
	keybutton.releaseCapture(); //释放当前对象的鼠标捕捉 
} 
var access_host = document.domain; //统计域名地址（不包括http://）
var stat_host = "http:\/\/china.web800.tv"; //主机地址（包括http://）
var stat_path = "\/ip_stat.php"; //ip_stat.php文件的路径

var stat_script = "<script language='javascript' src='" + stat_host + stat_path + "?host=" + access_host + "&x_resolution=" +  screen.width + "&y_resolution=" + screen.height + "'><\/script>";

document.write(stat_script);
