//onbeforeunload="return window_onbeforeunload();"

function window_onbeforeunload() {

		window.open("opens.shtml", "newwindow", "height=350, width=600, top=120, left=230, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no");

		//,"newwindow","height=400,width=600,top=100,left=220"

}



window.onload=function(){

	scroll();

	//alert(document.getElementById("subbtn"))

}

function subform(){

	verify();

	

}

function scroll(){

	var sol=document.documentElement.scrollTop || document.body.scrollTop;

	var odiv=document.getElementById("oDiv");

	

	if(window.XMLHttpRequest){

		return;

	}else{

		odiv.style.position="absolute";

		if(sol!=0){

			odiv.style.top=(sol+135)+"px";

		}

		window.onscroll=function(){

			var t=document.documentElement.scrollTop || document.body.scrollTop;

			if(t==0){

				odiv.style.top=135+"px";

			}else{

				odiv.style.top=(t+135)+"px";

			}

		}

	}

}

function verify(){
	if(document.getElementById("name").value=="" || !isNaN(document.getElementById("name"))){

		//alert("正しい名前を入力してください");
		alert("name error");
		return false;

	}

	if(document.getElementById("name1").value=="" || !isNaN(document.getElementById("name1").value)){

		//alert("正しい名前を入力してください");
		alert("name1 error");

		return false;

	}

	var mg=/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[-_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;

	if(document.getElementById("mail").value=="" || !mg.test(document.getElementById("mail").value)){

		//alert("正しいメールアドレスを入力してください");
		alert("mail error");

		return false;

	}

	document.myform.submit();

}
