function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
function w_open_alt(myobj){
	winName=myobj.name;
	var win1 = window.open("","winName","scrollbars=no");
	win1.document.write('<html><body>');
	win1.document.write('<img src="'+ myobj.src + ' ">');
	win1.document.write('</body></html>');
	var ww = win1.document.images[0].width;
	var hh = win1.document.images[0].height;
	win1.resizeTo(ww+10,hh+35);
	exit;
}
function w_open(myobj){
	img1 = new Image();
	img1.src = myobj.src;
	var ww = img1.width;
	var hh = img1.height;
	winName=myobj.name;
	features="width = "+ ww + ",height = " + hh + ",scrollbars=no";
	//alert(features);
	window.open(img1.src,winName,features);
}

function check(){
    if(document.myform.onamae.value==""){
        alert("お名前を入力してください。");
        return false;
    }
    if(document.myform.email.value==""){
        alert("Ｅメールアドレスを入力してください。");
        return false;
    }else if(!is_mail(document.myform.email.value)){
        alert("Ｅメールアドレスが正しくありません。");
        return false;
    }
    if(document.myform.denwa.value){
    	if(!is_tel(document.myform.denwa.value)){
        	alert("電話番号が正しくありません。");
        	return false;
    	}
    }
    if(document.myform.message.value==""){
        alert("メッセージを入力してください。");
        return false;
    }
    return check2();
    //return true;
}

function check2(){
	naiyo = "以下の内容で送信します。\n\nお名前：";
	naiyo += document.myform.onamae.value+"\nＥメール：";
	naiyo += document.myform.email.value+"\nメッセージ：";
	naiyo += document.myform.message.value;
	if(document.myform.denwa.value){
		naiyo += "\n電話番号：";
		naiyo += document.myform.denwa.value;
	}
	naiyo += "\n\nよろしいですか？";
	if(confirm(naiyo)){
		return true;
	}else{
		return false;
	}
}
function is_mail(mymail){
    if(mymail.match(/^[-_0-9a-z]+@[-_0-9a-z.]+\.[-_0-9a-z.]+$/)){
    //if (true){
        return true;
    }else{
        return false;
    }
}
function is_tel(mytel){
    if(mytel.match(/^[-+()0-9]+$/)){
    //if (true){
        return true;
    }else{
        return false;
    }
}

