<!--
/**********************************/
/*	 : 2006-03-09 / 2006-10-10
/*	 : ?o
/**********************************/

// ? ?   ?  
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 = "pointer";
}
// ?
function LA_clickOnTD(obj,fontStyle,bgStyle, page){
	obj.style.color = fontStyle;
	obj.style.backgroundColor = bgStyle;
	obj.style.cursor = "pointer";
	//?
	//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  ?   u?, 2006-06-07 (? ?;;)
function LA_numberFormat(str) {
	if(!str){
		return 0;
	}

	str	=	String(parseInt(str,10));
	var pattern	=	/^[0-9]+$/;  

	if(!pattern.test(str)){	//  u?
		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"> 


// u ??
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, "");
}


// a  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, obj;
	
		if (!arguments[0]){
			objBody	=	document.body;
			obj	=	window;
		}else{
			obj	=	arguments[0];
			objBody	=	obj.document.body;
		}

		
		

		var bodyWidth	=	objBody.scrollWidth + (objBody.offsetWidth - objBody.clientWidth)+10;
		var bodyHeight	=	objBody.scrollHeight + (objBody.offsetHeight - objBody.clientHeight)+25;
		
				
			

		if(!arguments[1])	var maxWidth	=	screen.width - window.screenLeft;
		else				var maxWidth	=	arguments[1];

		if(!arguments[2])	var maxHeight	=	screen.height - window.screenTop;
		else				var maxHeight	=	arguments[2];


		//objBody.scroll = 'no';


		obj.resizeTo(0,0);

		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;	// ?u? ?? ? ?  a

		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; 
	}
}


/*u??  u?(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 u?
				if(arrUid[i].disabled == false)	arrUid[i].checked = f.chkAll.checked;
			}
		}
	}
}
/*u?? u??(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('Not selected object!');
		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];
		
		// u   
		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; 
}


// 迭 u? 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;
}






//	?  ?
function resize_image()
{
	var imgs = document.getElementsByTagName("IMG");
	for (var i in imgs)
	{
		if (imgs[i].resize != null)
		{
			resize = imgs[i].resize
			var w = imgs[i].width;
			var h = imgs[i].height;

			if (w > resize)
			{
				imgs[i].width = resize;
				imgs[i].height = (resize * h) / w;
				imgs[i].style.width = resize;
				imgs[i].style.height = (resize * h) / w;
				imgs[i].style.cursor = 'hand';
				imgs[i].alt = "When you click can see original size.";
				imgs[i].onclick = function()
				{
					window.open('/contents/view_image.php?src='+this.src+'&width='+w+'&height='+h,'vi','width=10,height=10');
				}
				var obj = document.getElementById("enlarge_desc");
				if(obj != null)	obj.style.display = 'block';
			}
		}
	}
}


//	? ? ?
function LA_print(target) {
	_LA_print(target, '/css/default.css');
}


//	?? ? ?
function LA_print2(target) {
	_LA_print(target, '../css/basic.css');
}


function _LA_print(target, css) {

	if(typeof target == 'string') {
		var obj = document.getElementById(target);
	} else if(typeof target == 'undefined') {
		var obj = document.getElementById('spanPrint');
	} else {
		var obj = target;
	}

	win=window.open("","prinWin",'width=680,height=500');
	win.document.open();
	win.document.write ("<html><head><meta http-equiv='content-type' content='text/html; charset=euc-kr'>\n");
	win.document.write ("<title>PRINT</title>\n");
	win.document.write ("<link href='"+css+"' rel='stylesheet' type='text/css'>\n");
	win.document.write ("</head>\n");
	win.document.write ("<body leftmargin=0 topmargin=0>\n");
	win.document.write (obj.innerHTML);
	win.document.write ("</body></html>\n");
	win.document.close();
	win.print();
	win.close();
}

//Vr ?
function popVR(pageURL) {
	window.open('/vr/vr_en.html?mid='+pageURL,'vr','width=700,height=500,top=50,left=50,resizable=no, scrollbars=no');
}
function popMAP(pageURL) {	
	window.open('/vr/map.html?mid='+pageURL,'map','width=20,height=20,top=50,left=50,resizable=yes, scrollbars=no');
}

function popSeating(pageURL) {	
	window.open('/vr/seating.html?url='+pageURL,'map','width=20,height=20,top=50,left=50,resizable=yes, scrollbars=no');
}
//o± μ??
function pop_win5(url, name, xx, yy)
{
  var popleft = (screen.width - xx) / 2;
  var poptop = (screen.height - yy) / 2;
  var toolbar_str = 'no';
  var menubar_str = 'no';
  var statusbar_str = 'no';
  var scrollbar_str = 'yes';
  var resizable_str = 'no';
  window.open(url, name, 'left='+popleft+',top='+poptop+',width='+xx+',height='+yy+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

// custom  confirm 대화 상자
// author 고왕국 / mymanage@nowenter.co.kr / 2007-08-27
// 사용법 : url=팝업 대화상자 url, message=메시지, ok=확인버튼이름, cancel=취소버튼이름 
// ok 를 누르면 true, cancle를 누르면 flase 가 리턴 된다.
// 주의사항 :  message, ok, cancel 내용에 | 가 들어가면 안된다 ..
// ps : 기본 팝업 대화상자 = /js/popups/confirm.html 
function WG_confirm(url, message, ok, cancel) {
	var text = message + '|' + ok + '|' + cancel;
	return showModalDialog(url,
                                 text, 
                                 "resizable: no; help: no; status: no; scroll: no; ");
}

//-->