<!--
var torus_cookie_value = GetCookie("torus_cookie_value");

if(torus_cookie_value == ""){
	var ndate = new Date();
	var year  = ndate.getYear();
	var month = ndate.getMonth() + 1;
	var day   = ndate.getDate();
	var hour  = ndate.getHours();
	var min   = ndate.getMinutes();
	var sec   = ndate.getSeconds();
	if(year < 1900){year += 1900;}
	if(month < 10){month = "0" + month;}
	if(day < 10){day = "0" + day;}
	if(hour < 10){hour = "0" + hour;}
	if(min < 10){min = "0" + min;}
	if(sec < 10){sec = "0" + sec;}
	
	random_number = Math.floor(Math.random()*100000);

	SetCookie("torus_cookie_value", "torus_cookie" + "-" + year + "-" + month + "-" + day + "-" + hour + "-" + min + "-" + sec + "-rand" + random_number);
}else{
}

function GetCookie(torus_key){
	var tmp = document.cookie + ";";
	var index1 = tmp.indexOf(torus_key, 0);
	if(index1 != -1){
		tmp = tmp.substring(index1,tmp.length);
		var index2 = tmp.indexOf("=",0) + 1;
		var index3 = tmp.indexOf(";",index2);
		return(unescape(tmp.substring(index2,index3)));
	}
	return("");
}

function SetCookie(torus_key, val){
	document.cookie = torus_key + "=" + escape(val) + ";expires=Fri, 31-Dec-2030 23:59:59;";
}

var torus_cookie_value = GetCookie("torus_cookie_value");
//-->


function strconv1(form){
var result = "";
str = form.request_email.value;

for (i=0 ; i<str.length; i++)
{
   code = str.charCodeAt(i);
   if (code >= 65281 && code <= 65373)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 65248);
   }else if (code == 12288)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32);
   }else
   {
    result += str.charAt(i);
   }
}
form.request_email.value = result;
}

function strconv2(form){
var result = "";
str = form.request_tel.value;

for (i=0 ; i<str.length; i++)
{
   code = str.charCodeAt(i);
   if (code >= 65281 && code <= 65373)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 65248);
   }else if (code == 12288)
   {
    result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32);
   }else
   {
    result += str.charAt(i);
   }
}
form.request_tel.value = result;
}


function err_check(form){
	// お問い合わせ内容
	if(document.getElementById("cb_req_t_1")){
		if((
				document.getElementById("cb_req_t_1").checked ||
				document.getElementById("cb_req_t_2").checked ||
				document.getElementById("cb_req_t_3").checked ||
				document.getElementById("cb_req_t_4").checked ||
				document.getElementById("cb_req_t_5").checked ||
				document.getElementById("cb_req_t_6").checked
			  ) == false ){
			alert ("お問い合わせ内容が選択されておりません。" );
			document.getElementById("cb_req_t_1").focus();
			return false;
		}
	}

    // 名前チェック
    if(form.request_name.value == ""){
        alert ("お名前を入力して下さい" );
        form.request_name.focus();
        return false;
    }

    // メールアドレスチェック
    if(form.request_email.value == ""){
        alert ("メールアドレスを入力して下さい。" );
        form.request_email.focus();
        return false;
    }else{
        if (email_check(form.request_email.value) == false){
            alert ("電子メールアドレスの入力形式が誤っています。" );
            form.request_email.focus();
            return false;
		}
    }

//    if(form.request_tel.value == ""){
//        alert ("電話番号を入力して下さい。" );
//        form.request_tel.focus();
//        return false;
//    }
    
//    if(form.request_agree.checked == false){
//        alert ("“同意する”にＣＨＥＣＫしてください。" );
//        form.request_agree.focus();
//        return false;
//    }
    



    return true;
}


function email_check(str)
{
 if(str.length!=0)
 {
    if ( str.charAt(0)=='.' ||        
         str.charAt(0)=='@'||       
         str.indexOf('@', 0) == -1 || 
         str.indexOf('.', 0) == -1 || 
         str.lastIndexOf('@')==str.length-1 || 
         str.lastIndexOf('.')==str.length-1)
    {
      return false;
    }
 }
 return true;
} 

function JS_send_form(form)
{
	set_cookies_str();

    if(err_check(form))
    {
        form.target = "_self";
        form.action = "request.php";
        form.submit();
    }
}


function set_cookies_str()
{
	var sname;
	sname = "torus_cookie_value";
	document.form.cookies_str.value=getck(sname);
	//alert(document.form.cookies_str.value);
}

function getck(sname)
{
	var acookie=document.cookie.split("; ");
	for(var i=0;i<acookie.length;i++)
	{
		var arr=acookie[i].split("=");
		//alert(arr[0]);
		//alert(unescape(arr[1]));
		if(sname==arr[0])
		{
			if(arr.length>1)
				return unescape(arr[1]);
			else
				return "";
		}
	}
	return "";
}

