XSSRequest = { 
	stack_callback : {},
	request : function(id,url,callback,timeout,ifdebug){

		var cid = id ;
		var func_cb = callback || function(){};
		if(url.indexOf('?')>0){
			url += '&';	
		}else{
			url += '?';
		}
		url += 'requestId=' + cid + '&callback=XSSRequest.response';
		this.debug=ifdebug;

		var stackObj_cb = {};
		stackObj_cb.requestId = cid;
		stackObj_cb.function_callback = func_cb;
		stackObj_cb.url = url;

		this.stack_callback[cid] = stackObj_cb;
		var s = document.createElement('script');
		s.type = 'text/javascript';
		s.src = url;
		this.authTimer=setTimeout("XSSRequest.response('"+cid+"',XSSRequest.timeoutObj);",timeout*1000);
		document.getElementsByTagName('head')[0].appendChild(s);
	},
	response : function(requestId,responseObj){
		if(this.debug){
			alert(requestId);
			debug(responseObj);
		}
		if(this.authTimer) clearTimeout(this.authTimer);
		if(this.stack_callback[requestId]){
			(this.stack_callback[requestId].function_callback)(responseObj);
			delete this.stack_callback[requestId];
		}
	},
	authTimer : null,
	timeoutObj : {result:'false',message:'Á´½Ó³¬Ê±'},
	debug: false
}
