function serviceSelect( target )
{
	if( target.match(/service0/g) )
	{
		for( var i = 1; i < 8; i++ )
		{
			document.getElementById( "service" + i ).checked = false;
		}
	}
	else
	{
		document.getElementById( "service0" ).checked = false;
	}
}


//フリーワード検索用チェック
function submitCheckFreeWord()
{
	if( document.getElementById( "free_word" ).value <= 0 )
	{
		alert( "検索文字を入力してください。" );
		document.getElementById( "free_word" ).focus();
		return false;
	}
	
	return true;
}


//郵便番号検索用チェック
function submitCheckZipCode()
{
	if( !document.getElementById( "zip1" ).value.match(/^[0-9]{3}$/g) )
	{
		alert( "半角数字で郵便番号を 3 桁入力してください。" );
		document.getElementById( "zip1" ).focus();
		return false;
	}
	
	if( !document.getElementById( "zip2" ).value.match(/^[0-9]{4}$/g) )
	{
		alert( "半角数字で郵便番号を 4 桁入力してください。" );
		document.getElementById( "zip2" ).focus();
		return false;
	}
	
	return true;
}



function searchSubmit()
{
	var parameter = "";
	
	for( var i = 0; i < 8; i++ )
	{
		if( document.getElementById("service"+i).checked )
		{
			parameter += "service"+i+"=on&";
		}
		else
		{
			parameter += "service"+i+"=off&";
		}
	}
	
	parameter += "zip1="+document.getElementById("zip1").value+"&zip2="+document.getElementById("zip2").value;
	
	location.href="search_zip_code.php?"+parameter;
	
	return false;
}


function searchSubmit2()
{
	var parameter = "";
	for( var i = 0; i < 8; i++ )
	{
		if( document.getElementById("service"+i).checked )
		{
			parameter += "service"+i+"=on&";
		}
		else
		{
			parameter += "service"+i+"=off&";
		}
	}
	location.href="search3.php?"+parameter;
	return false;
}



function getAccessLog( value )
{
	new Ajax.Request( '/phpscript/src/getAccessLog.php?memNumber=' + value, 
	{
		method: 'get'
	} );
}



function shopInquiryCheck()
{
	if( document.getElementById( "inqFormFirstName" ).value <= 0 )
	{
		alert( "お名前（姓）をご入力ください。" );
		document.getElementById( "inqFormFirstName" ).focus();
		return false;
	}
	
	if( document.getElementById( "inqFormLastName" ).value <= 0 )
	{
		alert( "お名前（名）をご入力ください。" );
		document.getElementById( "inqFormLastName" ).focus();
		return false;
	}
	
	
	if( !document.getElementById( "inqFormZip1" ).value.match( /^[0-9]{3}$/g ) )
	{
		alert( "郵便番号 上3桁 をご入力ください。" );
		document.getElementById( "inqFormZip1" ).focus();
		return false;
	}
	
	if( !document.getElementById( "inqFormZip2" ).value.match( /^[0-9]{4}$/g ) )
	{
		alert( "郵便番号 下4桁 をご入力ください。" );
		document.getElementById( "inqFormZip2" ).focus();
		return false;
	}
	
	if( !document.getElementById( "inqFormAdress1" ).value.match( /^[1-9]$|^[1-3][0-9]$|^[4][0-7]$/g ) )
	{
		alert( "都道府県を選択してください。" );
		document.getElementById( "inqFormAdress1" ).focus();
		return false;
	}
	
	if( document.getElementById( "inqFormAdress2" ).value <= 0 )
	{
		alert( "マンション名、号室などご入力ください。" );
		document.getElementById( "inqFormAdress2" ).focus();
		return false;
	}
	
	
	if( document.getElementById( "inqFormPhone" ).value <= 0 )
	{
		alert( "電話番号をご入力ください。" );
		document.getElementById( "inqFormPhone" ).focus();
		return false;
	}
	
	if( !document.getElementById( "inqFormMail" ).value.match(/^[0-9,A-Z,a-z][0-9,a-z,A-Z,_,\.,-]+@[0-9,A-Z,a-z][0-9,a-z,A-Z,_,\.,-]+\.(af|al|dz|as|ad|ao|ai|aq|ag|ar|am|aw|ac|au|at|az|bh|bd|bb|by|bj|bm|bt|bo|ba|bw|br|io|bn|bg|bf|bi|kh|cm|ca|cv|cf|td|gg|je|cl|cn|cx|cc|co|km|cg|cd|ck|cr|ci|hr|cu|cy|cz|dk|dj|dm|do|tp|ec|eg|sv|gq|er|ee|et|fk|fo|fj|fi|fr|gf|pf|tf|fx|ga|gm|ge|de|gh|gi|gd|gp|gu|gt|gn|gw|gy|ht|hm|hn|hk|hu|is|in|id|ir|iq|ie|im|il|it|jm|jo|kz|ke|ki|kp|kr|kw|kg|la|lv|lb|ls|lr|ly|li|lt|lu|mo|mk|mg|mw|my|mv|ml|mt|mh|mq|mr|mu|yt|mx|fm|md|mc|mn|ms|ma|mz|mm|na|nr|np|nl|an|nc|nz|ni|ne|ng|nu|nf|mp|no|om|pk|pw|pa|pg|py|pe|ph|pn|pl|pt|pr|qa|re|ro|ru|rw|kn|lc|vc|ws|sm|st|sa|sn|sc|sl|sg|sk|si|sb|so|za|gs|es|lk|sh|pm|sd|sr|sj|sz|se|ch|sy|tw|tj|tz|th|bs|ky|tg|tk|to|tt|tn|tr|tm|tc|tv|ug|ua|ae|uk|us|um|uy|uz|vu|va|ve|vn|vg|vi|wf|eh|ye|yu|zm|zw|com|net|org|gov|edu|int|mil|biz|info|name|pro|jp)$/i) )
	{
		alert( "E-mail アドレスご入力ください。" );
		document.getElementById( "inqFormMail" ).focus();
		return false;
	}
	
	if( document.getElementById( "inqFormContents" ).value <= 0 )
	{
		alert( "お問い合わせ・ご相談内容などをご入力ください。" );
		document.getElementById( "inqFormContents" ).focus();
		return false;
	}
}
