function insertFlash(elm, url, b , w, h) {
if (!document.getElementById(elm)) return;
var str = '';
str += '<object width="'+ w +'" height="'+ h +'" border="' + b + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
str += '<param name="movie" value="'+ url +'">';
str += '<param name="quality" value="autohigh">';
str += '<param name="wmode" value="opaque">';
str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
str += '</object>';
document.getElementById(elm).innerHTML = str;
}


function ch_authcode(elm,no){
	if(no=="" || no=="-"){
		if(document.getElementById('authcode_no_val')){
		no=document.getElementById('authcode_no_val').innerHTML;
		document.forms[0].input_auth_time.value=no;
		}
	}
//	alert(no);
	if(no!="" && no!="-"){
	v=Math.random()*100+1
	document.getElementById(elm).src = "/authcode.php?mode=change&no_id=" + no + "&v=" + v;
	}
}

function get_authcode(elm,no){
	if(no=="" || no=="-"){
		if(document.getElementById('authcode_no_val')){
		no=document.getElementById('authcode_no_val').innerHTML;
		document.forms[0].input_auth_time.value=no;

		}
	}
//	alert(no);
	if(no!="" && no!="-"){
	document.getElementById(elm).src = "/authcode.php?mode=get&no_id=" + no;
	}
}

function disp_authcode(theForm)
{
	imgid="authcode_news";
    code=theForm.input_auth_code.value;
    no=theForm.input_auth_time.value;
	if(no=="" || no=="-"){
		if(document.getElementById('authcode_no_val')){
		no=document.getElementById('authcode_no_val').innerHTML;
		}
		theForm.input_auth_time.value=no;
	}
//alert(theForm.input_auth_time.value);
	imgsrc=document.getElementById(imgid).src;
	if(code.length==0 && imgsrc.indexOf("authcode_click.gif")!='-1'){
		get_authcode(imgid,no);
	}

}

	function heartBeatIm() {  
	if(document.getElementById("FVContainer")){
		if(swf_show_val>4){
			selectTab0dSyn('nav_pic_',2,2)
		}
		if(swf_show_val>8){
			swf_show_val=1;
			selectTab0dSyn('nav_pic_',2,1)
		}
		setMainOpt('FVContainer',tabnavpic_list[swf_show_val],swf_show_val,'djn80','navpic0',8,'tabnavpic0');
		swf_show_val++;
	}
	}

	function navpic_page(tabtabbef,idall,i,picstart){
			selectTab0dSyn(tabtabbef,idall,i);
			swf_show_val=picstart;
			heartBeatIm();
	}

function insertAd(elm, msg) {
if (!document.getElementById(elm)) return;
var str = msg;
document.getElementById(elm).innerHTML = str;
}

function insertArea(elm, alm) {
	
if (!document.getElementById(elm)) return;
if (!document.getElementById(alm)) return;

var str = document.getElementById(alm).innerHTML;
document.getElementById(elm).innerHTML = str;
document.getElementById(alm).innerHTML = "";
}

function show_sec(){
window.status=' RHY168.com - 润滑油行业第一站　专业润滑油品导购平台';
if(document.getElementById("web_page_runtime")){
	var t2 = new Date().getTime();
var str =(t2-t1)/1000;
document.getElementById("web_page_runtime").innerHTML = str;
}
today = new Date();
var day;
var date;
if(today.getDay()==0) day = "星期日"
if(today.getDay()==1) day = "星期一"
if(today.getDay()==2) day = "星期二"
if(today.getDay()==3) day = "星期三"
if(today.getDay()==4) day = "星期四"
if(today.getDay()==5) day = "星期五"
if(today.getDay()==6) day = "星期六"
if(today.getYear()!=""){
	date = today.getYear() + "年" +(today.getMonth() + 1 ) + "月" + today.getDate() + "日";
}else{
	date = "RHY168";
}
if(document.getElementById("web_page_today")){
document.getElementById("web_page_today").innerHTML = date;
}
if(document.getElementById("web_page_member")){
var msg='';
var user = GetCookie('user_id');
if(user==null){
		ShowArticle('/member/im_ajax.php');
}else{
	msg="欢迎您!" + user + "　<a href=/member/>会员中心</a>　<a href=/exit.php>退出&raquo;</a>";
	document.getElementById("web_page_member").innerHTML = msg;
}
}

	if(document.getElementById("AJAX_im_msg") || document.getElementById("AJAX_2009_home")){
		ShowArticle('/member/im_ajax.php');
		setInterval("im_reflash()",6000);
	}

}

function add_img(theform){

name=theform.name;
//att_html=document.getElementById("form_att").innerHTML;
att_html="<input type=\"file\" name=\"picfile[]\" class=\"s\" size=\"40\" onchange=\"add_img(" + name + ")\"><br><DIV id=form_img></DIV>";
document.getElementById("form_img").outerHTML = att_html;
}

// JavaScript Document

function reg_check(theform,show_id){
switch(show_id)
{
case 'reg_user_check':
username=theform.user.value;
auth_no=theform.input_auth_time.value;
if(username==null || username==""){
	alert("请输入"+theform.user.title);
}else{
	if(username.length<2 || username.length>15){
	alert(theform.user.title+"长度必须4-15位");
	}else{
	att_html="<iframe frameborder=0 width=150 height=16 src='/check.php?way=" +show_id+ "&no_id="+auth_no+ "&user="+username+"'scrolling='no'></iframe>";
	document.getElementById(show_id).innerHTML = att_html;
	}
}
break;
case 'reg_user_valid':
username=theform.user.value;
auth_no=theform.input_auth_time.value;
if(username==null || username==""){
	alert("请输入"+theform.user.title);
}else{
	if(username.length<2 || username.length>15){
	alert(theform.user.title+"长度必须4-15位");
	}else{
	att_html="<iframe frameborder=0 width=150 height=16 src='/check.php?way=" +show_id+ "&no_id="+auth_no+ "&user="+username+"'scrolling='no'></iframe>";
	document.getElementById(show_id).innerHTML = att_html;
	}
}
break;
case 'reg_email_active':
username=theform.user.value;
email=theform.email.value;
auth_no=theform.input_auth_time.value;
if(email==null || email=="" || email.indexOf('@')==-1){
	alert(theform.email.title+"输入不正确");
}else{
if(username==null || username==""){
	alert("请输入"+theform.user.title);
}else{
	if(username.length<2 || username.length>15){
	alert(theform.user.title+"长度必须4-15位");
	}else{
	att_html="<iframe frameborder=0 width=150 height=16 src='/check.php?way=" +show_id+ "&no_id="+auth_no+ "&user="+username+"&email="+email+"'scrolling='no'></iframe>";
	document.getElementById(show_id).innerHTML = att_html;
	}
}
}
break;
case 'reg_sms_active':
username=theform.user.value;
mobile=theform.mobile.value;
auth_no=theform.input_auth_time.value;
if(mobile==null || mobile=="" || !checknumber(mobile)){
	alert(theform.mobile.title+"输入不正确");
}else{
if(username==null || username==""){
	alert("请输入"+theform.user.title);
}else{
	if(username.length<2 || username.length>15){
	alert(theform.user.title+"长度必须4-15位");
	}else{
	att_html="<iframe frameborder=0 width=150 height=16 src='/check.php?way=" +show_id+ "&no_id="+auth_no+ "&user="+username+"&mobile="+mobile+"'scrolling='no'></iframe>";
	document.getElementById(show_id).innerHTML = att_html;
	}
}
}
break;
case 'reg_unit_check':
unit=theform.unit.value;
auth_no=theform.input_auth_time.value;
if(unit==null || unit==""){
	alert("请输入"+theform.unit.title);
}else{
	att_html="<iframe frameborder=1 width=500 height=100 src='/check.php?way=" +show_id+ "&no_id="+auth_no+ "&unit="+unit+"'scrolling='yes'></iframe><DIV>通过选择企业，您可加入成为该企业的成员，经过企业创建人或管理员通过验证后，您可以<br>维护企业信息，展示产品、发布商机、动态。</DIV>";
	document.getElementById(show_id).innerHTML = att_html;
}
break;
case 'post_unit_check':
unit=theform.unit.value;
auth_no=theform.input_auth_time.value;
if(unit==null || unit==""){
	alert("请输入"+theform.unit.title);
}else{
	att_html="<iframe frameborder=1 width=500 height=100 src='/check.php?way=" +show_id+ "&no_id="+auth_no+ "&unit="+unit+"'scrolling='yes'></iframe><DIV>通过选择企业，可直接使用该用户信息</DIV>";
	document.getElementById(show_id).innerHTML = att_html;
}
break;
default:
}

}

function user_login(theForm)
{
	if(check_submit(theForm)){
		theForm.submit();
	}
}

function check_submit(theForm)
{
	 loop=theForm.elements.length;
	 for(i=0;i<loop;i++){
		 if((theForm.elements[i].value=="" || theForm.elements[i].value=="-" || theForm.elements[i].value=="-1") && theForm.elements[i].title!="" ){
			 alert("请输入"+theForm.elements[i].title);
			 theForm.elements[i].focus();
			 return false;
		 }
	 }
  return (true);
}

function google_search(theForm)
{
	 if(check_submit(theForm)){
	key_q=theForm.q.value;
	document.location='http://www.google.cn/custom?domains=www.rhy168.com&q=' + key_q + '&sitesearch=&client=pub-4670864494117977&forid=1&ie=GB2312&oe=GB2312&safe=active&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3AFFFFFF%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BLH%3A50%3BLW%3A150%3BL%3Ahttp%3A%2F%2Fwww.rhy168.com%2Fimages%2Flogo.gif%3BS%3Ahttp%3A%2F%2Fwww.rhy168.com%3BFORID%3A1&hl=zh-CN';
	}

}
function go_search(theForm,val)
{
	q_val="key_wd_"+val;
	key_q=theForm.elements[q_val].value;

	document.location='/search/start.php?way='+ val +'&key_wd=' + key_q;
}

function qpc_search(theForm)
{
	theForm.submit();
}

function site_search(theForm)
{
	 if(check_submit(theForm)){
	 if(theForm.sort.value=="-"){
		 theForm.sitesearch.value="";
		 theForm.action='http://www.google.com/custom';
		 theForm.submit();
	 }else{
		 if(theForm.sort.value=="0"){
			 theForm.sitesearch.value="www.rhy168.com";
			 theForm.action='http://www.google.com/custom';
			 theForm.submit();
		 }else{
		  return (true);
		 }
	 }
	 }
}

var win_title=document.title;
var msg = "您有新的信息!";
var speed = 300;
var msgud = "■■■■■■■■■■■■■■■■" + msg; 
var win_flash;
var win_title_flag=1;
var intervalID=0; 
var swf_show_val=1;

function refwindow(){
	if (win_title_flag==1){
		document.title = msg;
		win_title_flag=0;
	}else{
		document.title = msgud;
		win_title_flag=1;
	}
	win_flash=window.setTimeout("refwindow()", speed); 
}
function reswindow(){
	clearTimeout(win_flash);
	document.title = win_title; 
}

function setMainOpt_Mouse(optid,optsrc,i,classnamebef,idbef,idall,tabtabbef){
	setMainOpt(optid,optsrc,i,classnamebef,idbef,idall,tabtabbef);
	swf_show_val=i;
	setMainOpt_Clear();   
}

function setMainOpt_Clear(){
//	alert('stop');
	window.clearInterval(intervalID);
	intervalID=0; 
//	swf_show_val=i;
}

function setMainOpt_Start(){
	if(intervalID==0){
//		alert('start');
	intervalID = window.setInterval("heartBeatIm()",7200);
	}
}


function setMainOpt(optid,optsrc,i,classnamebef,idbef,idall,tabtabbef){
//	_gObj("tabopt10").style.display="none";
//	setTab0dSyn(i,classnamebef,idbef,idall,tabtabbef);
	_gObj(optid).style.background='url('+ optsrc +')';
	for(var s= 1; s<= idall;s++)
	{
		if(i!=s){
			_gObj(idbef+s).className = classnamebef+"_a";
			_gObj(tabtabbef+s).style.display="none";
		}else{
			_gObj(idbef+s).className = classnamebef+"_0a";
			_gObj(tabtabbef+s).style.display="block";
		}
	}
//	var recswfid="main_swf00";
//	_gObj(recswfid).style.display="none";
//	var swfid="main_swf0";
//	for(var s= 1; s<= idall;s++)
//	{
//		if(i!=s)_gObj(swfid+s).style.display="none";
//	}
//	_gObj(swfid+i).style.display="block";
}

function setTab0dSyn0(i,classnamebef,idbef,idall,tabtabbef)
{
	if(i!=0){
		setMainOpt_Clear();
		setTab0dSyn(i,classnamebef,idbef,idall,tabtabbef)
		_gObj(tabtabbef+'0').style.display="none";
	}else{
		changDivClass(idbef,idall,0,classnamebef)
		for(var m= 1; m<= idall;m++)
		{
				_gObj(tabtabbef+m).style.display="none";
		}
		_gObj(tabtabbef+i).style.display="block";
		setMainOpt_Start();

	}
}

function setTab0dSyn(i,classnamebef,idbef,idall,tabtabbef)
{
	var waitInterval;
	
	var MouseDelayTime=150;//鼠标感应延迟300毫秒
//
	
					_gObj(idbef+i).onmouseout=function(aEvent)
					{					
					      
						  clearTimeout(waitInterval);
				    }
			    	clearTimeout(waitInterval);
					
					var str="setTab0dSyn1("+i+",'"+classnamebef+"','"+idbef+"',"+idall+",'"+tabtabbef+"')";
					
					waitInterval=setTimeout(str,MouseDelayTime);
	
}
function aa(i)
{
	alert("aa is run"+i);
}
//----------------------------------------------------------------------------------
function setTab0dSyn1(i,classnamebef,idbef,idall,tabtabbef)
{
//alert(i);
changDivClass(idbef,idall,i,classnamebef)
selectTab0dSyn(tabtabbef,idall,i);
}

function selectTab0dSyn(div_id,allnum,now){
for(var i= 1; i<= allnum;i++)
{
	if(i==now)
	{
		_gObj(div_id+i).style.display="block";
	}else
	{
		_gObj(div_id+i).style.display="none";
	}
}

//	document.getElementById("tabtabd1").style.display="block";
//	document.getElementById("tabtabd2").style.display="none";

}	

function corp_fov(no){
	document.location="/corp/show.php?way=0&fover=1&yp_id=" + no;
}
function corp_mod(no){
	document.location="/corp/modify.php?yp_id=" +no;
}
function corp_reg(no){
	document.location="/regsiter.php?corp_id=" + no;
}

function _gObj(id)
{
return document.getElementById(id);
}

function changDivClass(div_id,all,now,classnamebef)
{
for(var i= 1; i<= all;i++)
{
if(i==now)
{
_gObj(div_id+i).className = classnamebef+"_0a";
}else
{
//_gObj(div_id+i).className = "dj4_"+i;
_gObj(div_id+i).className = classnamebef+"_a";
}
}
}


function GetCookieVal(str,offset)
//获得Cookie解码后的值
{
var endstr = str.indexOf (";", offset);
if (endstr == -1)
endstr = str.length;
return unescape(str.substring(offset, endstr));
}

function SetCookie(name, value)
//设定Cookie值
{
var expdate = new Date();
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
+((secure == true) ? "; secure" : "");
}
function DelCookie(name)
//删除Cookie
{
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires="+ exp.toGMTString();
}
function GetCookie(name)
//获得Cookie的原始值
{
var arg = name + "=";
var alen = 0;
var str="";
var cook=document.cookie;
var cook_varlist;
var cook_var;
var start;
var clen;

alen = arg.length;
if(cook.charAt(";")){
	cook_varlist=split(";",cook);
	start=cook_varlist.length-1;
	cook_var=cook; //_varlist[start];
	clen = cook_var.length;
}else{
	cook_var=cook;
	clen = cook_var.length;
}
var i = 0;
//alert(cook_var);

while (i < clen){
var j = i + alen;
if (cook_var.substring(i, j) == arg){
	str = GetCookieVal (cook_var,j);
	return str; 
}
i = i + 1;
}
return null;
}

function powerpoint(focus_file,focus_width,focus_heigh,text_height,pics,links,texts){
 document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
 document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="'+focus_file+'"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFFF">');
 document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
 document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
 document.write('<embed src="'+focus_file+'" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#F0F0F0" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');  
 document.write('</object>');
}

function fontZoom(size)
{
 document.getElementById('fontzoom').style.fontSize=size+'px';
}

function ch_page(url,no){
	if(no==""){
		alert("请输入要转到的页码");
	}else{
		if(checknumber(no)){
		 window.location=url + no;
		}else{
		 alert("页码输入不正确");
		}
	}
}

function msg_urldecode(Divid){
	msg=document.getElementById(Divid).innerHTML;
	document.getElementById(Divid).innerHTML=unescape(msg);
}


function go_htmlpage(url){
	if(url!="" && url!="-"){
		 window.location=url;
	}
}


function form_page(theform,no){
	if(no==""){
		alert("请输入要转到的页码");
	}else{
		if(checknumber(no)){
			theform.page.value=no;
			theform.submit();
		}else{
		 alert("页码输入不正确");
		}
	}
}

function checknumber(String) 
{ 
var Letters = "1234567890-+"; 
var i; 
var c; 
for( i = 0; i < String.length; i ++ ) 
{ 
c = String.charAt( i ); 
if (Letters.indexOf( c ) ==-1) 
{ 
return false; 
} 
} 
return true; 
} 

function split(chr,String) 
{ 
var slide=new Array();
var i; 
var loop=0;
var tmp="";
var c; 
for( i = 0; i < String.length; i ++ ) { 
c = String.charAt( i ); 
if (c == chr) {
	slide[loop] = tmp;
//	alert( slide[loop]);
	loop++;
	tmp="";
}else{
	tmp=tmp+c;
}
} 
if(tmp.length>0){
	slide[loop] = tmp;
//	alert( slide[loop]);
}
return slide; 
} 


var winWidth = 0;   var winHeight = 0;   
var ChatsetRang = false;   

 if (window.innerWidth)   winWidth = window.innerWidth;   
 else 
 if ((document.documentElement) && (document.documentElement.clientWidth))   
 winWidth = document.documentElement.clientWidth;   
 //获取窗口高度   
 if (window.innerHeight)   winHeight = window.innerHeight;   
 else if ((document.documentElement) && (document.documentElement.clientHeight))   winHeight = document.documentElement.clientHeight;
    //通过深入Document内部对body进行检测，获取窗口大小   
 if (document.documentElement  && document.documentElement.clientHeight && document.documentElement.clientWidth)   
 {   winHeight = document.documentElement.clientHeight;   winWidth = document.documentElement.clientWidth;   }  

srcHeight = window.screen.height-60;
srcWidth = window.screen.width-10;

var mm_Height=document.documentElement.scrollHeight-100;
var mm_Width=winWidth-100;

var MarginLeft = 10;   //浮动层离浏览器右侧的距离
var MarginTop = winHeight-152;;     //浮动层离浏览器顶部的距离
var Width = 212;        //浮动层宽度
var Heigth= 150;   
var page_height= winHeight; 
var page_width= winWidth; 
var msg_top=page_height-152;
var msg_left=758+(page_width-980)/2;
var pan_top=100;
var chat_intervalID=new Array();
var chat_interusrID=new Array();

function expo_show_scr(url){
	window.open(url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,top=0,left=0,height='+   srcHeight   +',width='+   srcWidth   +'');
}


<!-- begin of floating button -->
function im_msg_pan(eva){
var pan_left;
var pan_height;
var pan_line_top;
var pan_but;
var pan_line_but;
var pan_line_left;
var pan_stop_left;
var pan_bar_id='IM_msgpan';
 str="";

 switch(eva){
	 case '':
	 str="<div class=\"im_msgpan\" id='AJAX_im_msg' style='BORDER: #000000 1px solid;z-index: 110;background: #FFFFFF;position: absolute; left: "+msg_left+"px; top: "+msg_top+"px; width: 212px; height: 150px'><DIV class=t7><A class=more href=\"javas" + "cript: im_close('AJAX_im_msg')\">×</A><A class=more href=\"javas" + "cript: im_dialog('AJAX_im_msg')\">□</A><A class=more href=\"javas" + "cript: im_hidden('AJAX_im_msg')\">－</A><span>RHY168贴吧</span></DIV><DIV class=co5 id='AJAX_im_area'><form action=\"/bar/post.php\" method=\"POST\" name=theform onsubmit=\"return check_submit(this)\" enctype=\"multipart/form-data\"><DIV class=bor1><input type=\"hidden\" name=\"ip\" value=\"\"><textarea name=\"msg\" cols=\"29\" class=\"sb\" rows=\"3\" title=\"发言内容\"></textarea><br>联系方式:<input class=sb type=\"text\" name=\"guest_tel\" size=\"20\"></DIV><input class=\"sbta\" type=submit value=\"发 送\" name=\"go\"> <input class=\"sbta\" type=reset value=\"重 写\" name=\"re\"> <input class=\"sbta\" type=button value=\"我的小纸条\" name=\"let\" onclick=\"window.location='/login.php'\"><br></form></DIV></DIV>";
	 break;
	 case '-1':
	 str="<div class=\"im_msgpan\" id=\"im_msgpan\" style='BORDER: #000000 1px solid;z-index: 110;background: #FFFFFF;position: absolute; left: "+msg_left+"px; top: "+msg_top+"px; width: 212px; height: 150px'><DIV class=t7><A class=more href=\"javas" + "cript: im_close('im_msgpan')\">×</A><A class=more href=\"javas" + "cript: im_dialog()\">□</A><A class=more href=\"javas" + "cript: im_hidden('im_msgpan')\">－</A><span>RHY168贴吧</span></DIV></DIV></DIV>";
	 break;
	 default:
	 str="<div class=\"im_msgpan\" id=\"im_letter\" style='BORDER: #000000 1px solid;z-index: 110;background: #FFFFFF;position: absolute; left: "+msg_left+"px; top: "+msg_top+"px; width: 212px; height: 150px'><DIV class=t7><A class=more href=\"javas" + "cript: im_close('im_letter')\">×</A><A class=more href=\"javas" + "cript: im_dialog('im_letter')\">□</A><A class=more href=\"javas" + "cript: im_hidden('im_letter')\">－</A><span>168小纸条</span></DIV><DIV class=co5 id='AJAX_im_area'><form action=\"/club/letter.php\" method=\"POST\" name=theform onsubmit=\"return check_submit(this)\" enctype=\"multipart/form-data\"><DIV class=bor1><input type=\"hidden\" name=\"incept_user\" value=\""+ eva +"\"><textarea name=\"msg\" cols=\"29\" class=\"sb\" rows=\"3\" title=\"发言内容\"></textarea><br>联系方式:<input class=sb type=\"text\" name=\"guest_tel\" size=\"20\"></DIV><input class=\"sbta\" type=submit value=\"发 送\" name=\"go\"> <input class=\"sbta\" type=reset value=\"重 写\" name=\"re\"> <input class=\"sbta\" type=button value=\"会员中心\" name=\"let\" onclick=\"window.open('/member')\"><br></form></DIV></DIV>";
	 break;
 }
var user_id = GetCookie('user_id');

var oDiv = document.createElement("DIV");
oDiv.id = pan_bar_id;
oDiv.style.display='block';
oDiv.style.position="absolute"; 

document.body.appendChild(oDiv);
document.getElementById(pan_bar_id).innerHTML=str;
// document.write(str);

wStr="<div class=im_msgwin id='AJAX_im_win' style=' left: "+msg_left+"px; top: "+pan_top+"px;z-index: 110;background:#EAEAFA; width: 212px; height: 300px'><DIV class=t7><A class=more href=\"javas" + "cript: im_win_close()\">×</A><span>168商信通(" + user_id +")</span></DIV><DIV class=channel_list_bar><a id=im_msg_mm14 class=menu href=\"javascript:im_win_chat(4)\" onclick=\"setTab0dSyn(4,'menu','im_msg_mm1',4,'im_msg_tab1');\"><img alt=\"短信中心\" border=0 src=\"/images/im_but04.gif\"></a><a id=im_msg_mm13 class=menu href=\"javascript:im_win_chat(3)\" onclick=\"setTab0dSyn(3,'menu','im_msg_mm1',4,'im_msg_tab1');\"><img alt=\"我的空间\" border=0 src=\"/images/im_but03.gif\"></a><a id=im_msg_mm12 class=menu href=\"javascript:im_win_chat(2)\" onclick=\"setTab0dSyn(2,'menu','im_msg_mm1',4,'im_msg_tab1');\"><img alt=\"日程计划\" border=0 src=\"/images/im_but02.gif\"></a><a id=im_msg_mm11 class=menu href=\"javascript:im_win_chat(1)\" onclick=\"setTab0dSyn(1,'menu','im_msg_mm1',4,'im_msg_tab1');\"><img alt=\"好友列表\" border=0 src=\"/images/im_but01.gif\"></a></DIV><DIV class=clear></DIV><DIV class=co6 style=\" margin:4px; width:202px;height:194px; border: 1px solid #9999A0;background:#FFFFFF\"><DIV id='im_msg_tab11'><DIV id='AJAX_im_friend' style=\"width:200px;height:192px;overflow: auto\"></DIV><DIV id='im_msg_tab12'></DIV><DIV id='im_msg_tab13'></DIV><DIV id='im_msg_tab14'></DIV></DIV></DIV><DIV class=co5><input class=\"sbta\" type=button value=\"添加好友\" name=\"go\" onclick=\"im_add_friend()\">　<input class=\"sbta\" type=button value=\"个人设置\" name=\"let\" onclick=\"im_setup()\">　<input class=\"sbta\" type=button value=\"退出\" name=\"re\" onclick=\"im_exit()\"></DIV></DIV>"

var wDiv = document.createElement("DIV");
wDiv.id = 'IM_win';
wDiv.style.zindex = 110;
wDiv.style.position="absolute"; 
//						wDiv.style.position='fixed !important; top/**/:300px';
//						wDiv.style.top='e-xpression(offsetParent.scrollTop+300)';

document.body.appendChild(wDiv);
document.getElementById('IM_win').innerHTML=wStr;

//  document.write(wStr);

 //document.write("<div id='AJAX_im_but1' style='display:none'></DIV><div id='AJAX_im_but2' style='display:none'></DIV><div id='AJAX_im_but3' style='display:none'></DIV><div id='AJAX_im_but4' style='display:none'></DIV>");


}

	var ImDialogshow = true;  
	var ImDiawinshow = false;
	var ImDivMove = false;
	var ImDivnums = 0;
	var ImDiaChatshow = 1;
	var ImDivChatMsgid=new Array();
	var ImDivChat = 10;

function im_chat_send(user,DivNo){
	Chatform="Chatform_" +DivNo;
	msg=document.forms[Chatform].msg.value;
	if(msg==''){
		alert("不能发送空消息");
		document.forms[Chatform].msg.focus();
		
	}else{
	ImDivChatmsgid="AJAX_im_chat_" +DivNo;
//	im_div_flush(ImDivChatmsgid);
	url="/member/chat_ajax.php";
	params = "user="+escape(user)+"&chatno=" + DivNo+"&msg="+escape(msg);
	posturl=url + "?" + params;
//	ShowArticle(posturl);
	SendArticle(url,params);
	document.forms[Chatform].msg.value="";
	ImDivChatmsgid="AJAX_im_chat_" +DivNo;
	im_div_flush(ImDivChatmsgid);
	return false;
	}
}

function IM_view_send(theForm,nDiv,nVal){
	 loop=theForm.elements.length;
	 for(i=0;i<loop;i++){
		 if((theForm.elements[i].value=="" || theForm.elements[i].value=="-" || theForm.elements[i].value=="-1") && theForm.elements[i].title!="" ){
			 alert("请输入"+theForm.elements[i].title);
			 theForm.elements[i].focus();
			 return false;
		 }
	 }

	msg=theForm.msg.value;
	msg=msg + "　姓名: " + theForm.writer.value;
	msg=msg + "　电话: " + theForm.tel.value;
	msg=msg + "　传真: " + theForm.fax.value;
//	url="/member/vchat_ajax.php";
//	params = "&divid="+ nDiv + "&no_id=" +nVal+"&tel="+escape(tel)+"&fax="+escape(fax)+"&msg="+escape(msg)+"&writer="+escape(writer);
	url="/member/cchat_ajax.php";
	params = "&divid="+ nDiv + "&user_id=%20&cfield=webchat&cvalue=" +nVal+"&msg="+escape(msg);
	posturl=url + "?" + params;
//	alert(posturl);
//	ShowArticle(posturl);
	SendArticle(url,params);
	theForm.tel.value="";
	theForm.fax.value="";
	theForm.writer.value="";
	window.location="http://cbi.rhy168.com";
	return false;
}


function IT_msg_send(theForm,nDiv,nField,nVal,user){
	 loop=theForm.elements.length;
	 for(i=0;i<loop;i++){
		 if((theForm.elements[i].value=="" || theForm.elements[i].value=="-" || theForm.elements[i].value=="-1") && theForm.elements[i].title!="" ){
			 alert("请输入"+theForm.elements[i].title);
			 theForm.elements[i].focus();
			 return false;
		 }
	 }

	input_auth_time=0;
	input_auth_code=0;
	msg=theForm.msg.value;
	if(document.getElementsByName("input_auth_time").length>0){
	input_auth_time=theForm.input_auth_time.value;
	input_auth_code=theForm.input_auth_code.value;
//	im_div_flush(nDiv);
	}
	url="/member/cchat_ajax.php";
	params = "&divid="+ escape(nDiv)+"&user="+escape(user)+"&cfield=" +escape(nField) + "&cvalue=" +nVal+"&msg="+escape(msg)+"&input_auth_time="+escape(input_auth_time)+"&input_auth_code="+escape(input_auth_code);
	posturl=url + "?" + params;
//	ShowArticle(posturl);
	SendArticle(url,params);
	theForm.msg.value="";
	if(input_auth_time>0){
		len=input_auth_time.length;
		f='';
		for(i=0;i<len-1;i++){
			f=f+input_auth_time.charAt(i)
		}
	n=Number(input_auth_time.charAt(len-1))+1;
	input_auth_time=f+n;
	theForm.input_auth_time.value=input_auth_time;
	theForm.input_auth_code.value='';
	ch_authcode('authcode_news',input_auth_time)
	}
	im_div_flush(nDiv);
	
	return false;
}

function IT_msg_upload(theForm,nDiv,nField,nVal,user){
	 loop=theForm.elements.length;
	 for(i=0;i<loop;i++){
		 if((theForm.elements[i].value=="" || theForm.elements[i].value=="-" || theForm.elements[i].value=="-1") && theForm.elements[i].title!="" ){
			 alert("请输入"+theForm.elements[i].title);
			 theForm.elements[i].focus();
			 return false;
		 }
	 }
	input_auth_time=0;
	input_auth_code=0;
	if(document.getElementsByName("input_auth_time").length>0){
	input_auth_time=theForm.input_auth_time.value;
	input_auth_code=theForm.input_auth_code.value;
//	im_div_flush(nDiv);
	}

	url="/member/upload_ajax.php";
	params = "&divid="+ escape(nDiv)+"&user="+escape(user)+"&cfield=" +escape(nField) + "&cvalue=" +nVal+"&input_auth_time="+escape(input_auth_time)+"&input_auth_code="+escape(input_auth_code);
	posturl=url + "?" + params;
	theForm.action=posturl;
	theForm.submit();
	if(input_auth_time>0){
		len=input_auth_time.length;
		f='';
		for(i=0;i<len-1;i++){
			f=f+input_auth_time.charAt(i)
		}
	n=Number(input_auth_time.charAt(len-1))+1;
	input_auth_time=f+n;
	theForm.input_auth_time.value=input_auth_time;
	theForm.input_auth_code.value='';
	ch_authcode('authcode_news',input_auth_time)
	}

//	UploadArticle(url,params);
//	ShowArticle(posturl);
	return true;
}


function IT_reflash(nDiv,nField,nVal){
	if(document.getElementById(nDiv)){
	params = "&divid="+ nDiv+"&cfield=" +nField + "&cvalue=" +nVal;
	posturl="/member/cchat_ajax.php?" + params;
	ShowArticle(posturl);
	im_div_flush(nDiv);
	}
}

function im_chat_get(user,DivNo){
	url="/member/chat_ajax.php";
	params = "user="+escape(user)+"&chatno=" + DivNo;
	posturl=url + "?" + params;
	ShowArticle(posturl);
	ImDivChatmsgid="AJAX_im_chat_" +DivNo;
	im_div_flush(ImDivChatmsgid);
}

function msg_uncode(Divid){
	msg=document.getElementById(Divid).innerHTML;
	document.getElementById(Divid).innerHTML=unescape(msg);
}

if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement)
{
     HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode)
     {
        switch (where)
        {
            case 'beforeBegin':
                this.parentNode.insertBefore(parsedNode,this)
                break;
            case 'afterBegin':
                this.insertBefore(parsedNode,this.firstChild);
                break;
            case 'beforeEnd':
                this.appendChild(parsedNode);
                break;
            case 'afterEnd':
                if (this.nextSibling) this.parentNode.insertBefore(parsedNode,this.nextSibling);
                    else this.parentNode.appendChild(parsedNode);
                break;
         }
     }

     HTMLElement.prototype.insertAdjacentHTML = function (where,htmlStr)
     {
         var r = this.ownerDocument.createRange();
         r.setStartBefore(this);
         var parsedHTML = r.createContextualFragment(htmlStr);
         this.insertAdjacentElement(where,parsedHTML)
     }

     HTMLElement.prototype.insertAdjacentText = function (where,txtStr)
     {
         var parsedText = document.createTextNode(txtStr)
         this.insertAdjacentElement(where,parsedText)
     }
}

/**
功能：拖动指定对象，并置当前对象为最高层
*/

var drag={
      x0:0,
      y0:0,//(x0,y0)开始拖动时鼠标的位置
      x1:0,
      y1:0,//(x1,y1)为对象初始状态的top,left值(也是坐标位置)
      move_enable:false,//标识是否可以移动
      obj_index:1000,
      obj:null, //移动控制对象，一般是title
      moveobj:'', //移动对象

      //---------public-----------------------------//
      min_top:0,
      min_left:0,
      max_top:mm_Height,
      max_left:mm_Width,

      /**********private**************************/

      //设置移动边界

      setmin:function(top,left)
      {
          this.min_top=top;
          this.min_left=left;
      },
   
      //设置移动边界最大

      setmax:function(top,left)
      {
          this.max_top=top;
          this.max_left=left;
      },

          /***********public*********************************/

      setRange:function(min_t,min_l,max_t,max_l)
      {
          this.setmin(min_t,min_l);
          this.setmax(max_t,max_l);
		  ChatsetRang=true;
 //		  alert(max_t);
     },

      //开始移动
      start:function(obj,moveobj,min_t,min_l,max_t,max_l)    
      {
          try{
              this.obj=obj;
              this.moveobj=moveobj;
              if((min_t=='')||(min_t)==null){
              }else{
                  this.setmin(min_t,min_l);
              }
              if((max_t=='')||(max_t)==null){
              }else{
                  this.setmax(max_t,max_l);
              }

              if(event.button==1)
              {
                  obj.setCapture();
                  this.x0=event.clientX;
                  this.y0=event.clientY;
                  this.x1=parseInt(moveobj.style.left);
                  this.y1=parseInt(moveobj.style.top);
                  this.move_enable=true;
              }

          }catch(e){
              alert(e)
              return false;
          }
      },

    

      //移动对象

      move:function(moveobj)
      {

          try{

              if((moveobj=='')||(moveobj==null))moveobj=this.moveobj;

              if(this.move_enable)

              {

                  var left=0;

                  var top=0;
                  left=event.clientX+this.x1-this.x0;
                  top=event.clientY+this.y1-this.y0;
                  left=(left<this.min_left)?this.min_left:left;
                  top=(top<this.min_top)?this.min_top:top;
                  left=(left>this.max_left)?this.max_left:left;
                  top=(top>this.max_top)?this.max_top:top;
                  moveobj.style.left=left;
                  moveobj.style.top=top;
				  
              }
          }catch(e){
              alert(e)
              return false;

          }

      },

      //停止对对象得移动

      stopdrag:function(obj)
      {
          if((obj=='')||(obj==null))obj=this.obj;
          if(this.move_enable)
          {
              obj.releaseCapture();
              this.move_enable=false;
          }
          this.move_enable=false;
      }    
}


/**

功能：模拟产生一个新的窗口

*/



var cwindow={
      _str:[],
      create:function(id,left,top,width,height,title,content,index){        
          var window_str='<div style="width:'+width+'px;height:'+height+'px;left:'+left+'px;top:'+top;
          window_str+='px;position:absolute;padding:0px;background:#EAEAFA;border:1px solid #000000; cursor:default;z-index:'+index+';" id="'+id+'">';    
          window_str+='<div id="title_'+id+'" onmousedown="drag.start(this,document.getElementById(\''+id+'\'))" onmouseup="drag.stopdrag()"';
          window_str+='onmousemove="drag.move()">'+title+'</div>'
          window_str+='<div id="content_'+id+'">'+content+'</div></div>';
          this._str=window_str;

//	dialog.style.borderTopWidth = '1px';
	  },

      insert:function(target)
      {
          if((target=='')||(target==null)){
              document.body.insertAdjacentHTML("beforeEnd",this._str);
          }else{
              eval('window.'+target+'.document.body.insertAdjacentHTML("beforeEnd",this._str)');
          }
      }

};


function winobj(Did,x,y,w,h,title,caps,area,Divindex){
	if(ChatsetRang){
	}else{
     drag.setRange(50,50,mm_Height,winWidth);
	}
     cwindow.create(Did,x,y,w,h,title,caps,area,Divindex);
     cwindow.insert();
}

function im_user_login(user){
	dialog_id = '_dialog' + user;
	if(document.getElementById(dialog_id)){
	document.getElementById(dialog_id).style.top=document.documentElement.scrollTop+100;
	ImDivMove = true;
	document.getElementById(dialog_id).style.display='block';
	}else{
	var msg_left;
	var msg_top;
	page_height= winHeight; 
	page_width= winWidth; 

    capsHtml="<DIV id=\"t0\"><DIV class=item>登录...</DIV><DIV class=more><A class=more href=\"javas" + "cript: im_box_close('" +dialog_id+ "','0')\"><img border=0 src='/images/windows_close.gif' width=37 height=12></A></DIV></DIV>";
	areaHtml="<DIV id=\"window_content\"><DIV class=co5><form method=\"POST\" action=\"/login.php?dir=1&url="+ window.location.href+"\" name=\"login\" onsubmit=\"return check_submit(this)\"><table border=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" width=\"100%\" id=\"table3\"><tr><td height=\"30\" align=\"center\" colspan=2>您需要登录后才能操作!</td></tr><tr><td width=\"20%\" height=\"30\" align=\"center\"><b>用户名</b>：</td><td width=\"30%\"><input type=\"text\" name=\"user\" size=\"20\" maxlength=\"15\" title=\"用户名\"></td></tr><tr><td height=\"30\" align=\"center\"><b>密　码</b>：</td>		<td><input type=\"password\" name=\"pws\" size=\"20\" maxlength=\"15\" title=\"密码\"></td></tr><tr><td height=\"50\" align=\"center\" colspan=2><input class=sbta type=\"submit\" value=\"　　登　录　　\" name=\"next\">　　　<a href=\"regsiter.php?url=\"><b>免费注册</b></a></td></tr></table></DIV><DIV class=lft style=\"background:#FFFFFF;width:334px;height: 120px;margin:4px; border:solid 1px #808099;overflow: auto;padding:3px\"><table border=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" width=\"100%\" id=\"table3\"><tr><td><font color=\"#808080\">为什么要注册168会员？<br>168会员是我们为您特意准备的一个帐户，您可使用它获得我们及相关网站的各类精彩服务。登录后，您不仅可查阅所需的信息、发布您的需求、推广您的企业，同时还将成为168大家庭的成员，共同建设我们自己的家园！</font></td></tr></table></DIV></DIV>";
    msg_top=document.documentElement.scrollTop+100;
    msg_left=(page_width-350)/2+((ImDivnums-1)*50);

	winobj(dialog_id,msg_left,msg_top,350,310,capsHtml,areaHtml,500);
	ImDivMove = true;
	}

}

function im_div_flush(divid) 
{ 
var e=document.getElementById(divid);
e.scrollTop=e.scrollHeight; 
} 

function im_chat_start(user,ImDivnums){

	ImDivChatmsgid="AJAX_im_chat_" +ImDivnums;
	msg="欢迎您!";
	url="/member/chat_ajax.php";
	params = "user="+escape(user)+"&chatno=" + ImDivnums +"&chat_start=1&&msg="+escape(msg);
	posturl=url + "?" + params;
//	ShowArticle(posturl);
	SendArticle(url,params);

	chat_interusrID[ImDivnums]=user;
	chat_intervalID[ImDivnums]=setInterval("im_chat_get('"+user+"','"+ImDivnums+"')",6000);
}

function im_chat_show(user){
//	mm_height=document.documentElement.scrollHeight-100;
    drag.setRange(50,50,mm_Height,mm_Width);
	dialog_id = '_dialog' + user.replace('%','__________');
	if(document.getElementById(dialog_id)){  //窗口已经存在
	ImDivChat++;
	document.getElementById(dialog_id).style.zIndex = ImDivChat;
	document.getElementById(dialog_id).style.top=document.documentElement.scrollTop+100;
	ImDivMove = true;
	document.getElementById(dialog_id).style.display='block';
			var no=null;
			for(i=1;i<=chat_interusrID.length;i++){
				if(chat_interusrID[i]==user){
					no=i;
					break;
				}
			}

			if(no!=null){
				chat_intervalID[no]=setInterval("im_chat_get('"+user+"','"+no+"')",6000);
			}

	}else{
var user_id = GetCookie('user_id');
if(user_id==null){
	dialog_id = '_dialog0';
	if(document.getElementById(dialog_id)){
	document.getElementById(dialog_id).style.top=document.documentElement.scrollTop+100;
	ImDivMove = true;
	document.getElementById(dialog_id).style.display='block';
	}else{
		im_user_login('0');
	}
}else{

	var msg_left;
	var msg_top;
	page_height= winHeight; 
	page_width= winWidth; 
	ImDivnums++;
	ImDivChat++;

    capsHtml="<DIV id=\"t0\"><DIV class=item>同" +user+"交谈中...[<A href=\"javas" + "cript: im_usermsg(''" +user+"')\">资料</a>]</DIV><DIV class=more><A class=more href=\"javas" + "cript: im_box_close('" +dialog_id+ "','" +user+"')\"><img border=0 src='/images/windows_close.gif' width=37 height=12></A></DIV></DIV><DIV class=clear></DIV>";
	areaHtml="<DIV id=\"window_content\"><DIV id=\"AJAX_im_chat_" +ImDivnums+ "\" class=lft style=\"background:#FFFFFF;width:334px;height: 174px;word-wrap:break-word;white-space:normal;margin:4px; border:solid 1px #808099;overflow: auto;padding:3px\"><font color=\"#808080\">不要在对话中透露您的密码或信用卡号码。</font></DIV><DIV class=clear></DIV><DIV id=\"AJAX_im_talk_" +ImDivnums+ "\" class=lft style=\"background:#FFFFFF;width:340px;height: 59px;margin:4px; border:solid 1px #808099;overflow: hidden\"><form method=\"POST\" name=\"Chatform_" +ImDivnums+ "\" onSubmit=\"im_chat_send('" +user+"','" +ImDivnums+ "');return false;\"><TABLE border=\"0\" cellpadding=\"0\" style=\"border-collapse: collapse\" width=\"100%\" cellspacing=\"0\">	<TR><TD><textarea name=\"msg\" cols=\"40\" class=\"sn\" rows=\"4\" title=\"发言内容\"></textarea></TD><TD><input class=im_button type=\"submit\" value=\" 发送 \" name=\"send\"></TD></form></TR></TABLE></DIV><DIV style=\"width:340px;height: 30px;margin-left:0px;text-align:right\"><input class=\"sbutton70\" type=button value=\"加为好友\" name=\"iv\" onclick=\"im_add_friend('" +user+"')\">　<input class=\"sbutton70\" type=button value=\"IM商信通\" name=\"cs\" onclick=\"im_friend()\">　<input class=\"sbutton70\" type=button value=\"发送文件\" name=\"sf\" onclick=\"im_sendfile('" +user+"')\">　　　<input class=\"sbta\" type=button value=\"聊天记录\" name=\"ch\" onclick=\"im_chatrec('" +user+"')\"></DIV></DIV>";
    msg_top=document.documentElement.scrollTop+100+((ImDivnums-1)*50);
    msg_left=(page_width-350)/2+((ImDivnums-1)*50);
 
	winobj(dialog_id,msg_left,msg_top,350,310,capsHtml,areaHtml,ImDivChat);

	url="/member/chat_ajax.php";
	params = "user="+escape(user)+"&chatno=" + ImDivnums;
	posturl=url + "?" + params;
	ShowArticle(posturl);

	ImDivChatmsgid="AJAX_im_chat_" +ImDivnums;
	im_div_flush(ImDivChatmsgid);

	chat_interusrID[ImDivnums]=user;
	chat_intervalID[ImDivnums]=setInterval("im_chat_get('"+user+"','"+ImDivnums+"')",6000);
	}
	}
}
var drag_=false;
var D=new Function('obj','return document.getElementById(obj);');
var oevent=new Function('e','if (!e) e = window.event;return e');
function Move_obj(obj){
	var x,y;
	D(obj).onmousedown=function(e){
		drag_=true;
		with(this){
			style.position="absolute";var temp1=offsetLeft;var temp2=offsetTop;
			x=oevent(e).clientX;y=oevent(e).clientY;
			document.onmousemove=function(e){
				if(!drag_)return false;
				with(this){
					style.left=temp1+oevent(e).clientX-x+"px";
					style.top=temp2+oevent(e).clientY-y+"px";
				}
			}
		}
		document.onmouseup=new Function("drag_=false");
	}
}


function im_usermsg(user){
		window.open("/bbs/space.php?username=" + user);
}

function im_setup(){
		window.open("/club/my.php?way=4");
}
function im_exit(){
		document.location="/exit.php";
}
function im_add_friend(user){
		window.open("/member/friend.php?mod=add&username=" + user );

}
function im_reflash(){
	if(document.getElementById("AJAX_im_msg")){
	ShowArticle('/member/im_ajax.php');
	}
}

function im_credit(Divid,user,clt_id){
	url="/member/credit_ajax.php";
	params = "divid=" +escape(Divid)+ "&user="+escape(user)+"&clt_id=" + clt_id;
	posturl=url + "?" + params;
	ShowArticle(posturl);
}

function im_mcredit(Divid,user,id_name,id_val){
	url="/member/mcredit_ajax.php";
	params = "divid=" +escape(Divid)+ "&user="+escape(user)+"&id_name=" + escape(id_name) + "&id_val=" + id_val;
	posturl=url + "?" + params;
	ShowArticle(posturl);
}


function im_chatrec(user){
}

function im_box_close(box_id,user){

//			url="/member/chat_ajax.php";
//			params = "user="+escape(user)+"&mode=cls";
//			posturl=url + "?" + params;
//			ShowArticle(posturl);
			var no=null;
			ad_but=box_id;
//			alert(box_id);
			for(i=1;i<=chat_interusrID.length;i++){
				if(chat_interusrID[i]==user){
					no=i;
					break;
				}
			}

			if(document.getElementById(ad_but)){
				document.getElementById(ad_but).style.display='none';
			}
			if(no!=null){
			clearInterval(chat_intervalID[no]);
			}
//	document.documentElement.removeChild(dialog);
}


function im_close(ad_but){
			if(document.getElementById(ad_but)){
				document.getElementById(ad_but).style.display='none';
			}
}
function im_win_close(){
			ad_but="AJAX_im_win";
			if(document.getElementById(ad_but)){
				document.getElementById(ad_but).style.display='none';
			ImDiawinshow=false;
			}
}
function im_win_show(){
	if(!ImDiawinshow){
			ad_but="AJAX_im_win";
			if(document.getElementById(ad_but)){
				document.getElementById(ad_but).style.display='block';
			ImDiawinshow=true;
			}
	}
}
function im_hidden(ad_but){
	if(ImDialogshow){
			ad_msg="AJAX_im_area";
			if(document.getElementById(ad_msg)){
				document.getElementById(ad_msg).style.display='none';
			}
//			ad_but="AJAX_im_msg";
			if(document.getElementById(ad_but)){
//				document.getElementById(ad_but).style.OVERFLOW='hidden';
//				document.getElementById(ad_but).style.WHITE-SPACE='nowrap';
//				lastScrollYImIm-=120;   
				Xtop=document.getElementById(ad_but).style.top;
				Xtop=Xtop.replace(/px/g,""); 
				Xtop=parseInt(Xtop)+120;
				document.getElementById(ad_but).style.top=Xtop + 'px';
				document.getElementById(ad_but).style.height='30px';
			}
	ImDialogshow=false;
	}
}
function im_win_chat(val){
	if(ImDiaChatshow!=val){
			ad_but="AJAX_im_friend";
			ad_area="AJAX_im_but" + val;
			msg=document.getElementById(ad_area).innerHTML;
			if(document.getElementById(ad_but)){
				document.getElementById(ad_but).innerHTML=msg;
			ImDiaChatshow=val;
			}
	}
}

function im_dialog(ad_but){
	if(!ImDialogshow){
			ad_msg="AJAX_im_area";
			if(document.getElementById(ad_msg)){
				document.getElementById(ad_msg).style.display='block';
			}
//			ad_but="AJAX_im_msg";
			if(document.getElementById(ad_but)){
				document.getElementById(ad_but).style.OVERFLOW='hidden';
//				document.getElementById(ad_but).style.WHITE-SPACE='nowrap';
//				lastScrollYImIm+=120;   
				Xtop=document.getElementById(ad_but).style.top;
				Xtop=Xtop.replace(/px/g,""); 
				Xtop=parseInt(Xtop)-120;
				document.getElementById(ad_but).style.top=Xtop + 'px';
				document.getElementById(ad_but).style.height='150px';
			}
	ImDialogshow=true;
	}
}

function im_friend(){
	ad_msg="AJAX_im_win";
	if(!document.getElementById(ad_msg)){
		im_msg_pan('');
		document.getElementById(ad_msg).style.display='block';
		ImDiawinshow=true;
		ShowArticle('/member/im_ajax.php');
		setInterval("im_reflash()",6000);
	}else{
	if(!ImDiawinshow){
			if(document.getElementById(ad_msg)){
				document.getElementById(ad_msg).style.display='block';
			}
	ImDiawinshow=true;
	}else{
			if(document.getElementById(ad_msg)){
				document.getElementById(ad_msg).style.display='none';
			}
	ImDiawinshow=false;
	}
	}
}

