document.title = '::: ³ª´® :::';

// Äü¸Þ´º(½½¶óÀÌµù ¸Þ´º) //////////////////////////////////////////
	var StartPos = 0; // ½½¶óÀÌµå ¸Þ´º ½ÃÀÛÀ§Ä¡
	var x = 0; // È­¸é ¿ÞÂÊÀ¸·Î ºÎÅÍ ¶³¾îÁö´Â À§Ä¡
	var Y = 0; // ÆäÀÌÁö Çì´õºÎºÐÀÇ ¿©¹é
	var slideY = 0; // ½½¶óÀÌµå½Ã ºê¶ó¿ìÀú »ó´Ü°ú ¶ç¿öÁö´Â °Å¸®

	var slideWatch;
	var slideSpeed = 50; // ½½¶óÀÌµå ¼Óµµ
	var slideSpeed2 = 10; //

	function SaveCookie(name, value, expire){
		var eDate = new Date();
		eDate.setDate(eDate.getDate() + expire);
		document.cookie = name + "=" + value + "; expires=" +  eDate.toGMTString()+ "; path=/";
	}


	function Refreshslide1(){
		slide = document.getElementById("Quickmenu")
		var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

		stmnStartPoint = parseInt(slide.style.top, 10);
		stmnEndPoint = document.documentElement.scrollTop + slideY;

		if (stmnEndPoint < Y) stmnEndPoint = Y;

		stmnRefreshTimer = slideSpeed;

		if ( stmnStartPoint != stmnEndPoint ) {
				stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
				slide.style.top = (parseInt(slide.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount ))+"px";
				stmnRefreshTimer = slideSpeed2;
		}

		slideWatch = setTimeout ("Refreshslide1();", stmnRefreshTimer);
	}


	function ToggleAnimate(){
		if (ANIMATE.checked) {
			Refreshslide1();
			SaveCookie("ANIMATE", "true", 300);
		}
		else {
			clearTimeout(slideWatch);
			slide1.style.top = Y;
			SaveCookie("ANIMATE", "false", 300);
		}
	}


	function Initslide1(){
		slide = document.getElementById("Quickmenu")
		//slide.style.left = x+"px";
		slide.style.top = ((document.documentElement.scrollTop) + StartPos)+"px";
		Refreshslide1();
	}

	function back_top(){
		x = document.documentElement.scrollLeft;
		y = document.documentElement.scrollTop;
		step = 2;

		while ((x != 0) || (y != 0)) {
				scroll (x, y);
				step += (step * step / 300);
				x -= step;
				y -= step;
				if (x < 0) x = 0;
				if (y < 0) y = 0;
		}
		scroll (0, 0);
	}



// Flash Àü¿ë È£ÃâÇÔ¼ö id_name : ID¶Ç´ÂName °ª, swf_name : ¼îÅ©¿þÀÌºêÆÄÀÏ °æ·Î(ÀÌ¸§,GET°ªÆ÷ÇÔ), wdith: ³ÐÀÌ°ª, height: ³ôÀÌ°ª 
function swf_func(id_name,swf_name,width,height){ 
document.writeln("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='/asset/flash/swflash.cab#version=8,0,0,0' width='"+width+"' height='"+height+"' id='"+id_name+"' align='middle'>");
document.writeln("<param name='allowScriptAccess' value='always'>");
document.writeln("<param name='movie' value='"+swf_name+"'>");
document.writeln("<param name='quality' value='high'>");
document.writeln("<param name='bgcolor' value='#ffffff'>");
document.writeln("<param name='wmode' Value='Transparent'>");
document.writeln("<EMBED id='" + id_name + "' src='"+swf_name+"' width='"+width+"' height='"+height+"' type='application/x-shockwave-flash' wmode='transparent'></EMBED>");
document.writeln("</object>");
}


//µ¿¿µ»ó Àü¿ë È£ÃâÇÔ¼ö
function mov_func(id,name,width,height){
document.writeln("<OBJECT classid='clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95' width='"+width+"' height='"+height+"' id='"+id+"'>");
document.writeln("<PARAM NAME='Filename' VALUE='" +name +"'>");
document.writeln("<PARAM NAME='Showcontrols' VALUE='True'>");
document.writeln("<PARAM NAME='Autostart' VALUE='True'>");
document.writeln("<PARAM NAME='uimode' VALUE='false'>");
document.writeln("<PARAM NAME='Volume' VALUE='-1000'>");
document.writeln("<EMBED src='"+ name +"' width='" + width + "' height='" + (Number(height)+60)  + "' id='" + id + "' autostart='1' controller='1' volume='-1000'></EMBED>");
document.writeln("</OBJECT>");
}

// ÀÌ¹ÌÁö ÀÚµ¿ Ãà¼Ò(°Ô½ÃÆÇ ³ÐÀÌ¿¡ ¸ÂÃã)
function imageChange(imgSize) {
	for(i = 0;i < document.images.length; i++){
		if(document.images[i].id == "userIMAGE"){
			if(document.images[i].width > imgSize){
				document.images[i].height = document.images[i].height / (document.images[i].width / imgSize);
				document.images[i].width = imgSize;
			}
		}
	}
}

//ÇÑ±ÛÀÎÁö °Ë»ç
function Check_onlyKorean(str){
	for ( var i=0; i < str.length; i++ ) {
		if ( str.charCodeAt(i) < 0xAC00 || str.charCodeAt(i) > 0xD7A3){
			if (( str.charCodeAt(i) < 12593 || str.charCodeAt(i) > 12643 ) && ( str.charCodeAt(i) != 32)) {
				return true;
			}
		}
	}	
	return false;
}

//±â´É : ÆË¾÷Ã¢À» È­¸é Áß¾Ó¿¡ ¶ç¿ì´Â ÇÔ¼ö
//»ç¿ë¹ý : openPopup('auth_write.asp','auth',667,500,'scrollbars=yes,width=667,height=500')
function openPopup( url, name, width, height, features) {
    var left= ( screen.width   - width ) / 2;
    var top = ( screen.height   - height ) / 2;
    return window.open(url, name, features + ',left=' + left + ', top=' + top);
}

/*
±â´É : ÇÊµå¿¡ ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ¼ö ÀÖ´Â ÇÔ¼ö 
»ç¿ë¹ý : onkeyup="onlyNumber(this);"
*/
 
function onlyNumber(el) {
  el.value = el.value.replace(/\D/g,'');
}

//¹®ÀÚ¿­ÀÇ °ø¹éÁ¦°Å (¾çÃø)
function Trim( str ) {
		
	var resultStr = "";
		
	resultStr = TrimLeft(str);
	resultStr = TrimRight(resultStr);
	
	return resultStr;
}

//¹®ÀÚ¿­ÀÇ °ø¹éÁ¦°Å (ÁÂÃø)
function TrimLeft( str ) {
	var resultStr = "";
	var i = len = 0;	
	if (str+"" == "undefined" || str == null) return null;	
	str += "";
	
	if (str.length == 0) resultStr = "";
	else {	
		len = str.length;					
  		while ((i <= len) && (str.charAt(i) == " "))i++;   	
  		resultStr = str.substring(i, len);
  	}

  	return resultStr;
} 

//¹®ÀÚ¿­ÀÇ °ø¹éÁ¦°Å (¿ìÃø)
function TrimRight( str ) {
	var resultStr = "";
	var i = 0;	
	
	if (str+"" == "undefined" || str == null) return null;
	str += "";
		
	if (str.length == 0) resultStr = "";
	else {
  		i = str.length - 1;
  		while ((i >= 0) && (str.charAt(i) == " "))
 			i--;
	  		resultStr = str.substring(0, i + 1);
	  	}
	  	
	  	return resultStr;  	
}

/*
±â´É : ÇÊµå¿¡ ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ¼ö ÀÖ´Â ÇÔ¼ö 
»ç¿ë¹ý : onkeyup="onlyNumber(this);"
*/
 
function onlyNumber(el) {
  el.value = el.value.replace(/\D/g,'');
}

/*
±â´É : °øÅë Input Box Blank CheckÇÔ¼ö
»ç¿ë¹ý1 : setInputAlert(form1.field, fieldName);
*/
function setInputAlert(field, fieldName) {	
	if(Trim(field.value) == "") {
		alert(fieldName +" ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		field.focus();
		return false;
	}else{
		return true;
	}
}

/*
±â´É : °øÅë Select Box Blank CheckÇÔ¼ö
»ç¿ë¹ý1 : setSelectAlert(form1.field, fieldName);
*/
function setSelectAlert(field, fieldName) {	
	if(Trim(field.value) == "") {
		alert(fieldName +" ¼±ÅÃÇØÁÖ¼¼¿ä.");		
		field.focus();
		return false;
	}else{
		return true;
	}
}

/*
±â´É : °øÅë Check Box Blank CheckÇÔ¼ö
»ç¿ë¹ý1 : setCheckAlert(form1.field, fieldName);
*/
function setCheckAlert(field, fieldName) {	
	var temp = 0;
	for(i = 0; i < field.length; i++){
		if(field[i].checked == true){
			temp = temp + 1;
		}
	}
	
	if(temp == 0){
		alert(fieldName+" ¼±ÅÃÇØÁÖ¼¼¿ä.");
		return false;
	}else{
		return true;
	}
}

//Å¬¸³º¸µå¿¡ ³»¿ëº¹»ç
function CopyToClipboard(txt) {
	window.clipboardData.setData('Text',txt);
    alert('º¹»çµÇ¾ú½À´Ï´Ù.');
}

