<!-- 
function   getDim(el)
{   
  var   rd   =   {x:0,y:0}   
  do
  {   
	  rd.x   +=   el.offsetLeft   
	  rd.y   +=   el.offsetTop   
	  el   =   el.offsetParent   
  }   
  while(el)    
  return   rd   
} 

function getSelectedRadioValue(radioName)
{
var radioObj = document.all(radioName); 
var radioValue;

if(radioObj.length){
for(var i = 0; i < radioObj.length; i++)
{

   if(radioObj[i].checked)
   {  
    radioValue = radioObj[i].value;
   }
}
}else{
      if(radioObj){
         radioValue = radioObj.value;
      }else{
    radioValue = 0;
   }
}
return radioValue;
}

function img(){
	var location1 = prompt("请输入图片的地址：","http://");
	if(location1){
	selImg(location1);
	}
}
function url(){
	var location1 = prompt("请输入网址：","http://");
	if(location1){
	document.all.modes.value+="[url]"+location1;
	}
}
function xx(){
document.getElementById("wjbsc").innerHTML="<input type='button' name='Submit3' onclick='javascript:window.open()' value='接收文件'><input type='submit' name='Submit4' onClick='showOrHide3(0),qx(files2.value)' value='取消'>";
}

document.cookie="zx=yes";
function showOrHide(value) {
    if (value==0) {
        if (document.layers)
           document.layers["Layer1"].visibility='hide';
        else
           document.all["Layer1"].style.visibility='hidden';
   }
   else if (value==1) {
	   	var txtSendvar = getDim(document.getElementById("modes"));
	var txtSendX=txtSendvar.x;
	var txtSendY=txtSendvar.y;
	document.getElementById("Layer1").style.left = txtSendX;
document.getElementById("Layer1").style.top = txtSendY - 165;
       if (document.layers)
          document.layers["Layer1"].visibility='show';
       else
          document.all["Layer1"].style.visibility='visible';
   }
}
function showOrHide1(value) {
    if (value==0) {
        if (document.layers)
           document.layers["Layer2"].visibility='hide';
        else
           document.all["Layer2"].style.visibility='hidden';
   }
   else if (value==1) {
	      	var txtSendvar = getDim(document.getElementById("modes"));
	var txtSendX=txtSendvar.x;
	var txtSendY=txtSendvar.y;
	document.getElementById("Layer2").style.left = txtSendX;
document.getElementById("Layer2").style.top = txtSendY - 60;
       if (document.layers)
          document.layers["Layer2"].visibility='show';
       else
          document.all["Layer2"].style.visibility='visible';
   }
}

function showOrHide2(value) {
    if (value==0) {
        if (document.layers)
           document.layers["Layer3"].visibility='hide';
        else
           document.all["Layer3"].style.visibility='hidden';
   }
   else if (value==1) {
	   var txtSendvar = getDim(document.getElementById("modes"));
	var txtSendX=txtSendvar.x;
	var txtSendY=txtSendvar.y;
	document.getElementById("Layer3").style.left = txtSendX;
document.getElementById("Layer3").style.top = txtSendY - 90;
       if (document.layers)
          document.layers["Layer3"].visibility='show';
       else
          document.all["Layer3"].style.visibility='visible';
   }
}
function showOrHide3(value) {
    if (value==0) {
        if (document.layers)
           document.layers["Layer4"].visibility='hide';
        else
           document.all["Layer4"].style.visibility='hidden';
   }
   else if (value==1) {
       if (document.layers)
          document.layers["Layer4"].visibility='show';
       else
          document.all["Layer4"].style.visibility='visible';
   }
}
//===================================================
function selImg(s){ 
if(!s){return false;} 
var h=s.substr(s.lastIndexOf(".")+1,3); 
if(h=="gif"||h=="jpg" || h=="GIF" || h=="JPG"){
var txtx=document.getElementById("txtx");
o=document.createElement("IMG");
o.src=s;
txtx.appendChild(o);
}
else{
alert("请选择正确的图片格式~");
}
}
function opens()
{
window.open("bsavess.asp?fid="+fid.value+"",'窗','top=0,left=100,width=450,height=550,scrollbars=yes,resizable=no,status=yes,z-look=yes,alwaysRaised=yes,location=no,depended=no,center:yes');
}

function zj()
{
window.open("zj.asp?use="+use.value+"&fid="+fid.value+"",'窗','top=100,left=200,width=300,height=200,scrollbars=yes,resizable=no,status=yes,z-look=yes,alwaysRaised=yes,location=no,depended=no,center:yes');
}
//====================================================
var fs, ff,fc,fb,fi,fu; 
function changeSize(obj){ 
document.all.modes.style.fontSize = obj.value; 
fs = obj.value; 

} 
function changeFont(obj){ 
document.all.modes.style.fontFamily = obj.value; 
ff = obj.value; 

} 
function changeColors(obj){ 
document.all.modes.style.color = obj.value; 
fc = obj.value; 

} 
function changeb(obj){ 
document.all.modes.style.weight = obj.value; 
fb = obj.value; 

} 

function changei(obj){ 
document.all.modes.style.italic = obj.value; 
fi = obj.value; 

} 
function changeu(obj){ 
document.all.modes.style.decoration = obj.value; 
fu = obj.value; 

} 


function sendText() 
{ 
var oTxt = document.getElementById("txtx"); 
var fffc=fc+fs+ff+fb+fi+fu;
var fstr = "<span style='color:" + fc + ";font-size:" + fs + "px;font-family:" + ff + ";font-weight:" + fb + ";font-style:"+fi+";text-decoration:"+fu+"'>";mode.value = fstr +modes.innerHTML+ "</span>";  
if (document.getElementById("txtx").value=="" && modes.innerHTML=="")
{
//alert("请输入内容！")
}
else
{
var D=new Date();
var hh=D.getHours();
var mm=D.getMinutes();
var ss=D.getSeconds();
var e=document.getElementById("div1");
var txts=document.getElementById("txts");
txts.value=txts.value.replace(/\r/gi,"<br>");
e.innerHTML=e.innerHTML+"<br>\n<font color=#008040>你说</font><font color=#008040> "+hh+":"+mm+":"+ss+" </font><br>&nbsp;&nbsp;"+txts.value; //加到聊天页
e.scrollTop=e.scrollHeight;

var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
xmlhttp.open("GET", 'f_win_tj.asp?fid='+fid.value+'&fuid='+fuid.value+'&use='+use.value+'&fuse='+fuse.value+'&txts='+txts.value+'',true); 
xmlhttp.onreadystatechange=function()
{ 
if (xmlhttp.readyState==4)
{  
if (xmlhttp.status == 200)
{ 
if(xmlhttp.responseText.indexOf('e0909o') > -1)
{
alert("对方可能关闭窗口，发送不成功，\n\n你可以关闭对话框重新邀请交谈。");
}
}
else
{
alert("发送不成功！");
}
}
} 
xmlhttp.send(null) 
txtx.value='';
}
} 


function cke()
{
var xmlhttpp = new ActiveXObject("Microsoft.XMLHTTP"); 
xmlhttpp.open("GET", 'f_oncho.asp?fid='+fid.value,false); 
xmlhttpp.send(null);
}

function submitForm() 
{
//if(event.ctrlKey && event.keyCode == 13) 
//{ 
//sendText();
//} 

} 

function keypress(evt){
var postkey=getSelectedRadioValue("fsf");
	evt = evt ? evt : (window.event ? window.event : null); 
  if (postkey==1){
		if (!evt.shiftKey&&evt.keyCode==13){
		 sendText();
			return false;
		}
		return true;
	}
	if (postkey==2){
		if (evt.ctrlKey&&evt.keyCode==10){
		sendText();
		}
	}
}

function scss()
{ 
var ess=document.getElementById("div1");
ess.scrollTop=ess.scrollHeight+9999;
} 

function sends()
{
var url="f_win_jc22.asp?fid="+fid.value;
var xmlhttp = false; 
       if(window.XMLHttpRequest) {
               xmlhttp = new XMLHttpRequest(); 
                  if (xmlhttp.overrideMimeType) {
                        xmlhttp.overrideMimeType("text/xml"); 
                     } 
              } 
              else if (window.ActiveXObject) { 
                     try { 
                            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
                     } catch (e) { 
                            try { 
                                   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
                            } catch (ei) {} 
                     } 
              } 
              if (!xmlhttp) { 
                     window.alert(" 不能创建 XMLHttpRequest 对象实例 ."); 
                     return false; 
              } 
			  
xmlhttp.open("GET",url,true); 
xmlhttp.onreadystatechange=function() { 
if (xmlhttp.readyState==4) { 
{

if (xmlhttp.responseText.indexOf("errors") > -1 )
{
if (GetCookie('cha22')!='yes')
{
alert("对方已关闭对话框！");
document.cookie="cha22=yes";
}
}
if(xmlhttp.responseText.indexOf("fffggg") > -1 )
{
document.getElementById("plo").src="f_file_2.asp?fid="+fid.value+"&fuse="+fuse.value+"&use="+use.value+"";
showOrHide3(1);
//document.bgss.play();
document.getElementById("soundMsg").src="sound/type.wma";
window.focus();
}

if(xmlhttp.responseText.indexOf("wjbsc") > -1 )
{
document.getElementById("files").innerHTML="<font color=red>对方已取消操作。</font>";
window.focus();
}
if(xmlhttp.responseText.indexOf("mmmyyy") > -1 )
{
document.getElementById("m_form").src="51KF_mx.asp?fid="+fid.value+"&fuse="+fuse.value+"&use="+use.value+"";
//document.bgss.play();
document.getElementById("soundMsg").src="sound/type.wma";
window.focus();
modes.focus();
}
}
setTimeout('sends()',1000);
} 
} 
xmlhttp.send(null)
}


function getCookieVal (offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name)
{
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen)
{
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}

function coo()
{
document.cookie="cha2=yes2";
}

function cls()
{
txtx.value='';
}
function uncook()
{
document.cookie="zx=no";
}
function qx(str)
{
var xmlhttpp = new ActiveXObject("Microsoft.XMLHTTP"); 
xmlhttpp.open("GET", 'f_file_qx.asp?f='+str+'&n='+fid.value+'',false);
xmlhttpp.send(null);
showOrHide3(0);
}
function wccs()
{
var xmlhttppa = new ActiveXObject("Microsoft.XMLHTTP"); 
xmlhttppa.open("GET", 'f_file_wc.asp?n='+fid.value,false);
xmlhttppa.send(null);
showOrHide3(0);
}
-->