_X = new function(){
	this.request = function( url , objValue , func , isPost , isJson ){
		try{
			var strUrl = url +"";
			var xhr = new XMLHttpRequest();
			var type = "GET";
			if( isPost ){
				type ="POST";
			};
/*
			var params = "now=" + Date.now();

			if( objValue ){
				for( key in objValue ){
					params += "&" + encodeURIComponent( key ) + "=" + encodeURIComponent( objValue[key] );
				};
			};
			if( isPost != true ){
				strUrl += "?" + params;
				params = null;
			};
*/
			var params = new FormData();
			params.append( "now" , Date.now() );

			if( objValue ){
				for( key in objValue ){
					params.append( key , objValue[key] );
				};
			};


			xhr.open( type , strUrl , true );
/*
			if( isPost ){
				if( isJson ){
					xhr.setRequestHeader('Content-Type","application/json');
				}else{
					xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
				};
			};
*/
			xhr.timeout = 30000;
			if( isJson ){
				xhr.responseType = "json";
			};

	/*		xhr.onreadystatechange=function(){
				if (xhr.readyState==4 ){
					doAfter();
					if(  xhr.status>=200 && xhr.status < 300 ){
						func( xhr );
						xhr.abort();
						delete xhr;
					}else{
						alert( "通信に失敗しました。(" + xhr.status + ")" );
						delete xhr;
					};

				};
			};


			xhr.onerror = doAfter;
			xhr.ontimeout = doAfter;
	*/
			xhr.onerror = function(){
				var hogehoge = 1;
			};
			xhr.ontimeout = function(){
				var hogehoge = 1;
			};

			xhr.onloadend = function(){ func(xhr);delete xhr; };
			xhr.send( params );
		}catch( e ){
			func( null );
		}
	};
	this.requestJson = function( url , objValue , func , isPost ){
/*
		var after = function( xhr ){
			if (xhr.readyState==4 && xhr.status>=200 && xhr.status < 300 ){
				func( xhr.response );
			}else{
				func( {mode:"F",error:"communication error"} );
			};
		};
*/
		this.request( url , objValue , func , isPost , true )
	};
}();
