function kakunin() {

  dstText = document.form1.email.value;
  if(dstText == "") {
    alert("メールアドレスを入力してください。");
    document.form1.email.focus();
    return(false);
  }
  EmailChar = "@._-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  for (i=0;i < dstText.length;i++) {
   c = dstText.charAt(i);
   if (EmailChar.indexOf(c,0) < 0) {
    alert("メールアドレスは半角文字で入力ください。");
    document.form1.email.focus();
    return(false);
   }
  }
  data = dstText.match(/^\S+@\S+\.\S+$/);
  if (!data || dstText.match(/\.\./)) {
    alert("Eメールアドレスを正しく入力してください。");
    document.form1.email.focus();
    return(false);
  }

    URL = "mail_form.php?email=" + document.form1.email.value;
	TS_OpenWindow2(URL, 300,200);

	return(true);
}

function mojicheck(txt){
	han = "ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮ､｡｢｣ﾞﾟ'ｰ";
	zen = "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョ、。「」゛°’ー";
	chstr = "";
	for (i=0;i<txt.length;i++) {
		c = txt.charAt(i);
		n = han.indexOf(c,0);
		if (n >= 0) c = zen.charAt(n);
		chstr += c;
	}
	return(chstr);
}

function sujicheck(txt){
	han = "０１２３４５６７８９―−ーｰ（）";
	zen = "0123456789----()";
	chstr = "";
	for (i=0;i<txt.length;i++) {
		c = txt.charAt(i);
		n = han.indexOf(c,0);
		if (n >= 0) c = zen.charAt(n);
		chstr += c;
	}
	return(chstr);
}

function TS_OpenWindow(theURL,pic_width,pic_height) {
  features = "resizable=yes,";
  if (pic_width > (screen.width - 60)) {
  	pic_width = screen.width - 60;
  	pic_height = parseInt(pic_height) + 16;
  	features = "scrollbars=yes,";
  }
  if (pic_height > (screen.height - 60)) {
  	pic_height = screen.height - 60;
  	pic_width = parseInt(pic_width) + 16;
  	features = "scrollbars=yes,";
  }
  x = (screen.width - pic_width) / 2;
  y = (screen.height - pic_height) / 2;
  features += "width=" + pic_width + ",height=" + pic_height + ",left=" + x + ",top=" + y;
  var pic_win=window.open("","",features);
  pic_win.document.write('<BODY bgcolor="#000000" text="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
  pic_win.document.write('<a href="javascript:window.close();">');
  pic_win.document.write("<img src=\"" + theURL + "\" border=0>");
  pic_win.document.write('</a></body>');
  return false;
}

function TS_OpenWindow2(theURL,pic_width,pic_height) {
  features = "resizable=yes,";
  if (pic_width > (screen.width - 160)) {
  	pic_width = screen.width - 160;
  	features = "scrollbars=yes,";
  }
  if (pic_height > (screen.height - 160)) {
  	pic_height = screen.height - 160;
  	features = "scrollbars=yes,";
  }
  x = (screen.width - pic_width) / 2;
  y = (screen.height - pic_height) / 2;
  features += "width=" + pic_width + ",height=" + pic_height + ",left=" + x + ",top=" + y;
  window.open(theURL,"form_window1",features);
}


