function NewWindow(mypage,w,h,scroll,location,windowname){
var win= null;
  if (scroll==0) {
    var scrollPrn = "no"
  }
  else {
    var scrollPrn = "yes"
  }

  if (location==0) {
    var winl = 0
    var wint = 0
  }
  else {
    var winl = (screen.width-w)/2;
    var wint = (screen.height-h)/2;
  }

  if (windowname==""||windowname==null) {
  	var popwindowname = "WIN_SUB_Second"
  }
  else {
  	var popwindowname = windowname
  }

  var settings  ='height='+h+',';
      settings +='width='+w+',';

      settings +='top='+wint+',';
      settings +='left='+winl+',menubar=0, toolbar=0,location=0,directory=0,scrollbars=' + scrollPrn + ',resizable=0';
  win=window.open(mypage,popwindowname,settings);

  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


function FlashEolas(FlashWidth,FlashHeight,FlashURL,FlashVer)
{
	var ObjNo = "";
	if(document.getElementById("FlashEolasSwfBasic1")==null) {
		ObjNo = 1;
	}
	else {
		for(var i=1;i<15;i++) {
			if(document.getElementById("FlashEolasSwfBasic"+i)==null) {
				ObjNo = i;
				break;
			}
		}
	}
	
	if(FlashVer==null||FlashVer=="") { FlashVer = "7"; }
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + FlashVer + ",0,0,0' width='" + FlashWidth + "' height='" + FlashHeight + "' id='FlashEolasSwfBasic"+ObjNo+"'><param name='movie' value='" + FlashURL + "'><param name='quality' value='high'><param name='wmode' value='transparent'><param name='allowScriptAccess' value='always'><embed src='" + FlashURL + "' quality='high' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + FlashWidth + "' height='" + FlashHeight + "' allowScriptAccess='always' name='FlashEolasSwfBasic"+ObjNo+"'></embed></object>")
}

function mouseOver(obj, bool)
{
	if(bool)
		obj.src= obj.id + "_On.gif";
	else
		obj.src= obj.id + "_Off.gif";
}

function ChangeSelectURL(form) {
        if(form.value != "") {
	        //window.open(form.options[form.selectedIndex].value);
	        location.href=form.value;
        	form.selectedIndex = 0;
	}
}

function SpaceRemove(strText)
{
  var r, re;
  re = /\s/g;
  r = strText.replace(re, "");
  r = r.replace(/　/g, "");
  return(r);
}

function EngNumCheck(str){
    if((/[^(A-Z)^(a-z)^(0-9)]/).test(str)){
        return false;
    }else{
        return true;
    }
}

function NumCheck(str){
    if((/[^(0-9)]/).test(str)){
        return false;
    }else{
        return true;
    }
}

function BrowserCheck() {
	var BrowserName = "";
	if(new RegExp(/Firefox/).test(navigator.userAgent)){ 
		BrowserName = "FF";
	}
	else if(new RegExp(/Netscape/).test(navigator.userAgent)){ 
		BrowserName = "NS";
	}
	else if(new RegExp(/MSIE/).test(navigator.userAgent)){ 
		BrowserName = "IE";
	} 
	return BrowserName;
}

function SendMailTo(mailaddr)
{
	var getMailAddr = mailaddr
	var HrefAttrib = "mail"
	var HrefTo = "to"

	if(BrowserCheck()=="IE") {
		if (confirm('ウェブメール(Hotmailなど)を使いますか？\n\n ※ Outlook 使用の時 [キャンセル] クリック')) {
			alert("メールアドレス(" + getMailAddr.replace(/\[AT]/g,"@") + ")がコピーされました。\n\n送信先メールアドレスに貼り付け(Ctrl+V)してください。");
			window.clipboardData.setData('Text', getMailAddr.replace(/\[AT]/g,"@"));
		}
		else {
			location.href=HrefAttrib + HrefTo + ":" + getMailAddr.replace(/\[AT]/g,"@")
			alert("メールクライアントプログラムを実行中です。\n\nしばらくの間お待ちください。")
		}
	}
	else {
		location.href=HrefAttrib + HrefTo + ":" + getMailAddr.replace(/\[AT]/g,"@")
	}

}

function PressNumeric(){
	if (((event.keyCode>=48)&&(event.keyCode<=57))||(event.keyCode==46)) {
		event.returnValue=true;
	}
	else{
		event.returnValue=false;
	}

}  

// Dynamic Tab
function TabImage(strTitle,strOnOff,strHref) {

	if(strOnOff=="ON") {
		var ImageName = "On";
		var BGColor = "#FFFFFF";
		var Line1Color = "#CF8B79";
		var Line2Color = Line3Color = "#FFFFFF";
		var Bottom1Color = Bottom2Color = "#FFFFFF";
		var TextColor = "#FF4F02";
		var TextMargin = "0";
	}
	else {
		var ImageName = "Off";
		var BGColor = "#F6DFD2";
		var Line1Color = "#DFC4B3";
		var Line2Color = "#F3E1D5";
		var Line3Color = "#FDFEFF";
		var Bottom1Color = "#F7AA52";
		var Bottom2Color = "#F7E3CE";
		var TextColor = "#734A38";
		var TextMargin = "5";
	}


      var strTabTable = "";
      strTabTable += "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\""+BGColor+"\">";
      strTabTable += "  <tr>";
      strTabTable += "    <td width=\"4\" rowspan=\"4\"><img src=\"/images/Tab_Left_"+ImageName+".gif\" width=\"4\" height=\"36\"></td>";
      strTabTable += "    <td height=\"1\" bgcolor=\""+Line1Color+"\"></td>";
      strTabTable += "    <td width=\"4\" rowspan=\"4\" align=\"right\"><img src=\"/images/Tab_Right_"+ImageName+".gif\" width=\"4\" height=\"36\"></td>";
      strTabTable += "  </tr>";
      strTabTable += "  <tr>";
      strTabTable += "    <td height=\"1\" bgcolor=\""+Line2Color+"\"></td>";
      strTabTable += "  </tr>";
      strTabTable += "  <tr>";
      strTabTable += "    <td height=\"1\" bgcolor=\""+Line3Color+"\"></td>";
      strTabTable += "  </tr>";
      strTabTable += "  <tr height=\"33\" OnClick=\"" + strHref + "\" style=\""+((strHref!="") ? "cursor:pointer" : "")+"\">";
      strTabTable += "    <td align=\"center\"><p style=\"COLOR:"+TextColor+";margin-top:"+TextMargin+"px;font-weight:bold\">" + strTitle +"</td>";
      strTabTable += "  </tr>";
      strTabTable += "  <tr>";
      strTabTable += "    <td colspan=\"3\" height=\"1\" bgcolor=\""+Bottom1Color+"\"></td>";
      strTabTable += "  </tr>";
      strTabTable += "  <tr>";
      strTabTable += "    <td colspan=\"3\" height=\"2\" bgcolor=\""+Bottom2Color+"\"></td>";
      strTabTable += "  </tr>";
      strTabTable += "</table>";



      document.write (strTabTable);
}
