﻿// Ajax 提交方法
function xmlHttp()
{var xmlhttp = null; if ( !xmlhttp && typeof(XMLHttpRequest) != "undefined" ){xmlhttp=new XMLHttpRequest();xmlhttp.overrideMimeType('text/xml');}	else{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");	}return xmlhttp;}
function Ajax()
{
	this.xmlHttp = new xmlHttp();
	/* function()
	{
		var xmlhttp = null; if ( !xmlhttp && typeof(XMLHttpRequest) != "undefined" ){xmlhttp=new XMLHttpRequest();xmlhttp.overrideMimeType('text/xml');}	else{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");return xmlhttp;}
	};
	*/
	this.Mothod = "get";
	this.onreadyChange = new function(){};
	this.Url = "";
	this.QueryString = "";
}
Ajax.prototype.send = function()
{
	if(this.Mothod.toLowerCase()=="get")
	{
		this.xmlHttp.open("GET",this.Url+this.QueryString,true);
		this.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
		this.xmlHttp.send(null);
	}
	else
	{
		this.xmlHttp.open("POST",this.Url,true);
		this.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
		this.xmlHttp.send(QueryString);
	}
	this.xmlHttp.onreadystatechange = this.onreadyChange;
}
function $(n)
{
	return document.getElementById(n);
}
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;
}
