//******************************************************************************************************
// Eexplanation : ¿ìÆí¹øÈ£ »õÃ¢ ¶ç¿ì±â
//******************************************************************************************************

function findZipcode(form, str) {
	formName = form.name;
	newURL = "/member/zipcodeSearch.php?sort=" + str + "&formName=" + formName;
	searchWindow=window.open(newURL, 'zipcodeSearch', 'width=468,height=245,left=200,top=100, toolbar=no,scrollbars=yes,resizable=no');
}


function bookmark_go() {
newURL = "/bookmark/index.html";
location.href=newURL;
}

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';

  cookie_str = document.cookie;
  cookie_str.toString();

  pos_start  = cookie_str.indexOf(name);
  pos_end    = cookie_str.indexOf('=', pos_start);

  cookie_name = cookie_str.substring(pos_start, pos_end);

  pos_start  = cookie_str.indexOf(name);
  pos_start  = cookie_str.indexOf('=', pos_start);
  pos_end    = cookie_str.indexOf(';', pos_start);
  
  if (pos_end <= 0) pos_end = cookie_str.length;
  cookie_val = cookie_str.substring(pos_start + 1, pos_end);
  if (cookie_name == name && cookie_val  == "done")
    return;

  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);


}


//******************************************************************************************************
// Eexplanation : °Ë»ö¿£Áøº° ¶ç¿ì±â
//******************************************************************************************************

function isearch(site, str) {
if(site=="naver"){
newURL = "http://search.naver.com/search.naver?where=nexearch&query=" + str + "&frm=t1&sm=top_hty";
tops=0;
}else if(site=="daum"){
	newURL = "http://search.daum.net/cgi-bin/nsp/search.cgi?t__nil_searchbox=btn&sType=tot&q=" + str;
tops=270;
}else if(site=="empas"){
	newURL = "http://search.empas.com/search/all.html?z=A&q=" + str;
	tops=540;
}else{
return;
}
	searchWindow=window.open(newURL, 'search'+tops);
}

//******************************************************************************************************
// Eexplanation : ¸Þ¼¼Áö¸¦ Ç¥½ÃÇÏ°í °è¼Ó ÁøÇàÇÑ´Ù.
// Input Value  : msg(Ç¥½ÃÇÒ ¸Þ¼¼Áö)
//******************************************************************************************************

function message(msg) {
	alert(msg);
}


//******************************************************************************************************
// Eexplanation : ¿¡·¯¸Þ¼¼Áö Ç¥½ÃÈÄ ÀÌÀü ÆäÀÌÁö·Î µ¹¸°´Ù.
// Input Value  : msg(Ç¥½ÃÇÒ ¸Þ¼¼Áö)
//******************************************************************************************************

function errmsg(msg) {
	if(msg == "") {
		msg = "Á¤»óÀûÀÎ Á¢±Ù ¹Ù¶ø´Ï´Ù!!";
	}
	alert(msg);
	history.go(-1);
}


//******************************************************************************************************
// Eexplanation : ¿¡·¯¸Þ¼¼Áö Ç¥½ÃÈÄ ÀÌÀü ÆäÀÌÁö·Î µ¹¸°´Ù.
// Input Value  :$msg(Ç¥½ÃÇÒ ¸Þ¼¼Áö)
//******************************************************************************************************

function msgClose(msg) {
	alert(msg);
	window.close();
}


//******************************************************************************************************
// Eexplanation : ¿¡·¯¸Þ¼¼Áö Ç¥½ÃÈÄ ÁöÁ¤ ÆäÀÌÁö·Î µ¹¸°´Ù.
// Input Value  : msg(Ç¥½ÃÇÒ ¸Þ¼¼Áö), url(ÀÌµ¿ÇÒ ÁÖ¼Ò)
//******************************************************************************************************

function msgMove(msg, url) {
	alert(msg);
	location.href = url;
}


//******************************************************************************************************
// Eexplanation : ¿¡·¯¸Þ¼¼Áö Ç¥½ÃÈÄ ÁöÁ¤ ÆäÀÌÁö·Î µ¹¸°´Ù.
// Input Value  : url(ÀÌµ¿ÇÒ ÁÖ¼Ò)
//******************************************************************************************************

function openerCM(url) {
	window.close();
	opener.location.href = url;
}


//******************************************************************************************************
// Eexplanation : ¿¡·¯¸Þ¼¼Áö Ç¥½ÃÈÄ ÁöÁ¤ ÆäÀÌÁö·Î µ¹¸°´Ù.
// Input Value  : url(ÀÌµ¿ÇÒ ÁÖ¼Ò)
// Sample		: openWindow('ÆÄÀÏ¸í','Å¸°Ù','scrollbars=yes,width=900,height=660,left=0,top=0')
//******************************************************************************************************

function openWindow(url,target,option) {
	window.open(url,target,option);
}


//******************************************************************************************************
// Eexplanation : ¸ð´ÞÃ¢À¸·Î »õÃ¢À» ¶ç¿î´Ù.
// Input Value  : url(ÀÌµ¿ÇÒ ÁÖ¼Ò)
// Sample		: openWindow("ÆÄÀÏ¸í", "Å¸°Ù", "dialogWidth:400px; dialogHeight:250px;status:no; help:no; scroll:no")
//******************************************************************************************************

function infoWindow(URL){
	window.showModalDialog(URL, "", "dialogWidth:400px; dialogHeight:250px;status:no; help:no; scroll:no"); 
}


//******************************************************************************************************
// Eexplanation : Ã¢À» ´Ý´Â´Ù
//******************************************************************************************************

function closeWindow() {
	window.close();
}


//******************************************************************************************************
// Eexplanation : ¼¿·ºÆ® ¹öÆ°À» ¼±ÅÃÇÏ¸é ÀÌµ¿ÇÑ´Ù.
// Input Value  : form(ÆûÀÌ¸§), fn(ÇÊµå¸í), url(±âº»ÁÖ¼Ò)
// Sample		: <select name=field_name onchange="Quick_Link(this.form, 'field_name', '/sample/sample.php?sample_id=');">
//******************************************************************************************************

function Jump_Category(form, fn, url) {
	var select = form.fn.selectedIndex;

	if(form.fn.options[select].value != "") {
		location=url + form.fn.options[select].value;
	}
}


//******************************************************************************************************
// Eexplanation : ´Ù½Ã ÇÑ¹ø ¹¯´Â´Ù.
// Input Value  : msg, url, val
//******************************************************************************************************

function msgConfirm(msg, url, val) {
	var val;
	ans = confirm(msg)
	if ( ans== true){
		str = url + val
		location.href = str;
	} 
}



//******************************************************************************************************
// Eexplanation : ÆäÀÌÁö ·Îµù½Ã Æ÷Ä¿½º°¡ ÇÊ¿äÇÒ¶§
// Input Value  : form(this.form), fieldName
//******************************************************************************************************

function selectFocus(form, fieldName) {
	form.recom_id.focus();
	return;
}


//******************************************************************************************************
//******************************************************************************************************
//******************************************************************************************************
//****************************   ¿©±â¼­ºÎÅÍ´Â ÀÏ¹ÝÀûÀÎ ÇÔ¼ö ¿Ü¿¡ »õ·Î Ãß°¡µÇ´Â °Íµé **************************
//******************************************************************************************************
//******************************************************************************************************
//******************************************************************************************************




//******************************************************************************************************
// Eexplanation : Å¬·¡½º ¹®¼­ ÀÛ¼º½Ã ¾²±âÃ¢À» ¶ç¿î´Ù.
// Input Value  : class_id, item_id, type(insert, modify)
//******************************************************************************************************

function docClassOpen(class_id, item_id, type) {
	if(item_id == 0) {
		mode = "insert";
	} else {
		mode = "modify";
	}
	url = "write.php?class_id=" + class_id + "&item_id=" + item_id + "&type=" + type + "&mode=" + mode;
	window.open(url, 'write', 'scrollbars=no,width=400,height=650,left=600,top=0');
}


//******************************************************************************************************
// Eexplanation : ÀÔ·Â°ªÀÌ ºó°ªÀÎÁö ÆÇº°ÇÑ´Ù.
// Input Value  : str(form.name.value°ª)
//******************************************************************************************************

function isEmpty(str) {

	for ( var i = 0 ; i < str.length ; i++ ) {
		if ( str.substring(i, i+1) != " " ) {
			return false;
		}
	}

	return true;

}


//******************************************************************************************************
// Eexplanation : ÀÔ·Â°ªÀÇ ÃÖ¼Ò, ÃÖ´ëÄ¡ ¾ÈÀÇ ±ÛÀÚ¼öÀÎÁö ÆÇº°ÇÑ´Ù.
// Input Value  : str(form.name.value°ª), minlen, maxlen
//******************************************************************************************************

function checkLength(str, minlen, maxlen) {

	if (str.length < minlen || str.length > maxlen) {
		return false;
	}		
		
	return true;

}


//******************************************************************************************************
// Eexplanation : ÇÑ±ÛÀÎÁö ÆÇº°ÇÑ´Ù.
// Input Value  : str(form.name.value°ª)
//******************************************************************************************************

function isHangul(str) {

	var re = /[a-zA-Z0-9\s~!@#\$%\^&\*\(\)_\+\{\}|:"<>\?`\-=\[\]\\;',\.\/]/; // matches a alphanumeric character or space

	if (re.test(str)) {
		return false;
	}

	return true;

}


//******************************************************************************************************
// Eexplanation : ¼ýÀÚÀÎÁö ÆÇº°ÇÑ´Ù.
// Input Value  : str(form.name.value°ª)
//******************************************************************************************************

function isNumber(str, allowable) {

	valid = true;
	cmp = "0123456789" + allowable;

	for (i=0; i<str.length; i++) {
		if (cmp.indexOf(str.charAt(i)) < 0) {
			valid = false;
			break;
		}
	}

	return valid;

}


//******************************************************************************************************
// Eexplanation : ÀÌ¸§ÀÎÁö ÆÇº°ÇÑ´Ù.
// Input Value  : str(form.name.value°ª)
//******************************************************************************************************

function checkName(str) {

	if (!checkLength(str, 2, 80, false) || !isHangul(str)) {
		return false;
	}

	return true;

}



//******************************************************************************************************
// Eexplanation : ÀüÀÚ¿ìÆíÁÖ¼Ò¸¦ ÆÇº°ÇÑ´Ù.
// Input Value  : str(form.name.value°ª)
//******************************************************************************************************

function checkEmail(str) {

	valid = false;

	if (str == "")
		alert("EmailÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À!!");
	else if (str.indexOf(" ") != -1)
		alert("EmailÁÖ¼Ò¿¡ °ø¹éÀº Çã¿ëµÇÁö ¾Ê½À´Ï´Ù!!");
	else if (str.indexOf("@") < 1)
		alert("EmailÁÖ¼Ò ÁöÁ¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù. '@'ÀÌ ´©¶ôµÇ¾ú½À´Ï´Ù!!");
	else if (str.indexOf(".") == -1)
		alert("EmailÁÖ¼Ò ÁöÁ¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù. '.'ÀÌ ´©¶ôµÇ¾ú½À´Ï´Ù!!");
	else if (str.indexOf(".") - str.indexOf("@") == 1)
		alert("EmailÁÖ¼Ò ÁöÁ¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù. '@' ´ÙÀ½¿¡ ¹Ù·Î '.'ÀÌ ¿Ã ¼ö ¾ø½À´Ï´Ù!!");
	else if (str.charAt(str.length-1) == '.')
		alert("EmailÁÖ¼Ò ÁöÁ¤ÀÌ Àß¸øµÇ¾ú½À´Ï´Ù. '.'Àº EmailÁÖ¼Ò ³¡¿¡ ¿Ã ¼ö ¾ø½À´Ï´Ù!!");
	else
		valid = true;

	return valid;

}


//******************************************************************************************************
// Eexplanation : ÅõÇ¥ÇÏ±âÀü¿¡ Ã¼Å©¸¦ ÁøÇàÇÑ´Ù.
//******************************************************************************************************

function pollCheck(form){

	var pollChecked = '';

	if(form.pollUsed.value == "Y") {

		alert("ÀÌ¹Ì ÅõÇ¥¸¦ ÇÏ¼Ì½À´Ï´Ù!!");
		return false;

	} else {

		for(var i =0 ; i < form.poll.length; i ++){
			if(form.poll[i].checked == true){
				pollChecked = 'OK';
			}
		}
		
		if(pollChecked != 'OK') {
			alert ('ÅõÇ¥ Ç×¸ñÀÌ ¼±ÅÃµÇ¾îÁöÁö ¾Ê¾Ò½À´Ï´Ù.');
			return false;
		}

	}

}


//******************************************************************************************************
// Eexplanation : µ· Ç¥½Ã½Ã 3ÀÚ¸®¸¶´Ù ÄÞ¸¶ »ðÀÔ
//******************************************************************************************************

function commaSplit(str) { 
	
	if(str.value.charAt(0) == 0 && str.value != "0") {
		str.value = "";
	}

	txtNumber = str.value;
	txtNumber = txtNumber.replace(/,/gi, "");

	if(txtNumber >= 1000000000000) {
		alert("´ÜÀ§´Â ¿øÀÌ¸ç 1Á¶ÀÌÇÏÀÇ ±Ý¾×À¸·Î Á¦ÇÑÇÕ´Ï´Ù!!");
	}

	if (isNaN(txtNumber)) { 
		alert("¼ýÀÚ¸¸ ÀÔ·Â ÇÏ¼¼¿ä"); 
		str.value = '';
		str.focus();
	} else { 

		var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])'); 
		var arrNumber = txtNumber.split('.'); 

		arrNumber[0] += '.'; 
		do { 
			arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2'); 
		} while (rxSplit.test(arrNumber[0]));
		
		if (arrNumber.length > 1) { 
			str.value = arrNumber.join(''); 
		} else { 
			str.value = arrNumber[0].split('.')[0]; 
		} 

	} 

} 


//******************************************************************************************************
// Eexplanation : id°ªÀ» ¼û±â°Å³ª º¸¿©ÁØ´Ù.
//******************************************************************************************************
function showmenu(str) {
	str.style.display = "";
}

function hidemenu(str) {
	str.style.display = "none";
}

//******************************************************************************************************
// Eexplanation : RollOver ¹öÆ°
//******************************************************************************************************

<!--
function restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function preload_img()
{ 
  var img_list = preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length-1; i++) {
    document.preloadlist[top+i] = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}



function iframe_autoresize(arg) {
arg.height = eval(arg.name+".document.body.scrollHeight");
arg.width = 170;
}



function iframe_autoresize_all(arg) {
arg.height = eval(arg.name+".document.body.scrollHeight");
}


function scaleFont(val) { 
var content, lineHeight; 
content = document.getElementById("content"); 
if (val > 0) { 
	if (fontSize <= 18) { 
		fontSize = fontSize + val; 
		lineHeight = fontSize+Math.round(1.1*fontSize); 
		content.style.fontSize = fontSize + "px";
		} 
		
} else { 
	
	if (fontSize > 12) { 
		
		fontSize = fontSize + val;
		lineHeight = fontSize+Math.round(1.1*fontSize);
		content.style.fontSize = fontSize + "px";
	} 
	
} 


 }

var fontSize = parseInt(12); 




//******************************************************************************************************
// Eexplanation : ÇÊ¿ä¾ø´Â ºÎºÐ ·¹ÀÌ¾î °¨Ãß°í ÆÛ°¡±â
//******************************************************************************************************
	var num=0;
function copycontent(elt,txt)
{
if(!num){
text = document.body.createTextRange();
text.moveToElementText(document.getElementById(elt));
text.execCommand('SelectAll');
text.execCommand('Copy');

  alert(txt +"ÀÌ(°¡) Å¬¸³º¸µå¿¡ º¹»çµÆ½À´Ï´Ù.\n°³ÀÎºí·Î±×³ª ¹Ì´ÏÈ¨ÇÇ,Ä«Æä¿¡ ÆÛ°¡¼Åµµ µË´Ï´Ù.");
}
num=0;

}



function hidemenus() {
    	tempColl = document.all.tags("DIV");
for (i=0; i<tempColl.length; i++) {
str = document.getElementById('hiddenmenu'+i);
if(str){
	if(str.style.display == "none"){
		
	    str.style.display = "block";
		num=num+1;
		}else{
		str.style.display = "none";
		}

	}

	}

return num;
}