
    function wopen(target,option){
     var win = window.open("",target,option);
     win.focus();
    }

	// モーダルダイアログを起動する。
	function doModalDialog(strUrl, objWin, sizeFlg) {

		var strWidth;
		var strHeight;

		if(sizeFlg == "1") {
			strWidth  = "640";
			strHeight = "480";
		} else if(sizeFlg == "2") {
			strWidth  = "640";
			strHeight = "640";
		} else if(sizeFlg == "3") {
			strWidth  = "800";
			strHeight = "480";
		} else if(sizeFlg == "4") {
			strWidth  = "800";
			strHeight = "640";
		} else if(sizeFlg == "5") {
			strWidth  = "900";
			strHeight = "640";
		} else {
			strWidth  = "550";
			strHeight = "700";
		}

		var attr   = "dialogWidth:" + strWidth + "px;dialogHeight:" + strHeight + "px;status=no;toolbar=no;location=no;";
		var strRet = window.showModalDialog(strUrl,objWin,attr);

		if(strRet == "" || strRet == null) {
			return null;
		}

		return strRet;
	}

	// 配列情報の分解
	function getModalReturnKeyValue(strModalReturn, strKey){

	    intSt = new Number(strModalReturn.indexOf(strKey,0));

	    if( intSt < 0 ) { 
	    	return ''; 
	    }

	    intSt += strKey.length;
	    intEd = new Number(strModalReturn.indexOf(";",intSt));

	    if( intEd < 0 )  { 
	    	intEd = strModalReturn.length; 
	    }
	    
	    return(strModalReturn.substring(intSt+1,intEd));
	}


	function disp(url,w,h){ 

		window.open(url, "window_name", "width=" + w + ",height=" + h + ",scrollbars=yes,toolbar=no"); 

	}

	function Display(url,w,h){ 

		window.open(url, "window_name", "width=" + w + ",height=" + h + ",scrollbars=auto,toolbar=no,resizable=yes"); 

	}

	function TargetDisplay(url,target,w,h){ 

		window.open(url, target, "width=" + w + ",height=" + h + ",scrollbars=auto,toolbar=no,resizable=yes"); 

	}

	function popUp(url) {
 
		sealWin=window.open(url,"win",'toolbar=0,location=1,directories=0,status=1,menubar=1, scrollbars=1,resizable=1,width=530,height=450');
 
		self.name = "mainWin"; 

	}

	function ImageDisplay(url){

		newPic = new Image();
		newPic.src = url;

		var w = newPic.width + 40;
		var h = newPic.height + 43;

		sealWin=window.open(url,"win",'toolbar=0,directories=0,status=0,menubar=0, scrollbars=0,resizable=1,width=' + w + ',height=' + h );

		self.name = "mainWin"; 

	}

	function ChangeColor(obj , color){
		obj.style.backgroundColor = color;
	}

	function setClick(obj , color1 , color2) {
		if (obj.style.backgroundColor != color2){
			obj.style.backgroundColor  = color2;
		}else{
			obj.style.backgroundColor  = color1;
		}
	}

	function _setting(id , value){

		if (opener.document.getElementById(id)){
			obj = opener.document.getElementById(id);
			if (!obj.type){
				obj.innerHTML = value;
			}else{
				obj.value     = value;
			}
		}

	}

	function _write(id , value){

		if (document.getElementById(id)){
			obj = document.getElementById(id);
			if (!obj.type){
				obj.innerHTML = value;
			}else{
				obj.value     = value;
			}
		}

	}

	function _elementInput(type , name , value){

		var obj;

		try{
			obj         = document.createElement("input");
		    obj.type    = type;
		    obj.name    = name;
		    obj.value   = value;
		}catch(e){ alert(e) ;}

		return obj;

	}

	function _run(_Dat){

		var elemForm         = document.createElement("form");
		    elemForm.id      = _Dat['id'];
		    elemForm.name    = _Dat['id'];
		    elemForm.action  = _Dat['action'];
		    elemForm.method  = _Dat['method'];

		    try{
				if (_Dat['target'] != ""){
				    elemForm.target  = _Dat['target'];
				}
			}catch(e){ alert(e) ;}

			try{
				if (_Dat['key'].length){
					for (i = 0; i < _Dat['key'].length; i++) {
						if (_Dat['key'][i] != ""){
							elemForm.appendChild( 
							_elementInput("hidden" 
							            , _Dat['key'][i] 
							            , getModalReturnKeyValue(_Dat['param'], _Dat['key'][i] ) ) 
							);
						}
					}
				}else{
					if (_Dat['key'] != ""){
						elemForm.appendChild( 
						_elementInput("hidden" 
						            , _Dat['key'] 
						            , getModalReturnKeyValue(_Dat['param'], _Dat['key'] ) ) 
						);
					}
				}
			}catch(e){ alert(e) ;}

			document.getElementById(_Dat['space']).appendChild(elemForm);

			document.getElementById(_Dat['id']).submit();

	}

	function ChangeDisplay(id){

		if (document.getElementById(id)){
			obj          = document.getElementById(id);
			if (obj.style.display != ""){
				obj.style.display = "";
			}else{
				obj.style.display = "none";
			}
		}

	}

	function ChangeDisable(id , flg){
		if (document.getElementById(id)){
			obj          = document.getElementById(id);
			obj.disabled = flg;
		}
	}

	function getId(id){
		try{
			return document.getElementById(id);
		}catch(e){ ; }
		return null;
	}

	function WordCount(value,id){

		var count = getId(id);

		if (count == null){
			return;
		}

		try{
			count.innerHTML = value.length;
		}catch(e){
			count.value    = value.length;
		}

	}

	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}

	function MM_openBrWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

