// ajax通常使用的函数
function Get_AJAX(){
    var ajax = false; 
    try { 
    	ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e) { 
   	 	try { 
    		ajax = new ActiveXObject("Microsoft.XMLHTTP"); 
    	} catch (E) { 
    		ajax = false; 
    	} 
    }
    if (!ajax && typeof XMLHttpRequest != 'undefined') { 
    	ajax = new XMLHttpRequest(); 
    } 
    return ajax;
}
var ajax       = Get_AJAX();
var url  	   = document.referrer;
var bowertype  = navigator.appName;

//发送请求
function ajax_send(){
	url="count.php?url=" + url + "&bowertype=" + bowertype + "&time=" + new Date().getTime();
	ajax.open("GET", url, true);
	ajax.onreadystatechange = check_code;
	ajax.send();
}
//处理响应
function check_code(){
	if(ajax.readyState == 4){
		if(ajax.status == 200){
			//当响应接收完毕并且无错误的时候
;			if(ajax.responseText == '1'){
               //验证码正确
			} else {
				//验证码错误
				alert("数据库错误")
			}
		} else {
			
		}
	} else {
		//响应没有接收完，还处于等待过程
		
	}
}
window.onload=function(){
ajax_send();
}
