//ajax
function getObject(objectId) {
if(document.getElementById && document.getElementById(objectId))
{
// W3C DOM
return document.getElementById(objectId);
}
else if (document.all && document.all(objectId))
{
// MSIE 4 DOM
return document.all(objectId);
}
else if (document.layers && document.layers[objectId])
{
// NN 4 DOM.. note: this won't find nested layers
return document.layers[objectId];
}
else
{
return false;
}
}
// CreateXMLHttpRequest
function CreateXMLHttpRequest()
{
// Initialize Mozilla XMLHttpRequest object
var xmlHttp;
if (window.XMLHttpRequest)
{
xmlHttp = new XMLHttpRequest();
}
// Initialize for IE/Windows ActiveX version
else if (window.ActiveXObject)
{
try
{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
}
catch (e)
{
try
{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
newsstring = "对不起,您的浏览器不支持XMLHttpRequest对象!";}
}
}
return xmlHttp;
}
function getDataTimes()
{
var strDate,strTime;
strDate = new Date();
strTime = strDate.getTime();
return strTime;
}
//获取信息
function ShowMess()
{
var strtime = getDataTimes();
var url="mess.asp?strTime="+strtime;
var requestType = "mess_box";
var xmlHttp=CreateXMLHttpRequest();
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
getObject(requestType).innerHTML = xmlHttp.responseText;
}
}
xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.send(null);
$();
online();
}
//发送信息
function SendMess()
{
var strtime = getDataTimes();
var mess = escape(document.getElementById('mess').value);
var mtowho = escape(document.getElementById('mtowho').value);
var mfont = escape(document.getElementById('mfont').value);
var mfcolor = escape(document.getElementById('mfcolor').value);
var elist = escape(document.getElementById('elist').value);
if (mess=="")
{
alert("不能发空信息!");
return false;
}
var url="SendMess.asp?mess="+mess+"&mtowho="+mtowho+"&mfont="+mfont+"&mfcolor="+mfcolor+"&elist="+elist+"&strTime="+strtime;
var xmlHttp=CreateXMLHttpRequest();
xmlHttp.open("get", url, true);
xmlHttp.send(null);
ShowMess();
document.getElementById('mess').value="";
}
//刷新
function getmess()
{
time=window.setInterval("ShowMess()",2000);
}
//检查是否离开
function $() {
var strtime = getDataTimes();
var url="k.asp?strTime="+strtime;
var xmlHttp=CreateXMLHttpRequest();
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
if (xmlHttp.responseText=="showScreen"){
showScreen();
}
}
}
xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.send(null);
}
// 获取宽度
function getWidth()
{
var strWidth,clientWidth,bodyWidth;
clientWidth = document.documentElement.clientWidth;
bodyWidth = document.body.clientWidth;
if(bodyWidth > clientWidth){
strWidth = bodyWidth + 20;
} else {
strWidth = clientWidth;
}
return strWidth;
}
//获取高度
function getHeight()
{
var strHeight,clientHeight,bodyHeight;
clientHeight = document.documentElement.clientHeight;
bodyHeight = document.body.clientHeight;
if(bodyHeight > clientHeight){
strHeight = bodyHeight + 30;
} else {
strHeight = clientHeight;
}
return strHeight;
}
// 锁屏
function showScreen()
{
var Element = getObject('Message');
var Elements = getObject('Screen');
Elements.style.width = getWidth();
Elements.style.height = getHeight();
Element.style.display = 'block';
Elements.style.display = 'block';
getObject('mfont').disabled = true;
getObject('mfcolor').disabled = true;
getObject('elist').disabled = true;
}
//解屏
function hideScreen()
{
var Element = getObject('Message');
var Elements = getObject('Screen');
Element.style.display = 'none';
Elements.style.display = 'none';
getObject('mfont').disabled = false;
getObject('mfcolor').disabled = false;
getObject('elist').disabled = false;
}
//提交名称
function chkuser()
{
var strtime = getDataTimes();
var userid = escape(document.getElementById('userid').value);
var ischk;
if (userid=="")
{
alert("请输入名称!");
return false;
}
var url="user.asp?userid="+userid+"&strTime="+strtime;
var xmlHttp=CreateXMLHttpRequest();
xmlHttp.open("get", url, true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
if (xmlHttp.responseText=="no"){
getObject("errmeg").innerHTML="你的名称已占用";
}
else
{
hideScreen();
}
}
}
xmlHttp.send(null);
}
//显示 在线人数
function online()
{
var strtime = getDataTimes();
var url="online.asp?strTime="+strtime;
var xmlHttp=CreateXMLHttpRequest();
var requestType = "on_line";
xmlHttp.open("get", url, true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
{
getObject(requestType).innerHTML=xmlHttp.responseText;
}
}
xmlHttp.setRequestHeader("If-Modified-Since","0");
xmlHttp.send(null);
}
//选择对话人
function mtowho(mtowho){
var requestType="mtowho";
getObject(requestType).value=mtowho;
}
wholesale china product ,this is cheap china product,china electronics
wholesale retail company from china
achinaseller.com is a professional wholesale retail company, having our own factory with 5 years of wholesale retail experience. Achinaseller.com is also cooperating closely with many factories, so the price that we offer to the consumer is directly from the Chinese Factory. Without leaving your home, you could order your own products at achinaseller.com at the lowest price.
We service over 100,000 registered buyers, delivering to virtually every country in the world. Our warehouse and office are staffed by a young team of Chinese and Western staff.
Happy AchinaSeller buyers include frequent wholesale importers, famous ecommerce websites, eBay powersellers, retail shops and startup home import businesses. On a daily basis, we serve corporate buyers, drop-ship experts, home business Moms, and small bussiness wholesaler
We service over 100,000 registered buyers, delivering to virtually every country in the world. Our warehouse and office are staffed by a young team of Chinese and Western staff.
Happy AchinaSeller buyers include frequent wholesale importers, famous ecommerce websites, eBay powersellers, retail shops and startup home import businesses. On a daily basis, we serve corporate buyers, drop-ship experts, home business Moms, and small bussiness wholesaler
没有评论:
发表评论