<!--
function ReadCookie (CookieName)
{
	var CookieString = document.cookie;
	var CookieSet = CookieString.split (';');
	var SetSize = CookieSet.length;
	var CookiePieces
	var ReturnValue = "";
	var x = 0;
	
	for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++)
	{ 
		CookiePieces = CookieSet[x].split ('=');

		if (CookiePieces[0].substring (0,1) == ' ')
		{
			CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
		}
		
		if (CookiePieces[0] == CookieName)
		{
			ReturnValue = CookiePieces[1];
		}
	}
	
	return ReturnValue;
}


function WriteCookie (cookieName, cookieValue, expiry)
{
	var expDate = new Date();

	if(expiry)
	{
		expDate.setTime (expDate.getTime() + expiry);
		document.cookie = cookieName + "=" + escape (cookieValue) + "; expires=" + expDate.toGMTString();
	}
	else
	{
		document.cookie = cookieName + "=" + escape (cookieValue);
	}
}

<!--
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0) { date.setTime(date.getTime() - skew); }
}

// determine age
function howOld(day,month,year) {
    var c = new Date(); // a new instance
    fixDate(c);

    var thisDay = c.getDate();
    var thisMonth = c.getMonth() + 1;
    var thisYear = c.getFullYear();

    var yearsold = thisYear - year; 
    var monthsold = 0;
    var daysold = 0;
    var age = '';

    if (thisMonth >= month) {
    	monthsold = thisMonth - month;
    }
    else {
    	yearsold--;
    	monthsold = thisMonth + 12 - month;
    }

    if (thisDay >= day) {
     daysold = thisDay - day;
    }
    else {
        if (monthsold > 0) {
        	monthsold--;
        }
        else {
        	yearsold--;
        	monthsold += 11;
        }
        daysold = thisDay + 31 - day;
    }

    if (yearsold < 0) return '';

    if ((yearsold == 0) && (monthsold == 0) && (daysold == 0)) return '';

    if (yearsold > 0) {
        age = yearsold;
        if (yearsold > 1) age;
        age += ' ';
    }

    return age;
}


function doSubmit(f) {
 var dob,theMonth,theDay,test, test2;
 var regNum = /\D/;

 var regZipCode = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
 var pCode = /(^\d{3}-\d{4}$)/; 
 
 var commentval=f.comment.value;

if(f.name === "feedback2"){
	if(f.email.value.length <= 0){
		alert("メールアドレスをご記入ください。");
		f.email.focus();	
		return false;
	}
	if(f.email.value != f.emailconfirm.value){
		alert("メールアドレスが一致しません。");
		f.email.focus();
		return false;
	}
}
if (f.subject.value.length <=0 ){
	alert( "メッセージの件名をご記入ください。");
	f.subject.focus();
	return false;
}

if (f.email.value.length > 0 && (!f.email.value.match(/^\S+@\S+\.\S+$/))) {
   alert('メールアドレスに不備があります。半角英数字で再度ご記入ください。');
   f.email.focus();
   return false;
} 
   
if(commentval.length == "0"){
	alert('お問い合わせ内容をご記入ください。');
	 f.comment.focus();
	return false;
}   
if(f.comment.value.length > 1000){
	 alert("1000文字以内でお問い合わせください。");
	return false;
} 
if(f.subject.value.length > 30){
	 alert("30文字以内でお問い合わせください。");
	return false;
} 
if(!f.agree.checked){
	alert('同意していただけない場合は、送信できません。何卒ご了承ください。');
	return false;
} 

 
f.submit();
}

function isUnicode(f) {
isTrue=false;
someText = f.email.value;
textSize = f.email.value.length;
for (i = 0; i < textSize; i++) {
if (someText.charCodeAt(i)  > 256) {
isTrue=true;
break;
}
}
return isTrue
}



// -->

