<!--

var QSXHTTP = null;
var QSXDOM = null;
var QSContainer = null;
var QSShowError = false;
var QSShowWait = false;
var QSErrCon = "";
var QSErrDisplay = "Download false!";
var QSWaitDisplay = "Loading...";

function $DE(id)
{
	return document.getElementById(id);
}

function QSAjax(gcontainer,mShowError,mShowWait,mErrCon,mErrDisplay,mWaitDisplay)
{

QSContainer = gcontainer;
QSShowError = mShowError;
QSShowWait = mShowWait;
if(mErrCon!="") QSErrCon = mErrCon;
if(mErrDisplay!="") QSErrDisplay = mErrDisplay;
if(mErrDisplay=="x") QSErrDisplay = "";
if(mWaitDisplay!="") QSWaitDisplay = mWaitDisplay;


this.keys = Array();
this.values = Array();
this.keyCount = -1;

this.rkeys = Array();
this.rvalues = Array();
this.rkeyCount = -1;

this.rtype = 'text';

if(window.ActiveXObject)
{
	 try { QSXHTTP = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) { }
   if (QSXHTTP == null) try { QSXHTTP = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) { }
}
else
{
	 QSXHTTP = new XMLHttpRequest();
}

this.AddKey = function(skey,svalue)
{
	this.keyCount++;
	this.keys[this.keyCount] = skey;
	svalue = svalue.replace(/\+/g,'$#$');
	this.values[this.keyCount] = escape(svalue);
};

this.AddHead = function(skey,svalue)
{
	this.rkeyCount++;
	this.rkeys[this.rkeyCount] = skey;
	this.rvalues[this.rkeyCount] = svalue;
};

this.ClearSet = function()
{
	this.keyCount = -1;
	this.keys = Array();
	this.values = Array();
	this.rkeyCount = -1;
	this.rkeys = Array();
	this.rvalues = Array();
};


QSXHTTP.onreadystatechange = function()
{
	if(QSXHTTP.readyState == 4){
    if(QSXHTTP.status == 200){
       if(QSXHTTP.responseText!=QSErrCon){
         QSContainer.innerHTML = QSXHTTP.responseText;
       }else{
       	 if(QSShowError) QSContainer.innerHTML = QSErrDisplay;
       }
       QSXHTTP = null;
    }else{ if(QSShowError) QSContainer.innerHTML = QSErrDisplay; }
  }else{ if(QSShowWait) QSContainer.innerHTML = QSWaitDisplay; }
};

this.BarrageStat = function()
{
	if(QSXHTTP==null) return;
	if(typeof(QSXHTTP.status)!=undefined && QSXHTTP.status == 200)
  {
     if(QSXHTTP.responseText!=QSErrCon){
         QSContainer.innerHTML = QSXHTTP.responseText;
     }else{
       	if(QSShowError) QSContainer.innerHTML = QSErrDisplay;
     }
  }
};

this.SendHead = function()
{
	if(this.rkeyCount!=-1){
  	for(;i<=this.rkeyCount;i++){
  		QSXHTTP.setRequestHeader(this.rkeys[i],this.rvalues[i]); 
  	}
  }
　if(this.rtype=='binary'){
  	QSXHTTP.setRequestHeader("Content-Type","multipart/form-data");
  }else{
  	QSXHTTP.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  }
};

this.SendPost = function(purl)
{
	var pdata = "";
	var i=0;
	this.state = 0;
	QSXHTTP.open("POST", purl, true); 
	this.SendHead();
  if(this.keyCount!=-1){
  	for(;i<=this.keyCount;i++){
  		if(pdata=="") pdata = this.keys[i]+'='+this.values[i];
  		else pdata += "&"+this.keys[i]+'='+this.values[i];
  	}
  }
  QSXHTTP.send(pdata);
};

this.SendGet = function(purl)
{
	var gkey = "";
	var i=0;
	this.state = 0;
	if(this.keyCount!=-1){
  	for(;i<=this.keyCount;i++){
  		if(gkey=="") gkey = this.keys[i]+'='+this.values[i];
  		else gkey += "&"+this.keys[i]+'='+this.values[i];
  	}
  	if(purl.indexOf('?')==-1) purl = purl + '?' + gkey;
  	else  purl = purl + '&' + gkey;
  }
	QSXHTTP.open("GET", purl, true); 
	this.SendHead();
  QSXHTTP.send(null);
};

this.SendGet2 = function(purl)
{
	var gkey = "";
	var i=0;
	this.state = 0;
	if(this.keyCount!=-1){
  	for(;i<=this.keyCount;i++){
  		if(gkey=="") gkey = this.keys[i]+'='+this.values[i];
  		else gkey += "&"+this.keys[i]+'='+this.values[i];
  	}
  	if(purl.indexOf('?')==-1) purl = purl + '?' + gkey;
  	else  purl = purl + '&' + gkey;
  }
	QSXHTTP.open("GET", purl, false); 
	this.SendHead();
  QSXHTTP.send(null);
  this.BarrageStat();
};

this.SendPost2 = function(purl)
{
	var pdata = "";
	var i=0;
	this.state = 0;
	QSXHTTP.open("POST", purl, false); 
	this.SendHead();
  if(this.keyCount!=-1){
  	for(;i<=this.keyCount;i++){
  		if(pdata=="") pdata = this.keys[i]+'='+this.values[i];
  		else pdata += "&"+this.keys[i]+'='+this.values[i];
  	}
  }
  QSXHTTP.send(pdata);
  this.BarrageStat();
};


}

function InitXDom()
{
  if(QSXDOM!=null) return;
  var obj = null;
  if (typeof(DOMParser) != "undefined") { // Gecko、Mozilla、Firefox
    var parser = new DOMParser();
    obj = parser.parseFromString(xmlText, "text/xml");
  }
  else
  {
    try { obj = new ActiveXObject("MSXML2.DOMDocument");} catch (e) { }
    if (obj == null) try { obj = new ActiveXObject("Microsoft.XMLDOM"); } catch (e) { }
  }
  QSXDOM = obj;
};

-->

