function PopUp_win(wi,he,file,target){
	window.open(file ,target,"scrollbars=1,width=" + wi + ",height=" + he + ",left=100,top=100,status=yes");
	if(navigator.appName.charAt(0) == "N" && navigator.appVersion.charAt(0) >= 3){
		file.focus();
	}
}

// ===================================================================================

//DateForSelectForm クラス（セレクトボックスで年月日を表示するクラス）
//コンストラクター
//DateForSelectForm(tyear,tmonth,tday,yearName,monthName,dayName,countYear,afterYear)
//　tyear：セットする年
//　tmonth：セットする月
//　tday：セットする日
//　yearName：適応させるselectのフォームの名前（年）
//　monthName：適応させるselectのフォームの名前（月）
//　dayName：適応させるselectのフォームの名前（日）
//  countYear：年を表示する数
//　afterYear：tyearでセットした年から過去何年から表示するのか


function DateForSelectForm(tyear,tmonth,tday,yearName,monthName,dayName,countYear,afterYear){
	//プロパティ
	this.tyear = tyear;
	this.tmonth = tmonth;
	this.tday = tday;
	this.yearName = yearName;
	this.monthName = monthName;
	this.dayName = dayName;
	this.countYear =countYear;
	this.afterYear = afterYear;

//--アクセスメソッド-----------------------------------
	function setYear(tyear){
		this.tyear = tyear;
	}
	DateForSelectForm.prototype.setYear = setYear;
	
	function setMonth(tmonth){
		this.tmonth = tmonth;
	}
	DateForSelectForm.prototype.setMonth = setMonth;
	
	function setDay(tday){
		this.tday = tday;
	}
	DateForSelectForm.prototype.setDay = setDay;
	
	function getYear(){
		return 	this.tyear;
	}
	DateForSelectForm.prototype.getYear = getYear;

	function getValue(){
		return document.central.elements[this.yearName].value;
	}
	DateForSelectForm.prototype.getValue = getValue;
//----------------------------------------------------------
	function init(FormName){
		this.underYear(FormName);
		this.selectMonth(FormName);
		this.underDay(FormName);
	}
	DateForSelectForm.prototype.init = init;

	function underYear(theForm){
		theForm.elements[this.yearName].options.length = this.countYear;
		theForm.elements[this.yearName].options[0].text = this.tyear-this.afterYear;
		theForm.elements[this.yearName].options[0].value = this.tyear-this.afterYear;
		for(i=1;i<this.countYear;i++){
				var year = eval(theForm.elements[this.yearName].options[i-1].value)+1;
				if(year == this.tyear){
					theForm.elements[this.yearName].selectedIndex = i;
				}
				theForm.elements[this.yearName].options[i].text = eval(theForm.elements[this.yearName].options[i-1].value)+1;
				theForm.elements[this.yearName].options[i].value = eval(theForm.elements[this.yearName].options[i-1].value)+1;
				
		}
	}
	DateForSelectForm.prototype.underYear = underYear;
	
	function underDay(theForm){
		theForm.elements[this.dayName].options.length = daymonth(theForm.elements[this.yearName].options[theForm.elements[this.yearName].selectedIndex].value,
		theForm.elements[this.monthName].options[theForm.elements[this.monthName].selectedIndex].value);
			for(i=0;i<theForm.elements[this.dayName].options.length;i++){
				theForm.elements[this.dayName].options[i].text = i+1;
				theForm.elements[this.dayName].options[i].value = i+1;
				if((this.tday == i + 1) && (this.tmonth == theForm.elements[this.monthName].options[theForm.elements[this.monthName].selectedIndex].value)){
					theForm.elements[this.dayName].selectedIndex = i;
				}
			}
	}
	DateForSelectForm.prototype.underDay = underDay;
	function selectMonth(theForm){
		for(i=0;i<theForm.elements[this.monthName].options.length;i++){
			if(this.tmonth == i + 1){
				theForm.elements[this.monthName].selectedIndex = i;
			}
		}
	}
	DateForSelectForm.prototype.selectMonth = selectMonth;
	
	// 閏年を判別
	function leapyear( year ) {
		return (year%4==0 && year%100!=0 || year%400==0);
	}
	DateForSelectForm.prototype.leapyear = leapyear;
	// 月の日数を求める
	function daymonth( year, month ) {
		var day = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
		if( month==2 && leapyear(year)) return 29;
		return day[month-1];
	}
	DateForSelectForm.prototype.daymonth = daymonth;
	return this;
}

function isFutureDate(year, month, day, errmsg){
	dateNow = new Date();
	yearNow = dateNow.getFullYear();
	monthNow = dateNow.getMonth() + 1; // getMonth()はインデックス値を返す
	dayNow = dateNow.getDate();
	if(year > yearNow){
		return true;
	}else if((year == yearNow) && (month > monthNow)){
		return true;
	}else if((year == yearNow) && (month == monthNow) && (day >= dayNow)){
		return true;
	}else{
		alert(errmsg + "\n現在の日付：" + yearNow + "/" + monthNow + "/" + dayNow + "\n指定されたの日付：" + year + "/" + month + "/" + day);
		return false;
	}
}
