//¸ÞÀÎ°øÁö»çÇ× °ü·Ã½ºÅ©¸³
/*
var x=0
var y=0
drag = 0
move = 0
window.document.onmousemove = mouseMove
window.document.onmousedown = mouseDown
window.document.onmouseup = mouseUp
window.document.ondragstart = mouseStop

function mouseUp() {
	move = 0
}
function mouseDown() {
	if (drag) {
		clickleft = window.event.x - parseInt(dragObj.style.left)
		clicktop = window.event.y - parseInt(dragObj.style.top)
		dragObj.style.zIndex += 1
		move = 1
	}
}
function mouseMove() {
	if (move) {
		dragObj.style.left = window.event.x - clickleft
		dragObj.style.top = window.event.y - clicktop
	}
}
function mouseStop() {
	window.event.returnValue = false
}
function Show(divid) {
	divid.filters.blendTrans.apply(); 
	divid.style.visibility = "visible"; 
	divid.filters.blendTrans.play(); 
}
function HideNotice() {
	//divid.filters.blendTrans.apply();
	Notice.style.display = "none";
	//divid.filters.blendTrans.play(); 
}
*/

//Áß¾Ó¿¡ ¿ÀÇÂÃ¢ ¶ç¿ì±â
function centerWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,resizable=no'
	win = window.open(mypage,myname,settings)
}

//·ÎµùÀÌ¹ÌÁöÃ³¸®
function loadImages() {
	if (document.getElementById) {  
		document.getElementById('loadingBar').style.visibility = 'hidden';
	}
	else {
		if (document.layers) {  
			document.loadingBar.visibility = 'hidden';
		}
		else {  
			document.all.loadingBar.style.visibility = 'hidden';
		}
	}
}
//¼ýÀÚ¸¸ ÀÔ·Â°¡´É
function check3(){     
  if ((event.keyCode>=48 )&&(event.keyCode <=57))
   	event.returnValue = true
  else 
    event.returnValue = false
}

//¼ýÀÚ,-¸¸ ÀÔ·Â°¡´É
function check4(){     
  if (((event.keyCode>=48 )&&(event.keyCode <=57))||event.keyCode==45)
   	event.returnValue = true
  else 
    event.returnValue = false
}

// ¼ýÀÚ¿¡ ÄÄ¸¶»©°í ´Ù½Ã °è»êÈÄ ÄÄ¸¶Âï±â.    
function CheckMoney(obj)
{
    a=out_comma(obj.value)*1;   
    obj.value=in_comma(a);
}

//ÄÄ¸¶ »©±â
function out_comma(str)
{
	  comm_str = String(str);
		
		uncomm_str="";
		
		for(i=0; i<comm_str.length; i++)
		{
		   substr=comm_str.substring(i,i+1);
		   if(substr!=",")
		   	    uncomm_str += substr;
		}   	    
		
		return uncomm_str;
}		
//ÄÄ¸¶ ³Ö±â		
function in_comma(str)
{
    uncomm_str = String(str);
    comm_str = "";
		
    loop_j = uncomm_str.length - 3;
	
	for(j=loop_j; j>=1 ; j=j-3)
	{
		comm_str=","+uncomm_str.substring(j,j+3)+comm_str;
	}		 
	
	comm_str = uncomm_str.substring(0,j+3)+comm_str;
    
    return comm_str;
}
//³»¿ëÁö¿ì±â
function del(that){
	that.value="";
	that.focus();
	return false;
}
//¸µÅ© Æ÷Ä¿½º ¾ø¾Ö±â 
function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;

//»óÅÂ¹Ù ³¯Â¥ ¹× ½Ã°£ º¸ÀÌ±â(°³¹ß¿Ï·áÈÄ Àû¿ë)
function runClock() { 
	theTime = window.setTimeout("runClock()", 1000); 
	var today = new Date(); 
	var display= today.toLocaleString(); 
	status=display; 
} 

//»èÁ¦½Ã Áú¹®
function deleteok(go){
	if (confirm ("Á¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?\n»èÁ¦ ÈÄ DATA¸¦ º¹±¸ÇÒ ¼ö ¾ø½À´Ï´Ù!!  ")){
		location.href=go;
	}
	else {
		return false;
	}
}

//¹®ÀÚÀÔ·Â±æÀÌ È®ÀÎ¿ë ½ºÅ©¸³
function ValidLength(item, len){
	item = endEnc(item);
	item = firstEnc(item);
	return(item.length > len);
}
function endEnc(str){
	str = str + "";
	var len = str.length;
	for(var i = (len - 1); (str.charAt(i) == ' '); i--);
		str = str.substring(0, i + 1);
	return str;
}
function firstEnc(str){
	var len = str.length;
	var i = 0;
	for(i = 0; str.charAt(i) == ' '; i++);
		str = str.substring(i, len);
	return str;
}

//¿¡·¯½Ã Ã³¸® ½ºÅ©¸³
function error(item,text){
	alert(text);
	item.value="";
	item.focus(); 
	return false;
}

//¼ýÀÚ¸¸ ÀÔ·ÂÈ®ÀÎ
function IsInt(textObj) {
	var newLength = textObj.length;
	var extraChar = '\"1234567890\"';
	var search;
 
	if (newLength == 0) return false;
 
	for (var i = 0; i != newLength; i++) {
		aChar = textObj.substring(i,i+1); 
		search = extraChar.indexOf(aChar); 
  		if(search == -1) {
			return false;
		} 
	}
	return true;
} 

//¼ýÀÚ,-¸¸ ÀÔ·ÂÈ®ÀÎ
function IsZip(textObj) {
	var newLength = textObj.length;
	var extraChar = '\"1234567890-\"';
	var search;
 
	if (newLength == 0) return false;
 
	for (var i = 0; i != newLength; i++) {
		aChar = textObj.substring(i,i+1); 
		search = extraChar.indexOf(aChar); 
  		if(search == -1) {
			return false;
		} 
	}
	return true;
} 

function check2(){     //¼ýÀÚ¸¸ ÀÔ·Â¹ÞÀ½(ÇÑ±Û Ã³¸®¾ÈµÊ)
  if ((event.keyCode>=48 )&&(event.keyCode <=57))
   	event.returnValue = true
  else 
    event.returnValue = false
}

//·Î±×ÀÎ½Ã enter key Ã³¸®
function EnterCheck(i) {
   if(event.keyCode ==13 && i==1){ 
       document.loginform.pwd.focus(); 
   }
   if(event.keyCode ==13 && i==2){ 
      check_index(document.loginform);
   } 
}

//¼ýÀÚ,¿µ¹® ÀÔ·ÂÈ®ÀÎ
function isIntChar(textObj) { 
	var newLength = textObj.length;
	var extraChar = '\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"';
	var search;
 
	if (newLength == 0) return false;
 
	for (var i = 0; i != newLength; i++) {
		aChar = textObj.substring(i,i+1); 
		search = extraChar.indexOf(aChar); 
  		if(search == -1) {
			return false;
		} 
	}
	return true;
} 

//ÀÌ¸ÞÀÏÀÔ·ÂÈ®ÀÎ
function isEmail(textObj) { 
	var newLength = textObj.length;
	var extraChar = '\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.\"';
	var search;
 
	if (newLength == 0) return false;
 
	for (var i = 0; i != newLength; i++) {
		aChar = textObj.substring(i,i+1); 
		search = extraChar.indexOf(aChar); 
  		if(search == -1) {
			return false;
		} 
	}
	return true;
} 

//ÀÌ¹ÌÁöÆÄÀÏ¸¸ ¾÷·Îµå
extArray = new Array(".gif", ".jpg", ".png");
function LimitAttach(file) {
	allowSubmit = false;
	if (!file) return;
	while (file.indexOf("\\") != -1)
	file = file.slice(file.indexOf("") + 1);
	ext = file.slice(file.indexOf(".")).toLowerCase();
	for (var i = 0; i < extArray.length; i++) {
		if (extArray[i] == ext) { allowSubmit = true; break; }
	}
	if (!allowSubmit){
		return false;
	}
	else{
		return true;
	}
}

//¹®¼­ÆÄÀÏ¸¸ ¾÷·Îµå
extArray1 = new Array("pdf", "doc", "hwp", "zip");
function LimitAttach1(file) {
	allowSubmit = false;
	file.toLowerCase()
	if (!file) return;
	while (file.indexOf(".") != -1)
	file = file.slice(file.indexOf("") + 1);
	//È­ÀÏ¸í±¸ÇÒ¶§
	//while (file.indexOf("\\") != -1)
	//file = file.slice(file.indexOf("") + 1);
	for (var i = 0; i < extArray1.length; i++) {
		if (extArray1[i] == file.toLowerCase()) { allowSubmit = true; break; }
	}
	if (!allowSubmit){
		return false;
	}
	else{
		return true;
	}
}

//CSVÆÄÀÏ¸¸ ¾÷·Îµå
//extArray2 = new Array("xls", "csv");  //¿¢¼¿, CSVÆÄÀÏ¸¸ »ç¿ë°¡´É
extArray2 = new Array("csv");  //CSVÆÄÀÏ¸¸ »ç¿ë°¡´É
function LimitAttach2(file) {
	allowSubmit = false;
	file.toLowerCase()
	if (!file) return;
	while (file.indexOf(".") != -1)
	file = file.slice(file.indexOf("") + 1);
	//È­ÀÏ¸í±¸ÇÒ¶§
	//while (file.indexOf("\\") != -1)
	//file = file.slice(file.indexOf("") + 1);
	for (var i = 0; i < extArray2.length; i++) {
		if (extArray2[i] == file.toLowerCase()) { allowSubmit = true; break; }
	}
	if (!allowSubmit){
		return false;
	}
	else{
		return true;
	}
}


//ÀÇ½ÉÆÄÀÏ¾÷·Îµå ±ÝÁö
extArray3 = new Array("exe", "asp", "aspx", "ini", "com", "dll", "php", "jsp", "htm", "html");
function LimitAttach3(file) {
	allowSubmit = false;
	file.toLowerCase()
	if (!file) return;
	while (file.indexOf(".") != -1)
	file = file.slice(file.indexOf("") + 1);
	//È­ÀÏ¸í±¸ÇÒ¶§
	//while (file.indexOf("\\") != -1)
	//file = file.slice(file.indexOf("") + 1);
	for (var i = 0; i < extArray3.length; i++) {
		if (extArray3[i] == file.toLowerCase()) { allowSubmit = true; break; }
	}
	if (!allowSubmit){
		return false;
	}
	else{
		return true;
	}
}

//ExcelÆÄÀÏ¸¸ ¾÷·Îµå
extArray4 = new Array(".xls");  //¿¢¼¿, CSVÆÄÀÏ¸¸ »ç¿ë°¡´É
//extArray4 = new Array(".csv");  //CSVÆÄÀÏ¸¸ »ç¿ë°¡´É
function LimitAttach4(file) {
	allowSubmit = false;
	file.toLowerCase()
	if (!file) return;
	while (file.indexOf(".") != -1)
	file = file.slice(file.indexOf("") + 1);
	//È­ÀÏ¸í±¸ÇÒ¶§
	//while (file.indexOf("\\") != -1)
	//file = file.slice(file.indexOf("") + 1);
	for (var i = 0; i < extArray4.length; i++) {
		if (extArray4[i] == file.toLowerCase()) { allowSubmit = true; break; }
	}
	if (!allowSubmit){
		return false;
	}
	else{
		return true;
	}
}

//·Î±×ÀÎ½Ã ÀÔ·ÂÈ®ÀÎÃ³¸®
function check_index(that){
	if(!ValidLength(that.id.value,0) || that.id.value=='ID(email)'){
		return error(that.id, "¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	//if(!isEmail(that.id.value)){
	//	return error(that.id, "¿µ¹®ÀÚ¿Í ¼ýÀÚ, @, .¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
	//}
	//if ((that.id.value.indexOf("@")==-1)||(that.id.value.indexOf(".")==-1)){
	//	return error(that.id, "ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.  ");
	//}
	if(!ValidLength(that.pwd.value,0)){
		return error(that.pwd, "ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(that.pwd.value=='PASSWORD'){
		return error(that.pwd, "ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!isIntChar(that.pwd.value)){
		return error(that.pwd, "¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù.  ");
	}
	that.submit();
	return true;
}

//»ç¿ëÀÚ Á¤º¸¼öÁ¤Ã³¸®
function checkinfo(that){
	if(!ValidLength(that.iu_pwd.value,0)){
		return error(that.iu_pwd, "ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.iu_name.value,0)){
		return error(that.iu_name, "»ç¿ëÀÚ ¼º¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	that.submit();
	return true;
}

//¿ìÆí¹øÈ£Ã¢
function zipcode(){
	window.open('info_zip.asp','','width=450, height=180, left=300, top=300, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no, copyhistory=no')
}
		
function SetScrollPos(tagDIV, tagTable)
{
	var positionTop = 0;
	if (tagDIV != null)
	{
		positionTop = parseInt(tagDIV.scrollTop, 10);
		document.getElementById(tagTable).style.top = positionTop;
	}
}

function autocheck(chk){
	if (chk==true){
		if (confirm ("ÀÚµ¿·Î±×ÀÎ ±â´ÉÀ» »ç¿ëÇÏ½Ã°Ú½À´Ï±î?  \nº¸¾È»ó °³ÀÎPC¿¡¼­¸¸ »ç¿ëÇÏ¼¼¿ä.")){
			return true;
		}
		else {
			document.all["autochk"].checked=false
			return false;
			
		}
	}
}

//È¸¿ø°¡ÀÔÀÔ·ÂÈ®ÀÎ
function checkJoin(that){
	
	if (that.joinOk.checked==false){
		return error(that.joinOk, "¾à°ü¿¡ µ¿ÀÇÇÏ¼Å¾ß ÇÕ´Ï´Ù.  ");
	}
	if(!ValidLength(that.ID.value,0)){
		return error(that.ID, "¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(that.name.value.length<2){
		return error(that.name, "¼º¸íÀ» ¹Ù¸£°Ô ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.name.value,0)){
		return error(that.name, "¼º¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.nickname.value,0)){
		return error(that.nickname, "º°¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(that.iu_sex[0].checked == false && that.iu_sex[1].checked == false){
		return error(that.iu_sex, "¼ºº°À» ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.iu_area.value,0)){
		return error(that.iu_area, "°ÅÁÖÁö¿ªÀ» ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.iu_bir.value,0)){
		return error(that.iu_bir, "ÅÂ¾î³­ ÇØ¸¦ ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	//if(!IsZip(that.tel.value)){
	//	return error(that.searchID, "¼ýÀÚ, - ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.  ");
	//}
	that.submit();

	return true;

}

//È¸¿øÁ¤º¸¼öÁ¤È®ÀÎ
function checkUser(that){
	
	if(!isPwdChar(that.pwd.value)){
		return error(that.pwd, "ºñ¹Ð¹øÈ£´Â 8ÀÚ¸® ÀÌ»ó, ¿µ¹®ÀÚ¿Í ¼ýÀÚÀÇ È¥ÇÕÀ¸·Î ÀÌ·ç¾îÁ®¾ß ÇÕ´Ï´Ù.  ");
	}
	
	if(that.pwd.value!=that.repwd.value){
		alert("ºñ¹Ð¹øÈ£ ÀçÀÔ·ÂÀÌ Àß¸øµÆ½À´Ï´Ù.  ");
		that.pwd.value="";
		that.repwd.value="";
		that.pwd.focus(); 
		return false;
	}
	if(that.name.value.length<2){
		return error(that.name, "¼º¸íÀ» ¹Ù¸£°Ô ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.name.value,0)){
		return error(that.name, "¼º¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.nickname.value,0)){
		return error(that.nickname, "º°¸íÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(that.iu_sex[0].checked == false && that.iu_sex[1].checked == false){
		return error(that.iu_sex, "¼ºº°À» ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.iu_area.value,0)){
		return error(that.iu_area, "°ÅÁÖÁö¿ªÀ» ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.iu_bir.value,0)){
		return error(that.iu_bir, "ÅÂ¾î³­ ÇØ¸¦ ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	that.submit();

	return true;

}

//¾ÆÀÌµðÁßº¹È®ÀÎ
function checksearchid(that){
	//alert(that.searchID.value);
	if(!ValidLength(that.searchID.value,0)){
		return error(that.searchID, "¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!isEmail(that.searchID.value)){
		return error(that.searchID, "¿µ¹®ÀÚ¿Í ¼ýÀÚ, @, .¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.  ");
	}
	if ((that.searchID.value.indexOf("@")==-1)||(that.searchID.value.indexOf(".")==-1)){
		return error(that.searchID, "¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.  ");
	}
	
	that.submit();

	return true;

}

//¿ìÆí¹øÈ£Ã£±â
function checksearchzipcode(that){
	if(!ValidLength(that.dong.value,0))
		return error(that.dong, "À¾,¸é,µ¿ ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	that.submit();
	return true;
}

//ÆÐ½º¿öµå ÀÔ·ÂÈ®ÀÎ
function isPwdChar(textObj) { 
	var newLength = textObj.length;
	var extraChar = '\"1234567890\"';
	var search;
	var pwdokN=0;
	var pwdokC=0;
 
	if (newLength < 8) return false;
 
	for (var i = 0; i != newLength; i++) {
		aChar = textObj.substring(i,i+1); 
		search = extraChar.indexOf(aChar); 
  	if(search != -1) {
			pwdokN++;
		} 
	}
	//alert(pwdokN);
	extraChar = '\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"';
	i=0;
	for (var i = 0; i != newLength; i++) {
		aChar = textObj.substring(i,i+1); 
		search = extraChar.indexOf(aChar); 
  	if(search != -1) {
			pwdokC++;
		} 
	}
	//alert(pwdokC);
	if (!(pwdokN>0 && pwdokC>0)){
		return false;
	}
	return true;
} 

//ÆÐ½º¿öµå ÀÔ·Â È®ÀÎ
function checksearchpwd(that){
	if(!ValidLength(that.pwd.value,0))
		return error(that.pwd, "ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	that.submit();
	return true;
}

//¾ÆÀÌµð ÀÔ·Â È®ÀÎ
function checkid(that){
	if(!ValidLength(that.ID.value,0))
		return error(that.ID, "¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.  ");
	that.submit();
	return true;
}

//´Ð³×ÀÓ ÀÔ·Â È®ÀÎ
function checksearchNickname(that){
	if(!ValidLength(that.searchNickname.value,0))
		return error(that.searchNickname, "´Ð³×ÀÓÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	that.submit();
	return true;
}


//±âº»Çö±Ý
function checkMoney(that){
	
	if(!ValidLength(that.money.value,0)){
		return error(that.money, "±âº»Çö±ÝÀ» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	
	that.submit();

	return true;

}

//ÅëÀå
function checkBank(that){
	
	if(!ValidLength(that.bb_name.value,0)){
		return error(that.bb_name, "ÅëÀåÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	if(!ValidLength(that.su_money.value,0)){
		return error(that.su_money, "ÅëÀåÀÇ ±âº»±Ý¾×À» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	
	that.submit();

	return true;

}

//Ä«µå
function checkCard(that){
	
	if(!ValidLength(that.cc_name.value,0)){
		return error(that.cc_name, "Ä«µåÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.  ");
	}
	
	
	that.submit();

	return true;

}



//¸¶°¨ÀÏ
function checkClose(that){
	
	if(!ValidLength(that.close.value,0)){
		return error(that.close, "¸¶°¨ÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä.  ");
	}
	
	that.submit();

	return true;

}

//È¸¿ø Å»Åð½Ã Áú¹®
function userEnd(go){
	if (confirm ("Á¤¸» Å»ÅðÇÏ½Ã°Ú½À´Ï±î?\nÅ»Åð ÈÄ DATA¸¦ º¹±¸ÇÒ ¼ö ¾ø½À´Ï´Ù!!  ")){
		location.href=go;
	}
	else {
		location.href='./';
	}
}

//°¡°èºÎ ÃÊ±âÈ­½Ã Áú¹®
function SUreSet(go){
	if (confirm ("Á¤¸» °¡°èºÎ¸¦ ÃÊ±âÈ­ ÇÏ½Ã°Ú½À´Ï±î?\nÃÊ±âÈ­ ÈÄ ±âÁ¸DATA¸¦ º¹±¸ÇÒ ¼ö ¾ø½À´Ï´Ù!!  ")){
		location.href=go;
	}
	else {
		location.href='./my_set_reset.asp';
	}
}

function okshowWin(evt,fName,fWidth,fHeight,scrollYN){
	var offsetfromcursorX=0
	var offsetfromcursorY=0

	var offsetdivfrompointerX=0
	var offsetdivfrompointerY=0

	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["okshowWindow_ID"] : document.getElementById? document.getElementById("okshowWindow_ID") : ""
	if (ns6||ie){
		var tip="<iframe name='dal' marginheight='0' marginwidth='0'  border='0' frameborder='NO' framespacing='0' height='"+fHeight+"' width='"+fWidth+"' scrolling='"+scrollYN+"' src='"+fName+"'></iframe>"
		tipobj.innerHTML=tip
		enabletip=true
		if (enabletip){
		var nondefaultpos=false
		var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
		var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
		var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

		var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
		var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

		var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=curX-tipobj.offsetWidth+"px"
			nondefaultpos=true
		}
		else if (curX<leftedge)
			tipobj.style.left="5px"
		else{
			tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
		}

		if (bottomedge<tipobj.offsetHeight){
			tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
			nondefaultpos=true
		}
		else{
			tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
		}
		tipobj.style.visibility="visible"
	}
		return false
	}
}

function okshowWindow(evt,fName,fWidth,fHeight,scrollYN,okshowWindow_chk){
	var offsetfromcursorX=0
	var offsetfromcursorY=0

	var offsetdivfrompointerX=0
	var offsetdivfrompointerY=0

	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["okshowWindow_ID"] : document.getElementById? document.getElementById("okshowWindow_ID") : ""
	if (ns6||ie){
		var tip="<iframe name='dal' marginheight='0' marginwidth='0'  border='0' frameborder='NO' framespacing='0' height='"+fHeight+"' width='"+fWidth+"' scrolling='"+scrollYN+"' src='"+fName+"?chk="+okshowWindow_chk+"'></iframe>"
		tipobj.innerHTML=tip
		enabletip=true
		if (enabletip){
		var nondefaultpos=false
		var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
		var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
		var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

		var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
		var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

		var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=curX-tipobj.offsetWidth+"px"
			nondefaultpos=true
		}
		else if (curX<leftedge)
			tipobj.style.left="5px"
		else{
			tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
		}

		if (bottomedge<tipobj.offsetHeight){
			tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
			nondefaultpos=true
		}
		else{
			tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
		}
		tipobj.style.visibility="visible"
	}
		return false
	}
}

function okshowMove(evt,fName,fWidth,fHeight,scrollYN,okshowWindow_chk){
	var offsetfromcursorX=0
	var offsetfromcursorY=0

	var offsetdivfrompointerX=0
	var offsetdivfrompointerY=0

	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["okshowWindow_Move"] : document.getElementById? document.getElementById("okshowWindow_Move") : ""
	if (ns6||ie){
		enabletip=true
		if (enabletip){
		var nondefaultpos=false
		var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
		var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
		var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

		var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
		var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

		var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=curX-tipobj.offsetWidth+"px"
			nondefaultpos=true
		}
		else if (curX<leftedge)
			tipobj.style.left="5px"
		else{
			tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
		}

		if (bottomedge<tipobj.offsetHeight){
			tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
			nondefaultpos=true
		}
		else{
			tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
		}
		//tipobj.style.left="80px"
		//tipobj.style.top="250px"
		tipobj.style.visibility="visible"
	}
		return false
	}
}

function okshowCate(evt,fName,fWidth,fHeight,scrollYN,okshowWindow_chk01,okshowWindow_chk02){
	var offsetfromcursorX=0
	var offsetfromcursorY=0

	var offsetdivfrompointerX=0
	var offsetdivfrompointerY=0

	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["okshowWindow_ID"] : document.getElementById? document.getElementById("okshowWindow_ID") : ""
	if (ns6||ie){
		var tip="<iframe name='dal' marginheight='0' marginwidth='0'  border='0' frameborder='NO' framespacing='0' height='"+fHeight+"' width='"+fWidth+"' scrolling='"+scrollYN+"' src='"+fName+"?chk01="+okshowWindow_chk01+"&chk02="+okshowWindow_chk02+"'></iframe>"
		tipobj.innerHTML=tip
		enabletip=true
		if (enabletip){
		var nondefaultpos=false
		var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
		var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
		var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

		var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
		var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

		var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=curX-tipobj.offsetWidth+"px"
			nondefaultpos=true
		  
		}
		else if (curX<leftedge)
			tipobj.style.left="5px"
		else{
			tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
		}
		//¹«Á¶°Ç ¾Æ·¡ÂÊÀ¸·Î ÆîÃÄÁöµµ·Ï ÇÔ.
		if (bottomedge<tipobj.offsetHeight){
			//alert("wow")
			//tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
			tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
			nondefaultpos=true
		}
		else{
			tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
		}
		tipobj.style.visibility="visible"
	}
		return false
	}
}

function okshowDal(evt,a1){
	var offsetfromcursorX=0
	var offsetfromcursorY=0

	var offsetdivfrompointerX=0
	var offsetdivfrompointerY=0

	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["okshowWindow_ID"] : document.getElementById? document.getElementById("okshowWindow_ID") : ""
	if (ns6||ie){
		var tip="<iframe name='dal' marginheight='0' marginwidth='0'  border='0' frameborder='NO' framespacing='0' height='125' width='120' scrolling='no' src='dal.asp?chk="+a1+"'></iframe>"
		tipobj.innerHTML=tip
		enabletip=true
		if (enabletip){
		var nondefaultpos=false
		var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
		var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
		var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

		var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
		var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

		var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=curX-tipobj.offsetWidth+"px"
			nondefaultpos=true
		}
		else if (curX<leftedge)
			tipobj.style.left="5px"
		else{
			tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
		}

		if (bottomedge<tipobj.offsetHeight){
			tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
			nondefaultpos=true
		}
		else{
			tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
		}
		tipobj.style.visibility="visible"
	}
		return false
	}
}

function okshowReport01(evt,fName,fWidth,fHeight,scrollYN,okshowWindow_sd,okshowWindow_ed,okshowWindow_c02idx){
	var offsetfromcursorX=0
	var offsetfromcursorY=0

	var offsetdivfrompointerX=0
	var offsetdivfrompointerY=0

	var ie=document.all
	var ns6=document.getElementById && !document.all
	var enabletip=false
	if (ie||ns6)
	var tipobj=document.all? document.all["okshowWindow_ID"] : document.getElementById? document.getElementById("okshowWindow_ID") : ""
	if (ns6||ie){
		var tip="<iframe name='dal' marginheight='0' marginwidth='0'  border='0' frameborder='NO' framespacing='0' height='"+fHeight+"' width='"+fWidth+"' scrolling='"+scrollYN+"' src='"+fName+"?sd="+okshowWindow_sd+"&ed="+okshowWindow_ed+"&c02_idx="+okshowWindow_c02idx+"'></iframe>"
		tipobj.innerHTML=tip
		enabletip=true
		if (enabletip){
		var nondefaultpos=false
		var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
		var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
		var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

		var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
		var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

		var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-1) : -1000

		if (rightedge<tipobj.offsetWidth){
			tipobj.style.left=curX-tipobj.offsetWidth+"px"
			nondefaultpos=true
		  
		}
		else if (curX<leftedge)
			tipobj.style.left="5px"
		else{
			tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px"
		}
		//¹«Á¶°Ç ¾Æ·¡ÂÊÀ¸·Î ÆîÃÄÁöµµ·Ï ÇÔ.
		if (bottomedge<tipobj.offsetHeight){
			//alert("wow")
			//tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
			tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
			nondefaultpos=true
		}
		else{
			tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
		}
		tipobj.style.visibility="visible"
	}
		return false
	}
}

function textCounter(theField,theCharCounter,maxChars)
{
	var strCharCounter = 0;
	var intLength = theField.value.length;

	for (var i = 0; i < intLength; i++)
	{
		var charCode = theField.value.charCodeAt(i);
		//ÇÑ±ÛÀÏ °æ¿ì
		if (charCode > 128){
			strCharCounter += 2;
		} 
		else{
			strCharCounter++;
		}

		if(strCharCounter < (maxChars+1)) {
			//ÀÛ¼º¹®ÀÚ¼ö Ä«¿îÆ®, ÇÊ¿äÇÒ¶§¸¸ »ç¿ë
			//theCharCounter.value = strCharCounter;
		} 
		else {
			eval("alert('ÇÑ±Û" + maxChars/2 + ", ¿µ¹®" + maxChars+ "ÀÚ Á¦ÇÑÀÔ´Ï´Ù. ÃÊ°úµÈ ¹®ÀÚ´Â Àß¸³´Ï´Ù.')");
			if(!cutStr(theField, i, theCharCounter, maxChars)) {
							alert("¹®ÀÚ¿­ Ä¿Æ® ÇÔ¼ö°¡ ÀÛµ¿µÇÁö ¾Ê½À´Ï´Ù.");
			}
			break;
		}
	}
}

function cutStr(theField, i, theCharCounter, maxChars)
{
	var intLength = theField.value.length;        //-- ½ÇÁ¦ ¹®ÀÚÀÇ ±æÀÌ¸¦ ±¸ÇÑ´Ù.

	var strChar = theField.value.substring(0,i);                //¸¶Áö¸· ¹®ÀÚ¸¦ Àß¶ó³½´Ù.
	
	theField.value = strChar;
	textCounter(theField,theCharCounter,maxChars);
	return true;
}

function ViewCate(that){
	if (that=="title"){
		for(x=0;x<cview.length;x++){
			cview[x].style.display="none"
		}
	}
	else{
		if (cview[that].style.display=="none"){
			for(x=0;x<cview.length;x++){
				cview[x].style.display="none"
			}
			cview[that].style.display=""
		}
		else{
			cview[that].style.display="none"
		}
	}
}

//ÀÇ½ÉÆÄÀÏ¾÷·Îµå ±ÝÁö
extArray3 = new Array("exe", "asp", "aspx", "ini", "com", "dll", "php", "jsp", "htm", "html", "msi", "xml");
function LimitAttach3(file) {
	allowSubmit = false;
	file.toLowerCase()
	if (!file) return;
	while (file.indexOf(".") != -1)
	file = file.slice(file.indexOf("") + 1);
	//È­ÀÏ¸í±¸ÇÒ¶§
	//while (file.indexOf("\\") != -1)
	//file = file.slice(file.indexOf("") + 1);
	for (var i = 0; i < extArray3.length; i++) {
		if (extArray3[i] == file.toLowerCase()) { allowSubmit = true; break; }
	}
	if (!allowSubmit){
		return false;
	}
	else{
		return true;
	}
}

function checkBbs(that){
	if(LimitAttach3(that.bbs_file.value,0)){
		return error(that.bbs_file, "¾÷·Îµå°¡ ±ÝÁöµÈ ÆÄÀÏÁ¾·ùÀÔ´Ï´Ù.");
	}
	if(!ValidLength(that.bbs_title.value,0)){
		return error(that.bbs_title, "Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	if(!ValidLength(that.bbs_content.value,0)){
		return error(that.bbs_content, "³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	strAppVersion = navigator.appVersion; 
	if (that.bbs_file.value != "") {
		if (strAppVersion.indexOf('MSIE')!=-1 && 
				strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { 

				winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
				window.showModelessDialog("show_progress.asp?nav=ie", null, winstyle); 
		} 
		else { 
				winpos = "left=" + ((window.screen.width-380)/2)+",top=" +
						 ((window.screen.height-110)/2); 
				winstyle = "width=380,height=110,status=no,toolbar=no,menubar=no," + 
						 "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos; 
				window.open("show_progress.asp",null,winstyle); 
		} 
	}
	that.submit();
	return true;
}

function checktoadmin(that){
	if(!ValidLength(that.name.value,0)){
		return error(that.name, "ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	if(LimitAttach3(that.bbs_file.value,0)){
		return error(that.bbs_file, "¾÷·Îµå°¡ ±ÝÁöµÈ ÆÄÀÏÁ¾·ùÀÔ´Ï´Ù.");
	}
	if(!ValidLength(that.bbs_title.value,0)){
		return error(that.bbs_title, "Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	if(!ValidLength(that.bbs_content.value,0)){
		return error(that.bbs_content, "³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	strAppVersion = navigator.appVersion; 
	if (that.bbs_file.value != "") {
		if (strAppVersion.indexOf('MSIE')!=-1 && 
				strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { 

				winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
				window.showModelessDialog("show_progress.asp?nav=ie", null, winstyle); 
		} 
		else { 
				winpos = "left=" + ((window.screen.width-380)/2)+",top=" +
						 ((window.screen.height-110)/2); 
				winstyle = "width=380,height=110,status=no,toolbar=no,menubar=no," + 
						 "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos; 
				window.open("show_progress.asp",null,winstyle); 
		} 
	}
	that.submit();
	return true;
}

//¿À´ÃÀÇ ÆÄÀÏ ¾÷·Îµå
function checksufile(that){
	if(!ValidLength(that.bbs_file.value,0)){
		return error(that.bbs_file, "ÆÄÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä.");
	}
	if(LimitAttach3(that.bbs_file.value,0)){
		return error(that.bbs_file, "¾÷·Îµå°¡ ±ÝÁöµÈ ÆÄÀÏÁ¾·ùÀÔ´Ï´Ù.");
	}
	strAppVersion = navigator.appVersion; 
	if (that.bbs_file.value != "") {
		if (strAppVersion.indexOf('MSIE')!=-1 && 
				strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4) { 

				winstyle = "dialogWidth=385px; dialogHeight:150px; center:yes"; 
				window.showModelessDialog("show_progress.asp?nav=ie", null, winstyle); 
		} 
		else { 
				winpos = "left=" + ((window.screen.width-380)/2)+",top=" +
						 ((window.screen.height-110)/2); 
				winstyle = "width=380,height=110,status=no,toolbar=no,menubar=no," + 
						 "location=no,resizable=no,scrollbars=no,copyhistory=no," + winpos; 
				window.open("show_progress.asp",null,winstyle); 
		} 
	}
	that.submit();
	return true;
}

function checkRe(that){
	
	if(!ValidLength(that.re_content.value,0)){
		return error(that.re_content, "´ñ±Û ³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	that.submit();
	return true;
}

//ÀÌ¹ÌÁö Å«Ã¢À¸·Îº¸±â 
function imgResize(img){ 
  img1= new Image(); 
  img1.src=(img); 
  imgControll(img); 
} 
function imgControll(img){ 
  if((img1.width!=0)&&(img1.height!=0)){ 
    viewImage(img); 
  } 
  else{ 
    controller="imgControll('"+img+"')"; 
    intervalID=setTimeout(controller,20); 
  } 
} 

function viewImage(img){ 
	W1=img1.width*1;
	H1=img1.height*1;
	//alert(W1 + "*" + H1)
	
	if (W1<=980 && H1<=700){
		W=W1; 
		H=H1;
	}
	else if (W1<=980 && H1>700){
		W=W1+18; 
		H=700;
	}
	else if (W1>980 && H1>700){
		W=980+18; 
		H=700+30;
	}
	else if (W1>980 && H1<=700){
		W=980; 
		H=H1+30;
	}
		
	O="width="+W+",height="+H+", top=0, left=0, scrollbars=yes, resizable=yes"; 
	imgWin=window.open("","",O); 
	imgWin.document.write("<html><head><title>Å« ÀÌ¹ÌÁö º¸±â</title></head>"); 
	imgWin.document.write("<meta http-equiv='Content-Type' content='text/html; charset=euc-kr'>");
	imgWin.document.write("<META HTTP-EQUIV='MSThemeCompatible' Content='No'>");
	imgWin.document.write("<META HTTP-EQUIV='imagetoolbar' CONTENT='no'>");
	imgWin.document.write("<body topmargin='0' leftmargin='0'>"); 
	//imgWin.document.write("<table cellpadding='0' cellspacing='0' border='0' width='"+tw+"'  height='"+th+"' align='center'><tr><td align='center' valign='middle' width='"+tw+"'>");
	imgWin.document.write("<img src='"+img+"' onclick='self.close()' style='cursor:hand;BORDER: #6C6C6C 0px solid;' alt='Å¬¸¯ÇÏ¸é ´ÝÈü´Ï´Ù.'>"); 
	imgWin.document.write("</body>"); 
	//imgWin.document.write("</td></tr></table>");
	imgWin.document.close(); 
} 

function addbookmark(){
	bookmarkurl="http://www.saveup.co.kr/" // Áñ°ÜÃ£±â¿¡ Ãß°¡ÇÒ °÷ ÀÇ URL
	bookmarktitle="¡ÝÀúÃàµµ¿ì¹Ì ¡¼S¡¤A¡¤V¡¤E U¡¤P¡½" // »çÀÌÆ®¸í
	if (document.all)
	window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
