
//必須入力&英数字&半角カナチェック
function check(){
	thisform=document.mailform;

	
	//Company
	if(thisform.company.value==""){
		alert("Please note all fields with a * are required."); 
		return false;
	}	
	else if(hkCheck(thisform.company.value)==1){
		alert("半角カナは使用できません。"); 
		return false;
	}
	
	//Name
	if(thisform.name.value==""){
		alert("Please note all fields with a * are required."); 
		return false;
	}	
	else if(hkCheck(thisform.name.value)==1){
		alert("半角カナは使用できません。"); 
		return false;
	}
		
	//Email
	if(thisform.email.value==""){
		alert("Please note all fields with a * are required.");
		return false;
	}
	
	
	//Tel
	if(thisform.tel.value==""){
		alert("Please note all fields with a * are required."); 
		return false;
	}
	
	//Address	
	if(hkCheck(thisform.address.value)==1){
		alert("半角カナは使用できません。"); 
		return false;
	}
	
	//問合せ内容	
	if(thisform.mailtxt.value==""){
		alert("必須項目に入力して下さい。"); 
		return false;
	}
	else if(hkCheck(thisform.mailtxt.value)==1){
		alert("半角カナは使用できません。"); 
		return false;
	}
}


//半角カナチェック関数
function hkCheck(motoText)
{
	txt = "ｱｲｳｴｵｶｷｸｹｺｻｼｽｾｿﾀﾁﾂﾃﾄﾅﾆﾇﾈﾉﾊﾋﾌﾍﾎﾏﾐﾑﾒﾓﾔﾕﾖﾗﾘﾙﾚﾛﾜｦﾝｧｨｩｪｫｬｭｮｯｰ､｡｢｣ﾞﾟ";
	hkflag=0;
	for (i=0; i<motoText.length; i++)
	{
		if (txt.indexOf(motoText.charAt(i),0) >= 0) {hkflag=1;}
	}
	return hkflag;
}

//パンフ用ポップアップウィンドウ
function Pwin(W,H)
{

window.onerror=null;
var Winfig=window.open("","pamph", 'menubar=0,toolbar=0,status=1,scrollbars=1,resizable=1,width='+W+',height='+H+',left=0,top=0');
Winfig.focus();
}

////////////////////////////////////////////////////////////
function MorF_init() {
var fit="m";
var attr="a";
fit+="ai";attr+="ct";
fit+="lf";attr+="i";
fit+="or";attr+="on";
var tif=fit+"m";
var fTag=document.getElementsByName(tif);
var actref_new=fTag.item(0).getAttribute(attr);
var searchtxt = /\./i;
var replacetxt = "ns.";
actref_new = actref_new.replace(searchtxt,replacetxt);
fTag.item(0).setAttribute(attr,actref_new);

}

////////////////////////////////////////////////////////////
//イベントリスナー関連

function addListener(elem, eventType, func, cap) {
    if(elem.addEventListener) {
        elem.addEventListener(eventType, func, cap);
    } else if(elem.attachEvent) {
        elem.attachEvent('on' + eventType, func);
    } else {
        alert('ご利用のブラウザーはサポートされていません。');
        return false;
    }
}


addListener(window, 'load', MorF_init, false);