function OpenWindow(fileurl,filetarget){
	var width			= 500;
	var height			= 270;
	var left			= (screen.availWidth - width) / 2;
	var top				= (screen.availHeight - height) / 2;
	var toolbar			= 0;
	var locationbar		= 0;
	var directories		= 0;
	var status			= 0;
	var menubar			= 0;
	var scrollbars		= 1;
	var resizable		= 1;

	win = window.open(fileurl,
		filetarget,
		"left="+left+","+
		"top="+top+","+
		"screenX="+left+","+
		"screenY="+top+","+
		"toolbar="+toolbar+","+
		"location="+locationbar+","+
		"directories="+directories+","+
		"status="+status+","+
		"menubar="+menubar+","+
		"scrollbars="+scrollbars+","+
		"resizable="+resizable+","+
		"width="+width+","+
		"height="+height);

	win.focus();
}
function OpenWindowWH(fileurl,filetarget,wid,hei){
	var width			= wid;
	var height			= hei;
	var left			= (screen.availWidth - width) / 2;
	var top				= (screen.availHeight - height) / 2;
	var toolbar			= 0;
	var locationbar		= 0;
	var directories		= 0;
	var status			= 0;
	var menubar			= 0;
	var scrollbars		= 1;
	var resizable		= 1;

	win = window.open(fileurl,
		filetarget,
		"left="+left+","+
		"top="+top+","+
		"screenX="+left+","+
		"screenY="+top+","+
		"toolbar="+toolbar+","+
		"location="+locationbar+","+
		"directories="+directories+","+
		"status="+status+","+
		"menubar="+menubar+","+
		"scrollbars="+scrollbars+","+
		"resizable="+resizable+","+
		"width="+width+","+
		"height="+height);

	win.focus();
}
function coupon(Turl){
	//var url = "/shokunavi/sample/coupon?shop_id="+obj;
	var target = "window1";
	OpenWindow(Turl,target);
}
function getDaysInMonth(iYear, iMonth) {
	var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

	if ( ((iYear % 4 == 0) && (iYear % 100 != 0)) || (iYear % 400 == 0) ) {
	daysInMonth[1] = 29;
	}
	return daysInMonth[iMonth - 1];
}

function Day(tform){
	var day = getDaysInMonth(tform.year.value, tform.month.value );
	tform.day.options.length = 0;
	for( i=1; i<=day; i++ ){
	woption = new Option( i, i );
	tform.day.options[i-1] = woption;
	}
}
function AccFilter(fileurl){
	var width			= 600;
	var height			= 500;
	var left			= (screen.availWidth - width) / 2;
	var top				= (screen.availHeight - height) / 2;
	var toolbar			= 0;
	var locationbar		= 0;
	var directories		= 0;
	var status			= 0;
	var menubar			= 0;
	var scrollbars		= 1;
	var resizable		= 1;
	var target = "window1";

	win = window.open(fileurl,
		target,
		"left="+left+","+
		"top="+top+","+
		"screenX="+left+","+
		"screenY="+top+","+
		"toolbar="+toolbar+","+
		"location="+locationbar+","+
		"directories="+directories+","+
		"status="+status+","+
		"menubar="+menubar+","+
		"scrollbars="+scrollbars+","+
		"resizable="+resizable+","+
		"width="+width+","+
		"height="+height);

	win.focus();
}
function LengthCheck(form){
	if(document.getElementById("OtherCom").value.length > 300){
		alert("備考の文字数が200文字以上です。入力しなおしてください。");
		return false;
	}
	if(document.getElementById("shop_com1").value.length > 500){
		alert("お店の紹介のコメント文字数が400文字以上です。入力しなおしてください。");
		return false;
	}
	if(document.getElementById("shop_com2").value.length > 500){
		alert("お店のおすすめのコメント文字数が400文字以上です。入力しなおしてください。");
		return false;
	}
	return true;
}
function url(url,id){
	var account;
	account = url + '?max=' + document.getElementById('max').checked + '&pc=' + document.getElementById('pc').checked + '&mb=' + document.getElementById('mb').checked + '&fyear=' + document.getElementById('fyear').value + '&fmonth=' + document.getElementById('fmonth').value + '&id=' + id ;
	new Ajax.Updater('myzone',account, {asynchronous:true, evalScripts:false});;
}