var postto = '/token.php';
if(fanclub != ''){ postto = '/' + fanclub + postto; }
var AjaxObject = {
handleSuccess:function(o){this.processResult(o);},
handleFailure:function(o){},
processResult:function(o){},
startRequest:function(cb, uri){YAHOO.util.Connect.asyncRequest('POST', postto, cb, "uri=" + uri + "&bcrumb=" + bcrumb);}
};

var AJAX = {
	createXMLHttpRequest: function() {
		if(window.ActiveXObject){
			try {
				return new ActiveXObject("Msxml2.XMLHTTP.6.0");
				try {
					return new ActiveXObject("Msxml2.XMLHTTP.5.0");
				} catch(e) {
					try {
						return new ActiveXObject("Msxml2.XMLHTTP.4.0");
					} catch(e) {
						try {
							return new ActiveXObject("Msxml2.XMLHTTP.3.0");
						} catch(e) {
							try {
								return new ActiveXObject("Msxml2.XMLHTTP");
							} catch(e) {
							}

						}
					}
				}
			} catch(e) {
				try {
					return new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e2) {
					return null;
				}
			}
		} else if(window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else {
			return null;
		}
	},
	startGetTok: function(uri, callback, async){
		this.sendRequest("uri="+uri + "&bcrumb=" + bcrumb,postto, async, callback);
	},
	sendRequest: function(data,url, async, callback){
		var obj = this.createXMLHttpRequest();
		var cb = callback;
		if( obj == null ) return null;
		
		obj.open( 'POST', url, async );
		obj.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
	
		if(Is.opera || Is.safari || Is.gecko) {
			obj.onload = function() { cb(obj.responseText);}
		} else {
			obj.onreadystatechange = function() {
				if (obj.readyState == 4) {
					if(obj.status == 200) {
						cb(obj.responseText);
					}
				}
			}
		}
		obj.send(data);
	}
};

