function period_disp()
{
  today = new Date();
//  today.setTime(today.getTime() + 24 * 60 * 60 * 1000 );
  year=today.getFullYear();
  month=today.getMonth();
  month+=1;
  if(month <10) month="0" + month;
  date=today.getDate();
  if(date<10) date="0" + date;

  startyear= year;
  startmonth= month; 
  startday= date;
  endyear= year; 
  endmonth= month;
  endday= date;

// ½ÃÀÛ ³¯Â¥
  document.writeln("<select name=fmDtYy class='black'>");		//ADD <class=black>...
  for (index=2003;index <= endyear;index++) {
  	if(index==startyear) 
	  document.writeln("<option value=" + index + " selected>" + index);
  	else document.writeln("<option value=" + index + ">" + index);
  }
  document.writeln("</select>³â");

  document.writeln("<select name=fmDtMm class='black'>");			//ADD <class=black>...
  for (index=1;index <= 12;index++) {
  	if(index==startmonth){
        if(index <10)
      		document.writeln("<option value=0" + index + " selected>0" + index);
    	else
      		document.writeln("<option value=" + index + " selected>" + index);

  	}else{
    	  if(index <10)
      		document.writeln("<option value=0" + index + ">0" + index);
    	  else
      		document.writeln("<option value=" + index + ">" + index);
   	}
  }

  document.writeln("</select>¿ù");

  document.writeln("<select name=fmDtDd class='black'>");				//ADD <class=black>...
  for (index=1;index <= 31;index++) {
  	if(index==startday){
  	    if(index <10)
    	    document.writeln("<option value=0" + index + " selected>0" + index);
    	else 
    	    document.writeln("<option value=" + index + " selected>" + index);

  	}else {
        if(index <10)
    	    document.writeln("<option value=0" + index + ">0" + index);
    	else 
    	    document.writeln("<option value=" + index + ">" + index);
   	}
  }

  document.writeln("</select>ÀÏºÎÅÍ<br> ");

// ¸¶Áö¸· ³¯Â¥
  document.writeln("<select name=toDtYy class='black'>");		//ADD <class=black>...
  for (index=2003;index <= endyear;index++) {
  	if(index==endyear) 
	  document.writeln("<option value=" + index + " selected>" + index);
  	else document.writeln("<option value=" + index + ">" + index);
  }
  document.writeln("</select>³â");

  document.writeln("<select name=toDtMm class='black'>");		//ADD <class=black>...
  for (index=1;index <= 12;index++) {
  	if(index==endmonth){
  	    if(index <10)
      		document.writeln("<option value=0" + index + " selected>0" + index);
    	else
      	    document.writeln("<option value=" + index + " selected>" + index); 

  	}else {
    	if(index <10)
      		document.writeln("<option value=0" + index + ">0" + index);
    	else
      	    document.writeln("<option value=" + index + ">" + index);
   	}
  }
  document.writeln("</select>¿ù");

  document.writeln("<select name=toDtDd class='black'>");		//ADD <class=black>...
  for (index=1;index <= 31;index++) {
  	if(index==endday){
  	    if(index <10) 
		    document.writeln("<option value=0" + index + " selected>0" + index);
    	else 
    	    document.writeln("<option value=" + index + " selected>" + index);
    	  
  	}else {
        if(index <10) 
		    document.writeln("<option value=0" + index + ">0" + index);
    	else 
    	    document.writeln("<option value=" + index + ">" + index);
   	}
  }
  document.writeln("</select>ÀÏ");
}

function writeYYMMDD()
{
  today = new Date();
  today.setTime(today.getTime() + 24 * 60 * 60 * 1000 );
  year=today.getFullYear();
  month=today.getMonth();
  month+=1;
  if(month <10) month="0" + month;
  date=today.getDate();
  if(date<10) date="0" + date;

  startyear= year;
  startmonth= month; 
  startday= date;
  endyear= year; 
  endmonth= month;
  endday= date;

// ½ÃÀÛ ³¯Â¥
  document.writeln("<select name=yy class='black'>");		//ADD <class=black>...
  for (index=2003;index <= endyear;index++) {
  	if(index==startyear) 
	  document.writeln("<option value=" + index + " selected>" + index);
  	else document.writeln("<option value=" + index + ">" + index);
  }
  document.writeln("</select>³â");

  document.writeln("<select name=mm class='black'>");			//ADD <class=black>...
  for (index=1;index <= 12;index++) {
  	if(index==startmonth){
        if(index <10)
      		document.writeln("<option value=0" + index + " selected>0" + index);
    	else
      		document.writeln("<option value=" + index + " selected>" + index);

  	}else{
    	  if(index <10)
      		document.writeln("<option value=0" + index + ">0" + index);
    	  else
      		document.writeln("<option value=" + index + ">" + index);
   	}
  }

  document.writeln("</select>¿ù");

  document.writeln("<select name=dd class='black'>");				//ADD <class=black>...
  for (index=1;index <= 31;index++) {
  	if(index==startday){
  	    if(index <10)
    	    document.writeln("<option value=0" + index + " selected>0" + index);
    	else 
    	    document.writeln("<option value=" + index + " selected>" + index);

  	}else {
        if(index <10)
    	    document.writeln("<option value=0" + index + ">0" + index);
    	else 
    	    document.writeln("<option value=" + index + ">" + index);
   	}
  }

  document.writeln("</select>ÀÏ");
}

//// ÇØ´ç ³â¿ùÀ» writeÇÑ´Ù.
function getToYymm(){
  today = new Date();
  year=today.getFullYear();
  month=today.getMonth();
  month+=1;
  if(month <10) month="0" + month;
  date=today.getDate();
  if(date<10) date="0" + date;

  startyear= year;
  startmonth= month; 
  startday= date;
  endyear= year; 
  endmonth= month;
  endday= date;

// ½ÃÀÛ ³¯Â¥
  document.writeln("<select name=DtYy class='black'>");
  for (index=2003;index <= endyear;index++) {
  	if(index==startyear) 
	  document.writeln("<option value=" + index + " selected>" + index);
  	else document.writeln("<option value=" + index + ">" + index);
  }
  document.writeln("</select>³â");

  document.writeln("<select name=DtMm class='black'>");
  for (index=1;index <= 12;index++) {
  	if(index==startmonth){
        if(index <10)
      		document.writeln("<option value=0" + index + " selected>0" + index);
    	else
      		document.writeln("<option value=" + index + " selected>" + index);

  	}else{
    	  if(index <10)
      		document.writeln("<option value=0" + index + ">0" + index);
    	  else
      		document.writeln("<option value=" + index + ">" + index);
   	}
  }
  document.writeln("</select>¿ù");
}

function checkYYMMDD(yyyy,mm,dd){
  today = new Date();	
  year=today.getFullYear();
  month=today.getMonth();
  month+=1;
  if(month<10) month="0" + month;
  date=today.getDate();
  if(date<10) date="0" + date;

  if (yyyy > year) return true;
  if (yyyy < year) return false;
  
  if (mm > month) return true;
  if (mm < month) return false;
  
  if (dd > date) return true;
  
  return false;
  
}


function checkTerm(term_len,sYy,sMm,sDd,eYy,eMm,eDd) {

        //¿©¼¸´Þ ÀÌ»óÀº Á¶È¸ ÇÒ ¼ö ¾øÀ½
        if((eYy - sYy) <= 1){

                if((eYy - sYy) == 1){ eMm = parseInt(eMm) + 12; }

                if((eYy - sYy) < 0 || ((eYy - sYy) == 0 && (eMm - sMm) < 0)){
                        alert('Á¶È¸ ±â°£ÀÌ Àß¸ø ¼±ÅÃµÇ¾ú½À´Ï´Ù.!!\n´Ù½Ã ¼±ÅÃÇØ ÁÖ¼¼¿ä');
                        return false;
                }

                if((eMm - sMm) == term_len){
                        if((eDd - sDd) >= 0){
                        alert('Á¶È¸ ±â°£Àº '+term_len+'´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù!!');
                        return false;
                        }else{
                        return true;
                        }
                }else if((eMm - sMm) > term_len){
                        alert('Á¶È¸ ±â°£Àº '+term_len+'´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù!!');
                        return false;
                }else{
                        return true;
                }

        } else {
                alert('Á¶È¸ ±â°£Àº '+term_len+'´ÞÀ» ÃÊ°úÇÒ ¼ö ¾ø½À´Ï´Ù!!');
                return false;
        }
        return true;
}
  

