function BaseJavaScript(){
	this.xmlHttp=null;
		
	this.createHttpRequest=function(){
		var temp;
		if(window.XMLHttpRequest){
			temp=new XMLHttpRequest();
		} 
		else if (window.ActiveXObject){
			temp=new ActiveXObject("Msxml2.xmlHttp");
			if (!temp){
				temp=new ActiveXObject("Microsoft.xmlHttp");
			}
		}
		return temp;
	}
	
	this.aftersearch=function(){
		if(this.xmlHttp.readyState == 4){
			if(this.xmlHttp.status == 200){
				try{
					var textValue=this.xmlHttp.responseText;
					this.showStatus(textValue);
				}
				catch(e) {
					alert(e);
				}
			}
		}
	}
	
	this.sendData=function(){
		this.number=document.getStatusForm.number.value;
			this.layerPath="../";
			this.xmlHttp=this.createHttpRequest();
			var path=this.layerPath+"order.do?action=getorderstatus&number="+this.number;
			var loader=this;
			this.xmlHttp.onreadystatechange=function(){
				loader.aftersearch.call(loader);
			}
			this.xmlHttp.open("POST",path,true);
			var xmlnode="";
			this.xmlHttp.send(xmlnode);
	}
	
	this.showStatus=function(textValue){
		if(textValue=='-1'){
			document.getStatusForm.status.value="wrong order number!";
		}else if(textValue=='0'){
			document.getStatusForm.status.value="The order has not been confirmed!";
		}else if(textValue=='1'){
			document.getStatusForm.status.value="The order has been confirmed and the deal is going!";
		}else if(textValue=='2'){
			document.getStatusForm.status.value="The order has been finished!";
		}
	}
}