// JavaScript Document
var xmlHttp;
var PID = 0;
var ID = 0;
var SID = '';
var Old = 0;
function getAjax(){
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				alert("您的浏览器不支持AJAX！");
				return false;
			}
		}
	}
}

function writeHtml(){
	if(ID != 0){
		var divSor = document.getElementById('secondSor'+ID);
	}
	if (PID != 0){
		var divSor = document.getElementById('secondSor'+PID);
	}
	divSor.style.display='';
	if(xmlHttp.readyState==4){
		//alert(xmlHttp.responseText);
		divSor.innerHTML = xmlHttp.responseText;
	}
}

function sendMess(){
	getAjax();
	xmlHttp.onreadystatechange = writeHtml;
	var url;
	if(ID != 0){
		url = "secondSor.php?ID="+ID+"&SID="+SID;
	}
	if (PID != 0){
		url = "secondSor.php?PID="+PID+"&SID="+SID;
	}
	//alert(url);
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function divDisplay(){
	if(PID != 0){
		var divSor = document.getElementById('secondSor'+PID);	
		divSor.style.display='none';
	}
	if(Old != 0){
		var divSor = document.getElementById('secondSor'+Old);	
		divSor.style.display='none';
	}
	if(ID != 0){
		var divSor = document.getElementById('secondSor'+ID);	
		divSor.style.display='none';
	}
}

function press(){
	if((event.ctrlKey) && (event.keyCode==67)){
		alert("欢迎光临本站！");
		document.onclick = 1;
	}
}
function click1() {
	if (event.button==2){
		alert("欢迎光临本站！");
	}
}
//document.onkeydown = press;
//
//document.onmousedown=click1;
