function createXMLHttp() {
		try {
			return new XMLHttpRequest();
		}catch(e) {
			try {
				try {
				return new ActiveXObject("Msxml2.XMLHTTP");
				}catch(e) {
				return new ActiveXObject("Microsoft.XMLHTTP");
				}
			}catch(e) {
				return null;
			}
		}
		return null;
	}
	function decodeJp(textData) {
		return decodeURI(textData);
	}
	function encodeJp(textData) {
		return encodeURI(textData);
	}

function readcnt (name,url,data) {

	var xmlhttp=createXMLHttp();

  if(xmlhttp){
    if (xmlhttp.overrideMimeType) {
        xmlhttp.overrideMimeType('text/xml');
    }
	xmlhttp.abort();
	xmlhttp.open('GET',url + data ,true);
	xmlhttp.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
	xmlhttp.send(null);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			if (document.getElementById(name) != null) {
				document.getElementById(name).innerHTML = decodeJp(encodeJp(xmlhttp.responseText));
				document.getElementById(name).style.display = 'inline';
			}
		} 
	}
  }
	return false;
}

// 2008/06/17 再読み込み用 by kazuki ohshiro
function readcntreload (name,url,data) {

	var xmlhttp=createXMLHttp();

  if(xmlhttp){
    if (xmlhttp.overrideMimeType) {
        xmlhttp.overrideMimeType('text/xml');
    }
	xmlhttp.abort();
	xmlhttp.open('GET',url + data ,true);
//	xmlhttp.setRequestHeader("If-Modified-Since", "Thu, 01 Jun 1970 00:00:00 GMT");
	xmlhttp.send(null);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			if (document.getElementById(name) != null) {
				document.getElementById(name).value = decodeJp(encodeJp(xmlhttp.responseText));
			}
		} 
	}
  }
	return false;
}

function readcntpost (name,url,data) {

	var xmlhttp=createXMLHttp();

  if(xmlhttp){
    if (xmlhttp.overrideMimeType) {
        xmlhttp.overrideMimeType('text/xml');
    }
	xmlhttp.abort();
	xmlhttp.open('POST',url ,true);
	
	xmlhttp.setRequestHeader('Content-Type' ,
	'application/x-www-form-urlencoded; charset=UTF-8')
	xmlhttp.send(data);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			if (document.getElementById(name) != null) {
				document.getElementById(name).innerHTML = decodeJp(encodeJp(xmlhttp.responseText));
				document.getElementById(name).style.display = 'inline';
			}
		} 
}
	}
	return false;
}
function readcntpostnext (name,url,data,nexturl) {

	var xmlhttp=createXMLHttp();

  if(xmlhttp){
    if (xmlhttp.overrideMimeType) {
        xmlhttp.overrideMimeType('text/xml');
    }
	xmlhttp.abort();
	xmlhttp.open('POST',url ,true);
	xmlhttp.setRequestHeader('Content-Type' ,
	'application/x-www-form-urlencoded; charset=UTF-8')
	xmlhttp.send(data);
	xmlhttp.onreadystatechange = function () {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			if (document.getElementById(name) != null) {
				document.getElementById(name).innerHTML = decodeJp(encodeJp(xmlhttp.responseText));
				document.getElementById(name).style.display = 'inline';
			}
			readcnt(name,nexturl,"");
		} 
}
	}
	return false;
}

function dspchange (name ) {
	if (document.getElementById(name) != null) {
		dsp = (document.getElementById(name).style.display == 'none');
		document.getElementById(name).style.display = (dsp ?'inline':'none');
	}
}

function btnchange (img,name, imgname1 , imgname2 ) {
	if (document.getElementById(name) != null) {
		dsp = (document.getElementById(name).style.display == 'none');
		document.getElementById(name).style.display = (dsp ?'inline':'none');
		if (dsp) {
			img.src=imgname1;
		}else {
			img.src=imgname2;
		}
	}
}
function imgchange (img, imgname1 ) {
	img.src=imgname1;
}

function listSet (name,value ) {
	if (document.getElementById(name) != null) {
		document.getElementById(name).value = value;
	}
}

function listOpSet (name,value ) {
	if(opener!=null){
		if (opener.document.getElementById(name) != null) {
			opener.document.getElementById(name).value = value;
		}
		window.close();
	}
}
function listObjSet (name,value ,objct) {
	if(objct!=null){
		if (objct.document.getElementById(name) != null) {
			objct.document.getElementById(name).value = value;
		}
		window.close();
	}else {
		if (document.getElementById(name) != null) {
			document.getElementById(name).value = value;
		}
	}
}

function scrollY (name , value) {
	var ypoint = document.getElementById(name).style.top.replace('px','').replace('em','');
	document.getElementById(name).style.top = eval(ypoint) + value +"em";
}

function scrollX (name , value) {
	var xpoint = document.getElementById(name).style.top.replace('px','').replace('em','');
	document.getElementById(name).style.left = xpoint + value+"em";
}

function winopen (url,objct) {
	window.open(url,objct,'width=350,height=200,scrollbars=yes,dependent=yes,status=no,toolbar=no,location=no,resizable=no,menubar=no');
}
function winopensize (url,objct,sizex,sizey) {
	window.open(url,objct,'width=' + sizex + ',height=' + sizey + ',scrollbars=yes,dependent=yes,status=no,toolbar=no,location=no,resizable=no,menubar=no');
}

function initSchBox(sID,fID) {

    var defaultText = "";
    
    if (document.getElementById(sID).value == "" || document.getElementById(sID).value == defaultText) {
        document.getElementById(sID).value = defaultText;
        document.getElementById(sID).style.color ="#DDDDDD";
    }
    
    document.getElementById(sID).onfocus = function(){
        document.getElementById(sID).style.color ="#333333";
        if (this.value == defaultText ) { this.value=""; }
    };
    document.getElementById(sID).onblur = function(){
        if (this.value == "" || document.getElementById(sID).value == defaultText) {
	 this.value = defaultText; 
         document.getElementById(sID).style.color ="#DDDDDD";
	}
    };
    document.getElementById(fID).onsubmit = function(){
        if (document.getElementById(sID).value == defaultText) { document.getElementById(sID).value=""; }
    };
}
function checkData(sKey,sWork) {
	if (sKey == "") {
		window.alert("");
    		return false;
	}
	if (sWork == "") {
		window.alert("");
	    	return false;
	}
    return true;
}
	function cngsicklist(type) {
	if (type == 'a') {
		dspchangeflg ('sicka' ,true);
	}else {
		dspchangeflg ('sicka' ,false);
	}
	if (type == 'k') {
		dspchangeflg ('sickk' ,true);
	}else {
		dspchangeflg ('sickk' ,false);
	}
	if (type == 's') {
		dspchangeflg ('sicks' ,true);
	}else {
		dspchangeflg ('sicks' ,false);
	}
	if (type == 't') {
		dspchangeflg ('sickt' ,true);
	}else {
		dspchangeflg ('sickt' ,false);
	}
	if (type == 'n') {
		dspchangeflg ('sickn' ,true);
	}else {
		dspchangeflg ('sickn' ,false);
	}
	if (type == 'h') {
		dspchangeflg ('sickh' ,true);
	}else {
		dspchangeflg ('sickh' ,false);
	}
	if (type == 'm') {
		dspchangeflg ('sickm' ,true);
	}else {
		dspchangeflg ('sickm' ,false);
	}
	if (type == 'y') {
		dspchangeflg ('sicky' ,true);
	}else {
		dspchangeflg ('sicky' ,false);
	}
	if (type == 'r') {
		dspchangeflg ('sickr' ,true);
	}else {
		dspchangeflg ('sickr' ,false);
	}
	if (type == 'w') {
		dspchangeflg ('sickw' ,true);
	}else {
		dspchangeflg ('sickw' ,false);
	}

	return false;
	}
	function dspsicklist() {
		dspchangeflg ('sicka' ,true);
		dspchangeflg ('sickk' ,true);
		dspchangeflg ('sicks' ,true);
		dspchangeflg ('sickt' ,true);
		dspchangeflg ('sickn' ,true);
		dspchangeflg ('sickh' ,true);
		dspchangeflg ('sickm' ,true);
		dspchangeflg ('sicky' ,true);
		dspchangeflg ('sickr' ,true);
		dspchangeflg ('sickw' ,true);

	return false;
	}
	function dspchangeflg (name ,flg) {
	if (document.getElementById(name) != null) {
		document.getElementById(name).style.display = (flg ?'inline':'none');
	}
}

