String.prototype.trim = function () {
	return this.replace(/(^\s+)|(\s+$)/g, "");
};
var qiye_url = {
	price:"http://services.qiye.163.com/service/s.do?api=admin.price", 
	vip:"http://services.qiye.163.com/service/s.do?api=admin.register",
	dstrib:"http://services.qiye.163.com/service/s.do?api=admin.queryAgent"
	//vip:"http://mail.cowork.com.cn/domain/serv/vipregister2.jsp"
};
	
var getId = function(id){
	return document.getElementById(id);
};

var response = {
	execute:function(txt){
		if(this.callback){
			var obj = {
				"responseText":txt
			};
			this.callback(obj);
		}
		//
		XMLHttp.running = false;
		this.callback = null;
	},
	callback:null
};
var lock = false;
var XMLHttp = {
	running:false,
	sendReq:function(url, callback, encodeUrl) {
		//
		if(this.running){
			return;
		}
		this.running = true;
		
		//
		var head = document.getElementsByTagName("head")[0] || document.documentElement,
		script = document.createElement("script");
		script.type = "text/javascript";
		response.callback = callback;
		url = url.replace(/([^\?]+\?[^\?]+)\?(\.*)/, "$1&$2");
		if(encodeUrl){
			url = encodeURI(url);
		}
		script.src=url;
		
		// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
		// This arises when a base node is used (#2709).
		head.insertBefore( script, head.firstChild );
		
		//delete the node after 10 seconds
		setTimeout(function(){
			head.removeChild( script );
		},10000);
	}
};



