// 客服JS

function ShowIframe()
{
	var pop=new Popup({ contentType:1,scrollType:'yes',isReloadOnClose:false,width:500,height:400});
	pop.setContent("contentUrl","http://www.bonoffer.com");
	pop.setContent("title","bonoffer");
	pop.build();
	pop.show();
}
function ShowHtmlString()
{
	if( isOnLine() ) {
		var strHtml = '<div class="serveOnline"><div class="twoBtn"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=98cc02bd97684bc7fad1602435b9817617a5b7ed958744b162d62b3ff27fcd8d"; target=_blank; onclick="var tempSrc=\'http://sighttp.qq.com/wpa.js?rantime=\'+Math.random()+\'&sigkey=98cc02bd97684bc7fad1602435b9817617a5b7ed958744b162d62b3ff27fcd8d\';var oldscript=document.getElementById(\'testJs\');var newscript=document.createElement(\'script\');newscript.setAttribute(\'type\',\'text/javascript\'); newscript.setAttribute(\'id\', \'testJs\');newscript.setAttribute(\'src\',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC=\'http://wpa.qq.com/pa?p=1:56249845:42\' alt=""></a></div>		</div>';
	} else {
		var strHtml = '<div class="leave"><div class="twoBtn"><a href="http://pathpro.bonoffer.com/pathpro/default/toserver"><img src="img/pathpro/liuyan.gif" width="87" height="22" alt="留言" /></a></div>		</div>';
	}
	var pop=new Popup({ contentType:2,isReloadOnClose:false,width:250,height:136});
	pop.setContent("contentHtml",strHtml);
	pop.setContent("title","");
	pop.build();
	pop.show();

	$("#dialogBoxBG").hide();
}
function ShowConfirm()
{
   var pop=new Popup({ contentType:3,isReloadOnClose:true,width:340,height:80});
   pop.setContent("title","confirm对话框示例");
   pop.setContent("confirmCon","confirm对话框的内容");
   pop.setContent("callBack",ShowCallBack);
   pop.setContent("parameter",{id:"divCall",str:"点击确定后显示的字符串",obj:pop});
   pop.build();
   pop.show();
}
function ShowAlert()
{
	var pop=new Popup({ contentType:4,isReloadOnClose:false,width:340,height:80});
	pop.setContent("title","alert警告框示例");
	pop.setContent("alertCon","alert对话框的内容");
	pop.build();
	pop.show();
}


function ShowCallBack(para)
{
	var o_pop = para["obj"]
	var obj = document.getElementById(para["id"]);
	o_pop.close();
	obj.innerHTML = para["str"];
	
}

// 是否处于上班时间
function isOnLine()
{
	var time = new Date();
	if( time.getDay() == 0 || time.getDay() == 6 ) //星期天或星期六
		return false;
	if( time.getHours() < 9 || time.getHours() >17 ) //非上班时间
		return false;
	return true;
}
setTimeout("ShowHtmlString()",300000);
