function validDate(inum) {
	var checkstr = "0123456789"; 
	if (inum==1) {
		var yfield = document.board_sch.txt_fromyear;
		var mfield = document.board_sch.txt_frommonth;
		var dfield = document.board_sch.txt_fromday;
	} else {
		var yfield = document.board_sch.txt_endyear;
		var mfield = document.board_sch.txt_endmonth;
		var dfield = document.board_sch.txt_endday;
	}
	var DateField = yfield.value;
	if (mfield.value.length == 1) {mfield.value = 0 + mfield.value;}
	DateField = DateField + mfield.value;
	if (dfield.value.length == 1) {dfield.value = 0 + dfield.value;}
	DateField = DateField + dfield.value;
	var Datevalue = ""; 
	var DateTemp = ""; 
	var seperator = "-"; 
	var day;
	var month;
	var year;
	var leap = 0;
	var err = 0;
	var i;
	err = 0; 
	DateValue = DateField; 
  
	/* ¼ýÀÚ°¡ ¾Æ´Ñ ¹®ÀÚ »èÁ¦ */ 
	for (i = 0; i < DateValue.length; i++) { 
		if (checkstr.indexOf(DateValue.substr(i,1)) >= 0) { 
			DateTemp = DateTemp + DateValue.substr(i,1); 
		} 
	} 
	DateValue = DateTemp; 

	/* ¿¬µµ°¡ 2ÀÚ¸®·Î ÀÔ·Â µÈ´Ù¸é 20 À» Ãß°¡ */ 
	if (DateValue.length == 6) { 
		DateValue = '20' + DateValue.substr(0,6);
	} 
	if (DateValue.length != 8)  { 
		err = 19;
	} 

	/* ³âµµ°¡ 0000 À¸·Î ÀÔ·ÂµÇ´ÂÁö Ã¼Å© */ 
	year = DateValue.substr(0,4); 
	if (year == 0) { 
		err = 20;
	} 
   
	/* ¿ùÀÇ À¯È¿¼º Ã¼Å© */ 
	month = DateValue.substr(4,2); 
	if ((month < 1) || (month > 12)) { 
		err = 21; 
	} 
   
	/* ³¯Â¥ÀÇ À¯È¿¼º Ã¼Å© */ 
	day = DateValue.substr(6,2); 
	if (day < 1) { 
		err = 22; 
	} 
   
	/* À±³â/2¿ù Ã¼Å© */ 
	if ((year % 4 == 0) || (year % 100 == 0) || (year % 400 == 0)) { 
		leap = 1; 
	} 
	if ((month == 2) && (leap == 1) && (day > 29)) 	{ 
		err = 23; 
	} 
	if ((month == 2) && (leap != 1) && (day > 28)) { 
		err = 24; 
	} 
   
	/* ±âÅ¸ ¿ùÀÇ À¯È¿¼º Ã¼Å©  */ 
	if ((day > 31) && ((month == "01") || (month == "03") || (month == "05") || (month == "07") || (month == "08") || (month == "10") || (month == "12"))) { 
		err = 25; 
	} 
	if ((day > 30) && ((month == "04") || (month == "06") || (month == "09") || (month == "11"))) { 
		err = 26; 
	} 

	/* 00 ÀÔ·Â½Ã ÀÔ·Â³»¿ë »èÁ¦ */ 
	if ((day == 0) && (month == 0) && (year == 00)) { 
		err = 0; day = ""; month = ""; year = ""; seperator = ""; 
	} 
   
	/* ¿¡·¯°¡ ¾ø´Ù¸é ³¯Â¥ Ãâ·Â */ 
	if (err == 0 && DateValue.length >  6) { 
		DateField = year + seperator + month + seperator + day; 
		if (inum == 1)
			document.board_sch.hid_startday.value = DateField;
		else 
			document.board_sch.hid_endday.value = DateField;
	} else { 
		if (inum == 1)
			document.board_sch.hid_startday.value = "";
		else 
			document.board_sch.hid_endday.value = "";
	}
}

function searchIt() {
	document.board_sch.hid_title.value = document.board_sch.txt_title.value;
	document.board_sch.hid_isSearchResult.value = "1";
	document.board_sch.action='news_list.jsp';	
	document.board_sch.submit();
}



function searchIt1() {        
	var fr = document.board_sch;						
	if (fr.search_field.options[1].selected && fr.search_word.value.length >= 1) {
	    fr.hid_writer.value = fr.search_word.value ;		
	    fr.hid_isSearchResult.value = "1";
	    
	}else if (fr.search_field.options[2].selected && fr.search_word.value.length >= 1) {
		fr.hid_title.value = fr.search_word.value ;
		fr.hid_isSearchResult.value = "1";		
	}
	else{
	return;
	}
	
	fr.action='board_list.jsp';		
	fr.submit();
	
}	

function sTypeChange() {
	var fr = document.board_sch;	
	//fr.hid_parentcategory.value = fr.hid_category.value ;
	fr.hid_category.value = fr.sel_category.options[fr.sel_category.selectedIndex].value;
	
	fr.action='board_list.jsp';		
	fr.submit();	
}

function sortList(kind) {
    var fr = document.board_sch;    
	fr.hid_category.value = kind;	
	fr.hid_title.value = "";
	fr.hid_writer.value= "";
	fr.hid_isSearchResult.value = 1 ;
	
	fr.submit();    
}	

function resize(count) {

    var width = " ";
    var height = " ";
    
	for (var i=0; i < count ; i++){

	 	width = eval('document.all.userImg'+i+'.width');    
	 	height = eval('document.all.userImg'+i+'.height');    
	 	//alert(i+"==>width="+width+ "height="+height);
	 	if ( width - height >= 0 ) 
	 	{
	 		if (width >= 140 ) document.getElementById('userImg'+i).width   = 140 ;	 		
	 	}
	 	else  	 	
	 	{	if (height >= 140) document.getElementById('userImg'+i).height  = 140 ; 		 	    
	 	}
	}
}

function viewIt(target) {
	document.frm_PhotoBoardsview.targetBulletinid.value = target;
	document.frm_PhotoBoardsview.submit();
}

function writeCheck() {
	if (document.frm_PhotoBoardswrite.customercode.value == -1) {
		alert("·Î±×ÀÎ ÇØ ÁÖ¼¼¿ä");
		document.frm_login.txt_identitynumber1.focus();
		return false;		
		}		
	document.frm_PhotoBoardswrite.submit();
		
}

function MM_preloadImages() { //v3.0                                                              
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();                                   
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)                 
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}                       
}                                                                                                 
                                                                                                  
function MM_swapImgRestore() { //v3.0                                                             
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;            
}                                                                                                 
                                                                                                  
function MM_findObj(n, d) { //v4.0                                                                
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {                 
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}                              
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];            
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);              
  if(!x && document.getElementById) x=document.getElementById(n); return x;                       
}                                                                                                 
                                                                                                  
function MM_swapImage() { //v3.0                                                                  
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)    
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}                           

var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id)
{
	if (isDOM) return document.getElementById(id);
	if (isIE4) return document.all[id];
	if (isNS4) return document.layers[id];
}

var isNS = navigator.appName == "Netscape";

function moveRightEdge()
{
	var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
	if (isNS4)
	{
		yMenuFrom   = divMenu.top;
		yMenuTo     = windows.pageYOffset + 0;   
	}
	else if (isDOM)
	{
		yMenuFrom   = parseInt (divMenu.style.top, 10);
		yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) + 71; 
	}

	timeoutNextCheck = 200;

	if (yMenuFrom != yMenuTo)
	{
		yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 20);
		if (yMenuTo < yMenuFrom)
			yOffset = -yOffset;
		if (isNS4)
			divMenu.top += yOffset;
		else if (isDOM)
			divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;
			timeoutNextCheck = 10;
	}
	setTimeout ("moveRightEdge()", timeoutNextCheck);
}

function floatAdWindow() 
{
	if (isNS4)
	{
		var divMenu = document["divMenu"];
		divMenu.top = top.pageYOffset + 50;
		divMenu.visibility = "visible";
		moveRightEdge();
	
	}
	else if (isDOM)
	{
		var divMenu = getRef('divMenu');
		divMenu.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 400;
		divMenu.style.visibility = "visible";
		moveRightEdge();
	}
}	
	                                                                      
function popview(url){
    
	window.open("./imageZoom.jsp?url=" + url,"mainview","scrollbars=yes,width=800,height=600");	
}

