<!--
/**********************************/
/*	ÃÖÁ¾¼öÁ¤ÀÏ : 2006-03-09 / 2006-10-10
/*	ÃÖÁ¾¼öÁ¤ÀÚ : ÀÌÈ£Ã¶
/**********************************/

// È®ÀÎ ¹öÆ°À» ´©¸¦ °æ¿ì ¿øÇÏ´Â ÆäÀÌÁö·Î 
function LA_confirmUrl(str,url){
	if(confirm(str)){
		location.href = url;
		return;
	} else {
		return;
	}
}

// ¸¶¿ì½º ¿À¸¥ÂÊÅ°, ¼±ÅÃ ±ÝÁö <body>ÅÂ±×¾È¿¡
//<body  oncontextmenu="return false" onselectstart="return false" ondragstart="return false">




// Å×ÀÌºí ¸¶¿ì½º¸¦ ¿Ã¸®¸é º¸´õ td ¼Ó¼º ¹Ù²Ù±ë
// ¿ø·¡µ¥·Î
function LA_defaultTD(obj){
	obj.style.color = '';
	obj.style.backgroundColor = '';
	obj.style.cursor = '';
}
// ¸¶¿ì½º ¿Ã¸±¶§
function LA_mouseOnTD(){

	var obj		=	arguments[0];
	var bgStyle	=	arguments[1];
	var fontStyle	=	arguments[2];
	var weight		=	arguments[3];

	if(arguments.length>0)	obj.style.backgroundColor	= bgStyle;
	if(arguments.length>1)	obj.style.color				= fontStyle;	
	if(arguments.length>2)	obj.style.fontWeight		= weight;
	
	obj.style.cursor = "hand";
}
// Å¬¸¯ÇßÀ»¶§
function LA_clickOnTD(obj,fontStyle,bgStyle, page){
	obj.style.color = fontStyle;
	obj.style.backgroundColor = bgStyle;
	obj.style.cursor = "hand";
	//ÇÁ·¹ÀÓÀÏ¶§
	//parent.info.location.href= page;
	document.location.href= page;
}
/* ¿¹)
<?
$bg_color = '#EFEFEF';
$fontStyle = '1 solid gray';
$event_bg_color = 'white';
?>

<SCRIPT LANGUAGE="JavaScript" src='../include/script_function.js'></SCRIPT>
<style>
.border_td {
	padding-left:50;
	border: 1 solid <?=$bg_color?>;
}
</style>
<TABLE  width="100%" height="100%" align=center cellpadding=3 cellspacing=0 border=0 bgcolor='<?=$bg_color?>'>
	<TR>
		<td id="board" class='border_td' onmouseover="mouseOnTD(this,'<?=$fontStyle?>','<?=$event_bg_color?>');" onmouseout="defaultStatus(this,'1 solid <?=$bg_color?>');" onClick="ClickOnTD(this,'<?=$fontStyle?>','<?=$event_bg_color?>','../sboard/slist.rsdb?sboard_id=notice');">¢¹ °øÁö»çÇ×</td>
	</TR>
	<TR>
		<td id="board" class='border_td' onmouseover="mouseOnTD(this,'<?=$fontStyle?>','<?=$event_bg_color?>');" onmouseout="defaultStatus(this,'1 solid <?=$bg_color?>');" onClick="ClickOnTD(this,'<?=$fontStyle?>','<?=$event_bg_color?>','../board/list.rsdb?board_id=free');">¢¹ ÀÚÀ¯°Ô½ÃÆÇ</td>
	</TR>
	<TR>
		<td id="board" class='border_td' onmouseover="mouseOnTD(this,'<?=$fontStyle?>','<?=$event_bg_color?>');" onmouseout="defaultStatus(this,'1 solid <?=$bg_color?>');" onClick="ClickOnTD(this,'<?=$fontStyle?>','<?=$event_bg_color?>','../board/list.rsdb?board_id=guest');">¢¹ ¹æ¹®ÈÄ±â</td>
	</TR>
	

	<tr height="100%"><td></td></tr>
</TABLE>

*/

// ¼ýÀÚ¸¦ ÅëÈ­´ÜÀ§·Î 2006-05-10 ¼öÁ¤ ¹®ÀÚÇüº¯È¯ ¹× ¼ýÀÚ Ã¼Å©, 2006-06-07 ¼öÁ¤(¼Ò¼ýÁ¡ ºÒ°¡;;)
function LA_numberFormat(str) {
	if(!str){
		return 0;
	}

	str	=	String(parseInt(str,10));
	var pattern	=	/^[0-9]+$/;  

	if(!pattern.test(str)){	// ¼ýÀÚ Ã¼Å©
		return 0;
	}

	var Re = /[^0-9]/g;
	var ReN = /(-?[0-9]+)([0-9]{3})/;
	str = str.replace(Re,'');              
	while (ReN.test(str)) { 
		str = str.replace(ReN, "$1,$2"); 
	}
	return str;
}
// ´ÙÀ½ ÆûÀ¸·Î ¼öÁ¤ 2005-01-06 (ÀÎÀÚ ÁÙÀÌ±â)
function LA_passNext(field,cnt){
	var form = field.form;
	if(field.value.length >= cnt){
		for(i=0;form.elements.length;i++){
			if(field == form.elements[i]){
				form.elements[i+1].select();
				form.elements[i+1].focus();
				break;
			}
		}
		return;
	}
	return;
}

// ¼Ò½ºº¸±â ¸·±â
//<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false"> 


// °´Ã¼ ÁÂÇ¥±¸ÇÏ±â
function LA_getObjTop(obj){
	
	
	if (obj.offsetParent == document.body){
		return obj.offsetTop;
	} else{
		return obj.offsetTop + LA_getObjTop(obj.offsetParent);
	}
}

function LA_getObjLeft(obj){
	
	
	if (obj.offsetParent == document.body){
		return obj.offsetLeft;
	} else{
		return obj.offsetLeft + LA_getObjLeft(obj.offsetParent);
	}
}

// textarea row ¼ö º¯°æ 2005-01-04 Ãß°¡
function LA_updateRows(obj,mode,size){
	var eleObj	=	obj.form.elements;
	
	for(i=0;i<eleObj.length;i++){
		if(eleObj[i] == obj)	break;
	}
	for(j=i;j>=0;j--){
		if(eleObj[j].type.toLowerCase() == 'textarea')	break;
	}
	
	var fieldObj	=	eleObj[j];

	if(mode == 'up'){
		if(fieldObj.rows > size)		fieldObj.rows -= size;
	} else if(mode == 'down'){
		fieldObj.rows += size;
	}
}

/*
<TABLE cellpadding=0 cellspacing=0 border=0>
	<TR>
		<TD><textarea name='txtarea_equipment' rows='3' cols='60'></textarea></TD>
		<TD>
			<INPUT TYPE="button" value='¡â' onclick="LA_updateRows(this.form,'up',2)" style='border:0;background-color:#FFFFFF;'><BR>
			<INPUT TYPE="button" value='¡ä' onclick="LA_updateRows(this.form,'down',2)" style='border:0;background-color:#FFFFFF;'>
		</TD>
	</TR>
</TABLE>
*/

// trim
String.prototype.trim = function() {
    return this.replace(/(^ *)|( *$)/g, "");
}
String.prototype.ltrim = function() {
    return this.replace(/(^ *)/g, "");
}
String.prototype.rtrim = function() {
    return this.replace(/( *$)/g, "");
}


// À©µµ¿ìÃ¢ ¸®»çÀÌÁî 2005-01-04 Ãß°¡ LA_resize(obj,maxW,maxY) 2005-01-11 ¼öÁ¤
// 2005-02-03 ¼öÁ¤ objBody.scroll == 'no' => objBody.scroll != 'yes'
function LA_reSizeWin(){

	try{
		var objBody
		
		var obj			=	arguments[0];
		
		if (!obj)	objBody	=	document.body;
		else		objBody	=	obj.document.body;
		
		if(!arguments[1])	var maxWidth	=	0;
		else				var maxWidth	=	arguments[1];

		if(!arguments[2])	var maxHeight	=	0;
		else				var maxHeight	=	arguments[2];

		var bodyWidth	=	objBody.scrollWidth + (objBody.offsetWidth - objBody.clientWidth)+6;
		var bodyHeight	=	objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight)+55;
		
		//objBody.scroll = 'no';

		//alert(bodyHeight+"/"+maxHeight)

		if(bodyHeight>maxHeight && maxHeight>0){	
			bodyHeight	= maxHeight;
			if(objBody.scroll != 'yes')	bodyWidth	+= 18;
			objBody.scroll = 'yes';
		} 
		if(bodyWidth>maxWidth && maxWidth>0){	
			bodyWidth	= maxWidth;
			if(objBody.scroll != 'yes')	bodyHeight	+= 18;
			objBody.scroll = 'yes';
		}
		
		if((bodyHeight<maxHeight && bodyWidth<maxWidth) || (!maxWidth && !maxHeight)){
			if(objBody.scroll == 'yes'){	
				bodyWidth	-= 20;
				bodyHeight	-= 20;
			}
			objBody.scroll = 'no';
		}

		obj.resizeTo(bodyWidth,bodyHeight);
	}catch(e){
		window.status = 'Error: ' + e.number +'; ' + e.description; 
	}
}


// ÇÁ·¹ÀÓ ¸®»çÀÌÁî (2006-03-09)
function LA_reSizeFrame(fr,isWidth){
	var IE = (document.all) ? 1: 0;

	try{
		var objFrame = typeof fr == 'string' ? document.getElementById(fr) : fr;	// Å¸ÀÔÃ¼Å© ½ºÆ®¸µÀÌ¸é ÇØ´ç ÀÌ¸§ÀÇ ¾ÆÀÌÇÁ·¹ÀÓ Ã£±â

		var objBody = objFrame.contentWindow.document.body;
								
		
		if(IE){
			ifrmHeight = objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);
			
			
			objFrame.setExpression('height', ifrmHeight);
			if(isWidth==1){
				ifrmWidth = objBody.scrollWidth + (objBody.offsetWidth - objBody.clientWidth);
				objFrame.setExpression('width', ifrmWidth);
			}
		} else {
			ifrmHeight = objBody.offsetHeight;
			if(!isNaN(ifrmHeight))	ifrmHeight	=	ifrmHeight+'px';
			objFrame.style.height	=	ifrmHeight;
			

			if(isWidth==1){
				ifrmWidth = objBody.offsetWidth;
				if(!isNaN(ifrmWidth))	ifrmWidth	=	ifrmWidth+'px';
				objFrame.style.width	=	ifrmWidth;
			}
		}
	}catch(e){
		window.status = 'Error: ' + e.number +'; ' + e.description; 
	}
}
// ºÎ¸ð ¸®»çÀÌÁî (2006-06-09)
function LA_reSizeParent(){
	var id			=	arguments[0];
	
	if(!arguments[1])	var isWidth	=	0;
	else				var isWidth	=	arguments[1];
	
	try{
		if(parent){
			var objBody	=	document.body;
			var IE = (document.all) ? 1: 0;

			var objWidth, objHeight;

			if(IE){	// IE
				objWidth	=	objBody.scrollWidth + (objBody.offsetWidth - objBody.clientWidth);
				objHeight	=	objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight);

				parent.document.getElementById(id).setExpression('height', objHeight+10);
				if(isWidth==1)	parent.document.getElementById(id).setExpression('width',objWidth);

			} else {	// NS
				objHeight	=	objBody.offsetHeight;
				objWidth	=	objBody.offsetWidth;

				if(!isNaN(objWidth))	objWidth	=	objWidth+'px';
				if(!isNaN(objHeight))	objHeight	=	objHeight+'px';

				parent.document.getElementById(id).style.height = objHeight;
				if(isWidth==1)	parent.document.getElementById(id).style.width	=	objWidth;

			}
		}
	}catch(e){
		//window.status = 'Error: ' + e.number +'; ' + e.description; 
	}
}


/*Ã¼Å©¹Ú½º ¸ðµÎ Ã¼Å©(2005-12-04)*/
function LA_checkAll(f,chkName){
	var arrUid	=	new Array();
	var j=0;
	formEl	=	f.elements;

	for(i = 0; i < formEl.length; i++){ 
		if(formEl[i].name == chkName){
			arrUid[j]	=	formEl[i];
			j++;
		}
	}

	if(arrUid.length>0){
		if(arrUid.length){
			for(i=0;i<arrUid.length;i++){
				// 2006-05-30 Ãß°¡ disabled Ã¼Å©
				if(arrUid[i].disabled == false)	arrUid[i].checked = f.chkAll.checked;
			}
		}
	}
}
/*Ã¼Å©¹Ú½º Ã¼Å©È®ÀÎ(2005-12-04)*/
function LA_checkChecked(f,chkName){

	var arrUid	=	new Array();
	var j=0;
	formEl	=	f.elements;

	for(i = 0; i < formEl.length; i++){ 
		if(formEl[i].name == chkName && formEl[i].checked == true)	break;
	}
	if(i == formEl.length){
		alert('¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù.');
		return false;
	} else return true;
}

/*ÀÌ¹ÌÁö ºñÀ²¿¡ ¸Â°Ô Á¶Àý(2005-12-12)*/
function LA_reImageSize(maxSize,curSize){
	// 0 Àº width, 1Àº height
	var resSize	=	new Array();

	if(maxSize[0]/maxSize[1] > curSize[0]/curSize[1]){
		if(curSize[1] > maxSize[1]){
			resSize[1]	=	maxSize[1];
			resSize[0]	=	curSize[0] * maxSize[1]/curSize[1];
		} else {
			resSize[1]	=	curSize[1];
			resSize[0]	=	curSize[0];
		}
	}else{
		if(curSize[0] > maxSize[0]){
			resSize[0]	=	maxSize[0];
			resSize[1]	=	curSize[1] * maxSize[0]/curSize[0];
		} else {
			resSize[0]	=	curSize[0];
			resSize[1]	=	curSize[1];
		}
	}
	resSize[0]	=	Math.round(resSize[0]);
	resSize[1]	=	Math.round(resSize[1]);

	return resSize;
}

//ÃÊ¸¦ °¡Á®¿Â´Ù(2005-12-29 11:11:11 Çü½Ä) 2005-12-29
function LA_getTime(datetime){
	var arrTmp, arrDate, arrTime, objDate, date, time;
	var patternDate	=	/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/; 
	var patternTime	=	/^[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}$/;

	arrTmp	=	datetime.split(" ");
	date	=	arrTmp[0];

	if(patternDate.test(date)){
		time	=	arrTmp[1];
		
		// ½ÃºÐÃÊ °ªÀÌ ÀÖÀ» °æ¿ì
		if(arrTmp.length=2 && patternTime.test(time)){
			arrDate	=	date.split("-");
			arrTime	=	time.split(":");
			objDate	=	new Date(arrDate[0],parseInt(arrDate[1],10)-1,arrDate[2],arrTime[0],arrTime[1],arrTime[2]);

			return objDate.getTime();
		// ³¯Â¥Á¤º¸¸¸ ÀÖÀ» °æ¿ì
		} else {
			arrDate	=	date.split("-");
			objDate	=	new Date(arrDate[0],parseInt(arrDate[1],10)-1,arrDate[2]);
			return objDate.getTime();
		}
	} else {
		return false;
	}
}

// ¿¡·¯³»¿ë »óÅÂ¹Ù¿¡ »Ñ·ÁÁÖ±â 2006-03-09
function LA_errorStatus(e){
	window.status = 'Error: ' + e.number +'; ' + e.description; 
}


// ¹è¿­ Ã¼Å© 2006-06-07
function LA_inArray(res,arr){
	var inArray	=	false;

	for(var i=0;i<arr.length;i++){
		if(arr[i] == res){
			inArray	=	true;
			break;
		}
	}

	return inArray;
}
//-->
