var dilingling_url = 'http://www.dilingling.com';
var dilingling_hot_prefix = dilingling_url+'/dll_hotad.php?';
if(typeof dilingling_ad_num == "undefined")
var dilingling_ad_num = 4;
if(typeof dilingling_ad_style == "undefined")
var dilingling_ad_style = 1;
if(typeof dilingling_ad_width == "undefined")
var dilingling_ad_width = 728;
if(typeof dilingling_ad_height == "undefined")
var dilingling_ad_height = 90;
if(typeof dilingling_ad_random == "undefined")
var dilingling_ad_random = 0;
if(typeof dilingling_ad_pic == "undefined")
var dilingling_ad_pic = 0;
if(typeof dilingling_ad_length == "undefined")
var dilingling_ad_length = 0;
if(typeof dilingling_ad_rule == "undefined")
var dilingling_ad_rule = 0;
if(typeof dilingling_ad_mid == "undefined")
var dilingling_ad_mid = 0;
if(typeof dilingling_ad_iframe == "undefined")
var dilingling_ad_iframe = 0;
if(typeof dilingling_iframe_width == "undefined")
var dilingling_iframe_width = 365;
if(typeof dilingling_iframe_height == "undefined")
var dilingling_iframe_height = 100;
if(typeof dilingling_ad_display == "undefined")
var dilingling_ad_display = 1;
if(typeof dilingling_ad_sid == "undefined")
var dilingling_ad_sid = '';
if(typeof listTable == "undefined"){
	var listTable = 1;
} else {
	listTable = listTable+1;
}
if(typeof uplist == "undefined"){
	var uplist = dilingling_ad_num;
} else {
	uplist = uplist+dilingling_ad_num;
}
if(typeof cid == "undefined"){
	var cid;
}
if(typeof s == "undefined"){
	var s;
}
if(typeof dilingling_ad_cid == "undefined"){
	var dilingling_ad_cid = cid;
} else {
	dilingling_ad_cid = cid;
}
if(typeof dilingling_ad_s == "undefined"){
	var dilingling_ad_s = s;
} else {
	dilingling_ad_s = s;
}
function $(sth)
{
	var b = document.getElementById(sth);
	return b;
}
function geturl()
{
	url = dilingling_hot_prefix;
	url += "style=" + dilingling_ad_style;
	url += "&num=" + dilingling_ad_num;
	url += "&listtable=" + listTable;
	url += "&uplist=" + uplist;
	url += "&random=" + dilingling_ad_random;
	url += "&pic=" + dilingling_ad_pic;
	url += "&length=" + dilingling_ad_length;
	url += "&rule=" + dilingling_ad_rule;
	url += "&mid=" + dilingling_ad_mid;
	url += "&iframe=" + dilingling_ad_iframe;
	url += "&display=" + dilingling_ad_display;
	url += "&sid=" + dilingling_ad_sid;
	url += "&cid=" + dilingling_ad_cid;
	url += "&s=" + dilingling_ad_s;
	//	document.write(url);
	return url;
}
function showad()
{
	if(dilingling_ad_style != 36 && dilingling_ad_iframe == 0){
		var dilingling_ad = '<script language="javascript" src="'+geturl()+'"></script>';
	} else {
		var dilingling_ad='<iframe align="middle" marginwidth="0" marginheight="0" scrolling="no"  frameborder="0" width='+dilingling_iframe_width+' height='+dilingling_iframe_height+' allowTransparency src="'+geturl()+'"></iframe>';
	}
	return dilingling_ad;
}
function d2Showad()
{
	include_js(geturl());
}
function dll_show_HTML(dll_gHtml)
{
	$("dilinglingdisplay").innerHTML = dll_gHtml;
}
document.write("<span id=\"dilinglinghot"+listTable+"\"></span>");
if(dilingling_ad_display==1){
	document.write(showad());
} else if(dilingling_ad_display==2) {
	d2Showad();
}
//function include_js(path)
//{
//	var sobj = document.createElement('script');
//	sobj.type = "text/javascript";
//	sobj.src = path;
//	var headobj = document.getElementsByTagName('head')[0];
//	headobj.appendChild(sobj);
//}
function create()
{
	document.write('<div id="detailedSummaryBG" style="display:none;width:365px;height:290px;position:absolute;z-index:10" onMouseOver="javascript:inBoxFlag=true;" onMouseOut="javascript:inBoxFlag=false;" ></div>');
	document.write('<div id="detailedSummaryBox" style="display:none;z-index:11;position:absolute;"><table cellpadding="0" cellspacing="0" border="0" width="330" id="popInnerBox" onMouseOver="javascript:inBoxFlag=true;" onMouseOut="javascript:inBoxFlag=false;" ><tr><td><div id="detailedSummaryContent" onMouseOver="javascript:inBoxFlag=true;" onMouseOut="javascript:inBoxFlag=false;">d</div></td></tr></table>');
	document.write('</div>');
}
create();
function getAbsolutePos(e){
	var l=e.offsetLeft;
	var t=e.offsetTop;
	while(e=e.offsetParent){
		l+=e.offsetLeft;
		t+=e.offsetTop;
	}
	var pos=new Object();
	pos.x=l;
	pos.y=t;
	return pos;
}
function getWindowSize(){
	var _13=0,_14=0;
	if(typeof (window.innerWidth)=="number"){
		_13=window.innerWidth;
		_14=window.innerHeight;
	}else{
		if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
			_13=document.documentElement.clientWidth;
			_14=document.documentElement.clientHeight;
		}else{
			if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
				_13=document.body.clientWidth;
				_14=document.body.clientHeight;
			}
		}
	}
	var _15=new Object();
	_15.width=_13;
	_15.height=_14;
	return _15;
}
function getScrollXY(){
	var _16=0,_17=0;
	if(typeof (window.pageYOffset)=="number"){
		_17=window.pageYOffset;
		_16=window.pageXOffset;
	}else{
		if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){
			_17=document.body.scrollTop;
			_16=document.body.scrollLeft;
		}else{
			if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){
				_17=document.documentElement.scrollTop;
				_16=document.documentElement.scrollLeft;
			}
		}
	}
	var _18=new Object();
	_18.x=_16;
	_18.y=_17;
	return _18;
}
function addEvent(elm,_1a,fn,_1c){
	if(elm.addEventListener){
		elm.addEventListener(_1a,fn,_1c);
		return true;
	}else{
		if(elm.attachEvent){
			var r=elm.attachEvent("on"+_1a,fn);
			return r;
		}else{
			elm["on"+_1a]=fn;
		}
	}
}
function changeImageToNormalState(_1e){
	var img=document.getElementById("detailedSummaryImage"+_1e);
	img.src=dilingling_url+"/templates/deaflt/images/yinhao.gif";
	//closeBubble('onmouseout');
}
function changeImageToClickState(_20){
}
function changeImageToHoverState(_21){
	var img=document.getElementById("detailedSummaryImage"+_21);
	img.src=dilingling_url+"/templates/deaflt/images/yinhao1.gif?";
}
var popTimer;
var gotoTitleTimer;
var canCloseTimer;
var canClose=false;
var inBoxFlag=false;
var detailedSummaryHidden=true;
var lastDocId;
var sumPoped=false;
function clearPopsTimer(_23,_24){
	changeImageToNormalState(_23);
	if(_24=="1"){
		clearTimeout(popTimer);
	}

}
function timeOutShowDetailedSummary(_25,_29,_2a,mid,title,url,freephone,shortad,ppcnumber,changepic,keyid){
	if(typeof changepic == "undefined"){
		changeImageToHoverState(_25);
	}
	if(_2a=="1"){
		popTimer=setTimeout("_showDetailedSummary('"+_25+"','"+mid+"','"+title+"','"+url+"','"+freephone+"','"+shortad+"','"+ppcnumber+"','"+keyid+"')",_29);
	}
}
function hideDetailedSummary(){
	if(!canClose){
		return;
	}
	clearTimeout(gotoTitleTimer);
	var box=document.getElementById("detailedSummaryBox");
	box.style.display="none";
	var _2c=document.getElementById("detailedSummaryBG");
	_2c.style.display="none";
	detailedSummaryHidden=true;
	sumPoped=false;
}
function showDetailedSummary(_2e,_2f,_30,_31,_32){
	changeImageToClickState(_2e);
	if(_32=="0"){
		_showDetailedSummary(_2e,_2f,_30,_31);
	}
}
downpng=new Image();
downpng.src=dilingling_url+"/templates/deaflt/images/down.png";
uppng=new Image();
uppng.src=dilingling_url+"/templates/deaflt/images/up.png";
var cache=new Object();
var currentHitPos=0;
function _showDetailedSummary(_33,mid,title,url,freephone,shortad,ppcnumber,keyid){
	var phonenumber = ppcnumber.substr(0,3)+"-"+ppcnumber.substr(3,3)+"-"+ppcnumber.substr(6,4);
	var disnumber = ppcnumber.substr(10,6);
	sumPoped=true;
	clearTimeout(gotoTitleTimer);
	var _37=document.getElementById("detailedSummary"+_33);
	var pos=getAbsolutePos(_37);
	var box=document.getElementById("detailedSummaryBox");
	var _3c=document.getElementById("detailedSummaryBG");
	var _3d=getWindowSize();
	var _3e=getScrollXY();
	box.style.left=(pos.x+20)+"px";
	var _40=document.getElementById("detailedSummaryContent");
	var _41=document.getElementById("popInnerBox");
	var _42=navigator.appVersion.split("MSIE");
	var _43=parseFloat(_42[1]);
	if(pos.y-_3e.y<300){
		if(pos.x-_3e.x<500)
		{
			box.className="popdown";
			box.style.top=pos.y+"px";
			_41.style.margin="30px 0 0 15px";/*down层里面文字的位置*/
			if(_43&&_43<7){
				_3c.style.background="0 none no-repeat";
				_3c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+dilingling_url+"/templates/deaflt/images/down.png')";
			}else{
				_3c.style.background="0 url('"+dilingling_url+"/templates/deaflt/images/down.png') no-repeat";
			}
		}
		else
		{
			box.className="popdown";
			box.style.top=pos.y+"px";
			box.style.left=(pos.x-360)+"px";
			_41.style.margin="30px 0 0 15px";/*down层里面文字的位置*/
			if(_43&&_43<7){
				_3c.style.background="0 none no-repeat";
				_3c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+dilingling_url+"/templates/deaflt/images/downright.png')";
			}else{
				_3c.style.background="0 url('"+dilingling_url+"/templates/deaflt/images/downright.png') no-repeat";
			}
		}
	}else{
		if(pos.x-_3e.x<400)
		{
			box.className="popup";
			box.style.top=(pos.y-285)+"px";
			_41.style.margin="20px 0 0 15px";/*up层里面文字的位置*/
			if(_43&&_43<7){
				_3c.style.background="0 none no-repeat";
				_3c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+dilingling_url+"/templates/deaflt/images/up.png')";
			}else{
				_3c.style.background="0 url('"+dilingling_url+"/templates/deaflt/images/up.png') no-repeat";
			}
		}
		else
		{
			box.className="popup";
			box.style.top=(pos.y-285)+"px";
			box.style.left=(pos.x-360)+"px"
			_41.style.margin="20px 0 0 15px";/*up层里面文字的位置*/
			if(_43&&_43<7){
				_3c.style.background="0 none no-repeat";
				_3c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src='"+dilingling_url+"/templates/deaflt/images/upright.png')";
			}else{
				_3c.style.background="0 url('"+dilingling_url+"/templates/deaflt/images/upright.png') no-repeat";
			}
		}
	}
	_3c.style.top=box.style.top;
	_3c.style.left=box.style.left;
	currentHitPos=_33;
	canClose=false;
	clearTimeout(canCloseTimer);
	canCloseTimer=setTimeout("allowClose()",200);
	if(detailedSummaryHidden){
		_3c.style.display="block";
		box.style.display="block";
	}
	detailedSummaryHidden=false;
	ppcnumber = parseInt(ppcnumber);
	_40.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="330" >  <tr><td class="padtop5 padbottom5"><div style="width:280px;overflow:hidden"><nobr><a href="'+url+'" style="color: #0039AD;	text-decoration: none;" target="_blank" id="detailedSummaryURL">'+title+'</a></nobr></div></td><td align="right" valign="top" width="30"><a href="javascript:void(0)" onMouseDown="javascript:hideDetailedSummary();"><img alt="关闭" src="'+dilingling_url+'/templates/deaflt/images/close.gif" border="0" onMouseOver="this.src=\''+dilingling_url+'/templates/deaflt/images/llbuttonfloat.gif\'" onMouseOut="this.src=\''+dilingling_url+'/templates/deaflt/images/llbuttonclick.gif\'" /></a></td>  </tr>  <tr><td colspan="2"><div style="width:320px;overflow:hidden;font-size:12px"><span style="float:left; width:300px; color:#FE4F00; font-size:13px;" id="detailedFreephone">'+shortad+'</span></div></td></tr>	<tr><td colspan="2"><div id="youcall" style="width:330px;"><table border="0" cellspacing="1" width="330" height="75" cellpadding="0" style="background-image: url('+dilingling_url+'/templates/deaflt/images/showdivtel.gif);	background-color: #FFFFFF;	background-repeat: repeat-x;	background-position: top;"><iframe name="ppciframe" style="display:none"></iframe><tr><td style="font-size:13px;padding-top:3px;padding-left:5px;" colspan="7"><img src="'+dilingling_url+'/templates/deaflt/images/cphone1.gif" border="0" />免费拨打<span style="color:red">'+phonenumber+'</span>转<span style="color:red">'+disnumber+'</span></td></tr><tr><td style="font-size:13px;padding-top:3px;padding-left:5px;"  colspan="7">或输入您的联系电话立即获得<span style="color:red">免费</span>人工电话咨询服务</td>  </tr>  <tr><td width="37" height="27" style="padding-left:5px;"><input name="gqh" id="gqh" style="width:30px;" type="text" value="区号" size="4" maxlength="4" onClick="clearValue(this)" onKeyUp="value=value.replace(/[^\\d]/g,\'\')" onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\\d]/g,\'\'))" /></td><td width="8">-</td><td width="70"><input name="gth" id="gth" type="text" value="手机/固话或小灵通" size="10" maxlength="12" onClick="clearValue(this)" onKeyUp="value=value.replace(/[^\\d]/g,\'\')" onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\\d]/g,\'\'))" title="手机/固话或小灵通" /></td><td width="82" style="font-size:12px">验证码:</td><td width="44"><img src="'+dilingling_url+'/inc/function/keysafecode.php" alt="看不清，点击换个验证码！" name="safepic" align="absmiddle" id="safepic" border="0" onClick="changePic()" style="cursor:hand;width:46px;height:18px;" /></td><td width="35"><input name="ycode" type="text" id="ycode" style="width:34px" size="4" maxlength="4"  /></td><td width="40"><img src="'+dilingling_url+'/templates/deaflt/images/jhttel.gif" onclick="checkTel();"></td><input id="ppc_number" name="ppc_number" type="hidden" value="'+ppcnumber+'"><input id="keyid" name="keyid" type="hidden" value="'+keyid+'"><input id="mid" name="mid" type="hidden" value="'+mid+'">  </tr>  </table></div><div id="callyou" style="display:none;width:330px;"><table border="0" cellspacing="1" width="330" height="75" cellpadding="0" style="background-image: url('+dilingling_url+'/templates/deaflt/images/showdivtel2.gif);	background-color: #FFFFFF;background-repeat: repeat-x;background-position: top;"><tr id="successcall" style="display:none">  <td style="font-size:13px;padding-top:3px;padding-left:38px;">您的通话请求已经发出，请稍候接听回呼电话！</td></tr><tr id="lostcall" style="display:none">  <td style="font-size:13px; color:red; font-weight:bold;padding-top:3px;padding-left:50px;"><span id="ppc_error_msg">您的通话请求发送失败!</span></td></tr><tr>  <td style="text-align:center"><img src="'+dilingling_url+'/templates/deaflt/images/hbdh.gif" class="margin3" style="cursor:hand" onClick="wBack();"><img src="'+dilingling_url+'/templates/deaflt/images/closetel.gif" class="margin3" style="cursor:hand" onClick="javascript:hideDetailedSummary();"></td></tr></table></div></td></tr><tr><td colspan="2" style="border-top-style:solid;border-top-width:1px;border-top-color:#AAA8A8;padding-top:5px;width:330px;"><iframe src="'+dilingling_url+'/?op=businessframe&mid='+mid+'" border="0" frameborder="0" width="330" height="100"></iframe></td></tr></table>';
	changePic();
}
function allowClose(){
	canClose=true;
}
function closeBubble(event) {
	if(inBoxFlag===false){
		hideDetailedSummary();
	}
}
function checkTel(aType)
{
	var gqh = $("gqh").value;
	var gth = $("gth").value;
	var ppcnumber = $("ppc_number").value;
	var ycode = $("ycode").value;
	var mid = $("mid").value;
	var keyid = $("keyid").value;
	var errorPhone = new Array();
	errorPhone[0] = 13800138000;
	if(gqh=='' || gqh.indexOf('区号') != -1){
		var x = /^(13|013|15|015){1}\d{9}$/;
		if (x.test(gth) == false)
		{
			alert("请正确填写手机号码!");
			return false;
		}
		for(var i = 0; i < errorPhone.length;i++)
		{
			if(gth == errorPhone[i]){
				alert("请正确填写手机号码!");
				return false;
			}
		}
		gqh = '';
	} else {
		var x = /^0[\d]{2,3}$/;
		if (x.test(gqh) == false)
		{
			alert("请正确填写固话/小灵通电话区号!");
			return false;
		}
		var x = /^[^0|1|9][\d]{6,7}$/;
		if (x.test(gth) == false)
		{
			alert("请正确填写固话/小灵通电话号码!");
			return false;
		}

	}
	createCall(ppcnumber,ycode,gqh,gth,aType,keyid,mid);
}
function changePic(){
	document.images["safepic"].src=dilingling_url+'/inc/function/keysafecode.php?t='+(new Date().getTime());
}
function clearValue(obj)
{
	if (obj.value.indexOf('区号') != -1 || obj.value.indexOf('手机/固话或小灵通') != -1){
		obj.value = '';
	}
}
function wBack(){
	parent.$("callyou").style.display="none";
	parent.$("youcall").style.display="block";
	$("ycode").value="";
	$("successcall").style.display="none";
	$("lostcall").style.display="none";
	changePic();
}
function createCall(ppcnumber,ycode,gqh,gth,aType,keyid,mid)
{
	var backValue = '';
	var url = dilingling_url+'/keycall.php?';
	var pars = 'type=createlayer&ppcnumber=' + ppcnumber + '&ycode=' + ycode + '&gqh=' + gqh + '&gth=' + gth +'&aType=' + aType + '&keyid=' + keyid +'&mid=' + mid;
	var tUrl = url+pars;
	include_js(tUrl);
}
function checkBackValue(backValue,aType)
{
	if(typeof aType == "undefined")
	aType = 0;
	if(backValue=='error0'){
		alert('参数错误!');
	} else if(backValue=='error1'){
		alert('请正确填写固话/小灵通电话区号!');
	} else if(backValue=='error2'){
		alert('请正确填写固话/小灵通电话号码!');
	} else if(backValue=='error3'){
		alert('请正确填写手机号码!');
	} else if(backValue=='error4'){
		alert('验证码错误!');
	} else if(backValue=='error5'){
		if(aType == 0){
			$("youcall").style.display="none";
			$("callyou").style.display="block";
			$("ppc_error_msg").innerHTML=backMessage;
			$("lostcall").style.display="block";
		}
		if(aType == 1){
			alert(backMessage);
		}
	} else if(backValue=='error6'){
		alert(backMessage);
	} else if(backValue=='success1'){
		if(aType == 0){
			$("youcall").style.display="none";
			$("callyou").style.display="block";
			$("successcall").style.display="block";
		}
		if(aType == 1){
			$("gqh").value = "区号";
			$("gth").value = "手机/固话或小灵通";
			$("yyycode").value = "";
			changePic();
			alert('呼叫成功!');
		}
	}
}
dilingling_ad_random = 0;
dilingling_ad_length = 0;
dilingling_ad_rule = 0;
addEvent(document, "click", closeBubble);

//document.domain = "dilingling.com";
var dllEcallUrl = dilingling_url+'/freephone.html?';
var webimCallUrl = '';
var imtitle = '';
var intervalHandle = null;
function webim_geturl(action,tel,getUri, keystr,calltype,mid,timtitle)
{
	imtitle = timtitle;
	if(action == 'call'){
		webimCallUrl = dllEcallUrl;
		webimCallUrl += "mod=call";
		webimCallUrl += "&tel="+tel;
		webimCallUrl += "&uri="+escape(getUri);
		webimCallUrl += "&calltype="+calltype;
		webimCallUrl += "&mid="+mid;
		webimCallUrl += "&keystr="+keystr;
		webimCallUrl += "&imtitle="+timtitle;
	}
	//	var iurl = dllEcallUrl;
	//	iurl += "mod=callencode";
	//
	//	if(calltype == 'outside'){
	//		if(navigator.appName == "Opera"){
	//			callExecute("outside");
	//			return;
	//		}
	//		iurl += "&tel="+tel;
	//	} else {
	//		if(navigator.appName == "Opera"){
	//			callExecute("inside");
	//			return;
	//		}
	//		iurl += "&calltype=inside";
	//	}
	callExecute(calltype);
	//alert(webimCallUrl);

	//var proxy = document.getElementById('proxy').contentWindow;
	//proxy.sendCheckRequest(iurl);
}
function winAction(action,tel,getUri,calltype,mid,keystr,timtitle,sid,vid)
{
	if(typeof(getUri)=="undefined"){
		var getUri = window.location.href;
	} else if (getUri == ""){
		var getUri = window.location.href;
	}
	if(typeof keystr=="undefined") var keystr = '';
	if(typeof calltype=="undefined") var calltype = 'outside';
	if(typeof mid=="undefined") var mid = 0;
	if(typeof timtitle=="undefined") var timtitle = '';
	if(typeof sid=="undefined") var sid = 1;
	if(typeof vid=="undefined") var vid = '';
	webim_geturl(action,tel,getUri,keystr,calltype,mid,timtitle,sid,vid);
}

function callExecute(callcode,msg,title,w,h,isFrame){
	webimCallUrl += "&callcode="+callcode;
	//document.write(webimCallUrl);
	if(typeof title=="undefined") var title = "嘀铃铃免费电话转接服务";
	if(typeof msg=="undefined") var msg = webimCallUrl;
	if(typeof w=="undefined") var w = 285;
	if(typeof h=="undefined") var h = 450;
	if(typeof isFrame=="undefined") var isFrame = true;
	//if(imtitle != "") h += 30;
	var titleheight = 20; // 提示窗口标题高度，单位px
	var bordercolor = "#666699"; // 提示窗口的边框颜色
	var titlecolor = "#FFFFFF"; // 提示窗口的标题颜色
	var titlebgcolor = "#666699"; // 提示窗口的标题背景色
	var bgcolor = "#FFFFFF"; // 提示内容的背景色
	if(navigator.appName != "Microsoft Internet Explorer") h += titleheight;

	var iWidth = document.documentElement.clientWidth;
	var iHeight = document.documentElement.clientHeight;
	//alert(iHeight);
	var bgObj = document.createElement("div");
	bgObj.style.cssText = "position:absolute;left:0px;top:0px;width:"+iWidth+"px;height:"+Math.max(document.body.clientHeight, iHeight)+"px;filter:Alpha(Opacity=30);opacity:0.3;background-color:#000000;z-index:101;";
	document.body.appendChild(bgObj);
	var msgObj=document.createElement("div");
	msgObj.setAttribute("id","callDialogDiv");

	msgObj.style.cssText = "position:absolute;font:11px '宋体';top:"+getScrollTop()+"px;left:"+(iWidth-w)/2+"px;width:"+w+"px;height:"+h+"px;text-align:center;border:1px solid "+bordercolor+";background-color:"+bgcolor+";padding:1px;line-height:22px;z-index:102;";

	document.body.appendChild(msgObj);

	var table = document.createElement("table");
	msgObj.appendChild(table);
	table.style.cssText = "margin:0px;border:0px;padding:0px;";
	table.cellSpacing = 0;
	var tr = table.insertRow(-1);
	var titleBar = tr.insertCell(-1);
	titleBar.style.cssText = "width:100%;height:"+titleheight+"px;text-align:left;padding:3px;margin:0px;font:bold 13px '宋体';color:"+titlecolor+";border:0px solid " + bordercolor + ";cursor:move;background:url(http://www.samulu.com/images/bg.jpg);";
	titleBar.style.paddingLeft = "10px";
	titleBar.innerHTML = title;
	var moveX = 0;
	var moveY = 0;
	var moveTop = 0;
	var moveLeft = 0;
	var moveable = false;
	var docMouseMoveEvent = document.onmousemove;
	var docMouseUpEvent = document.onmouseup;
	titleBar.onmousedown = function() {
		if(intervalHandle) {
			window.clearInterval(intervalHandle);
		}
		var evt = getEvent();
		moveable = true;
		moveX = evt.clientX;
		moveY = evt.clientY;
		moveTop = parseInt(msgObj.style.top);
		moveLeft = parseInt(msgObj.style.left);

		document.onmousemove = function() {
			if (moveable) {
				var evt = getEvent();
				var x = moveLeft + evt.clientX - moveX;
				var y = moveTop + evt.clientY - moveY;
				msgObj.style.left = parseInt(x) + "px";
				msgObj.style.top = parseInt(y) + "px";
			}
		};
		document.onmouseup = function () {
			moveStart(h);
			if (moveable) {
				document.onmousemove = docMouseMoveEvent;
				document.onmouseup = docMouseUpEvent;
				moveable = false;
				moveX = 0;
				moveY = 0;
				moveTop = 0;
				moveLeft = 0;
			}
		};
	}

	var closeBtn = tr.insertCell(-1);
	//closeBtn.style.cssText = "cursor:pointer; padding:2px;background-color:" + titlebgcolor;
	closeBtn.style.cssText = "cursor:pointer; padding:2px;background:url(/images/dialogBg.jpg);";


	closeBtn.innerHTML = "<span style='font-size:15pt; color:"+titlecolor+";'><img src='/images/closeDialog.gif' alt='关闭本窗口' style='cursor:pointer' hspace='1' border='0'></span>";
	closeBtn.onclick = function(){
		document.body.removeChild(bgObj);
		document.body.removeChild(msgObj);
	}
	var span = document.createElement("span");
	if(isFrame){
		if(navigator.appName == "Opera") h = h-(titleheight*1.5);
		span.innerHTML = '<iframe id="freephoneiframe"  src="'+msg+'" width="'+w+'" height="'+h+'" frameborder="0" scrolling="no"></iframe>';
	} else {
		span.innerHTML = msg;
	}
	msgObj.appendChild(span);
	document.getElementById("freephoneiframe").src = msg;
	moveStart(h);
}
function getEvent() {
	return window.event || arguments.callee.caller.arguments[0];
}
function moveStart(h){
	if(!document.getElementById('callDialogDiv')) {
		window.clearInterval(intervalHandle);
		return;
	}
	intervalHandle=window.setInterval("move('callDialogDiv',"+h+")", 100);
}

function move(tempID,h)
{
	var x,y;
	var temp = document.getElementById(tempID);
	if(!temp) {
		window.clearInterval(intervalHandle);
		return;
	}
	if (self.innerHeight){
		x = self.innerWidth;
		y = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}else if (document.body){
		x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	var dy = (getScrollTop()+y-temp.offsetTop)*0.5;
	dy = (dy > 0 ? 1 :  - 1) * Math.ceil(Math.abs(dy));
	temp.style.top = (temp.offsetTop+dy-((y+h)/4))+"px";
}

function getScrollLeft(){
	if (document.documentElement && document.documentElement.scrollLeft){
		return document.documentElement.scrollLeft;
	}else if (document.body){
		return document.body.scrollLeft;
	}else {
		return 0;
	}
}

function getScrollTop(){
	if (document.documentElement && document.documentElement.scrollTop){
		return document.documentElement.scrollTop
	} else if (document.body){
		return document.body.scrollTop;
	} else {
		return 0;
	}
}
