<!--Áñ°ÜÃ£±â ½ºÅ©¸³Æ®
function bookmark(){
window.external.AddFavorite('http://www.wooricu.com', ':::¿ì¸®Ã¢¾÷:::');
}
//½ºÅ©¸³Æ® ³¡-->

//smsº¸³»±â
function send_sms(is_callback,is_msg,is_aNumber){
	var str;
	var is_phone;
	var obj,strPara;
	var chkStr,chkRe;
	
	//iframe »ý¼º
	obj						=  document.createElement("iframe");
	obj.id					= "tempframe";
	obj.style.border		= "0px;";
	obj.style.hspace		= "0px"; 
	obj.style.vspace		= "0px"; 
	obj.style.width			= "0px"; 
	obj.style.height		= "0px";
	obj.style.frameborder	= "0px";
	obj.style.scrolling		= "no"; 
	document.body.appendChild(obj);

	//ÀüÈ­¹øÈ£ Ã¼Å©
	chkRe	= 0;
	chkStr	= "0123456789-";
	
	for(var i = 0; i < is_callback.length; i++){
		str = chkStr.indexOf(is_callback.charAt(i));
		if (str > -1){
			chkRe += 1;
		}
	}

	if((is_callback == "") || (is_callback.length < 9)){
		alert("¿¬¶ô¹ÞÀ¸½Ç ÀüÈ­¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ¼¼¿ä(¼ýÀÚ ¿Í - ¸¸Çã¿ë)");
		return;
	}

	if(is_callback.length != chkRe){
		alert("¿¬¶ô¹ÞÀ¸½Ç ÀüÈ­¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ¼¼¿ä(¼ýÀÚ ¿Í - ¸¸Çã¿ë)");
		return;
	}		

	if(document.getElementById("tr_phone") != null){
		is_phone = 	document.getElementById("tr_phone").value;
	}else{
		is_phone = "";
	}
	strPara = "/sms/sms_proc.asp";
	strPara += "?tr_callback="	+ is_callback;
	strPara += "&tr_phone="		+ is_phone;
	strPara += "&tr_msg="		+ is_msg;
	strPara += "&md_aNumber="	+ is_aNumber;
	obj.src = strPara;
}

//¿ÀÇÂÆË¾÷
function openPopup(url,popName,wLen,hLen){
	if(window.screen){
		var objPopup;	
		var screenWidth		= window.screen.width;
		var screenHeight	= window.screen.height;
		if(hLen > screenHeight){
			var propertys = "width="+ wLen +",height="+ hLen +",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,channelmode=no";
		}else{
			if(screenWidth < 650){
				var propertys = "width="+ wLen +",height="+ hLen +",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,channelmode=no";
			}else{
				var propertys = "width="+ wLen +",height="+ hLen +",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,channelmode=no";
			}
		}
	}
	objPopup			= window.open(url,popName,propertys);
	objPopup.focus();
}

//¿ÀÇÂÆË¾÷
function openPopup2(url,popName,wLen,hLen){
	var propertys = "width="+ wLen +",height="+ hLen +",toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,channelmode=no";
	var objPopup	= window.open(url,popName,propertys);
	objPopup.focus();
}

//ÀÎÄÚµù
function encode(){ 
  if(document.XSS.ascii.value != ''){ 
    var vText = document.XSS.ascii.value; 
    document.XSS.hex.value = convertToHex(vText); 
    document.XSS.hexhtml.value = convertToHexHTML(vText); 
    var vEncoded = convertToUnicode(vText); 
    document.XSS.unicode.value = vEncoded; 
    document.XSS.ascii.focus();
    document.XSS.ascii.blur();
    document.XSS.ascii.select();
    document.XSS.base64.value=encodeBase64(document.XSS.ascii.value);
  } 
} 

//ÁÂ¿ì°ø¹éÁ¦°Å
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/g, "");
}

//Ã¢´Ý±â
function selfClose(){
	self.close();
}


function nothing(){

}


//µÚ·Î°¡±â ¸·±â ex)window.document.onkeydown = check_backSpace;
function check_backSpace(events){
	if(event.keyCode == "8"){
			history.back(-2);
	}	
}

// openwindow
function OpenWindow(url,intWidth,intHeight,intScroll) { 
    window.open(url, "_blank", "width="+intWidth+",height="+intHeight+",resizable=0,scrollbars="+intScroll) ;
}

//LEFT ÇÔ¼ö 
function left(val,num)
{
b=val+"c";
c=b.length;
d=b.substr(0,c-1);
ans=d.slice(0,num) 
return ans;
}


//°ª µî·Ï¿©ºÎ È®ÀÎ
function check_value(obj,msg){
	if(obj.value == ""){
		alert(msg);
		obj.value = obj.value.trim();
		obj.focus();
		return false;
	}
}

//°ø¹éÃ¼Å©(space)
function check_space(str){
	if(str.search(/\s/) != -1){
		return 1;
	}else{
		return "";
	}
}

//ÀÔ·Â ÀÚµ¿ ÀÚ¸®ÀÌµ¿
function autoSelect(thisObj,len,obj){
	if(thisObj.value.length == len)
	{
		obj.focus();
	}
}

//Select Box Ã¼Å©ÇÏ±â
function selected_selectbox(obj,str){	
	for (var i = 0 ; i < obj.options.length ; i++ ){
		if (obj.options[i].value == str){			
			obj.options[i].selected = true;
		}
	}
	
}


//Radio Åä±Û±â´É
function goChecked(obj) { vChecked = (obj.checked)? true : false; }
function goToggle(obj)  { obj.checked = (vChecked)? false : true; }

//Radio Or Checkbox Ã¤Å©¿©ºÎ
function check_radioQuestion(Obj){
	var returnchk;
	if(Obj.length == null){
		//´ÜÀÏ ÇüÅÂ
		return Obj.checked;
	}else{
		//´ÙÁß ÇüÅÂ
		returnchk = false;
		for(i=0;Obj.length > i;i++){
			if(Obj[i].checked == true)
			{
				returnchk = true;
			}
		}
		return returnchk;
	}
}

//Radio Or Checkbox ¸ðµÎÃ¼Å© OR ¸ðµÎÇØÁ¦
function checked_allRadio(checkObj,obj){
	if(obj.length == null){
		//´ÜÀÏ ÇüÅÂ
		if(obj.checked == true){
			obj.checked = false;
		}else{
			obj.checked = true;	
		}
		
	}else{
		//´ÙÁß ÇüÅÂ
		for(i=0;obj.length > i;i++){
			obj[i].checked = checkObj.checked == true ? true : false;
		}		
	}	
}


//¸¶¿ì½º ¿À¸¥ÂÊ¹öÆ® »ç¿ë¸øÇÏ±â
function mousechk(){
 if(event.button==2) {
	alert('¿À¸¥ÂÊ¹öÆ°Àº »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù.');
	return;
 }
}

//¼Ò¼öÁ¡ ¹Ý¿Ã¸²
function numberRound(val, precision){
 var p = Math.pow(10, precision);
 return Math.round(val * p) / p;
}



//¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
function onlyNumber(){
 var kc = event.keyCode;
 if(kc.shiftKey || (kc < 48 || kc > 57) && (kc < 96 || kc > 105) && (kc != 8 && kc != 9) && (kc != 37 && kc != 39) && (kc != 46 && kc != 13)){
  alert('¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.');
  //event.srcElement.value = event.srcElement.value.substring(0,event.srcElement.value.length -1)
  event.returnValue=false;
 }
}

//¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â2
function onlyNumber2(obj){
	if(isNaN(obj.value)){
		alert('¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.');
		//obj.value= "";
		obj.focus();
		return false;
	}
}

//¼ýÀÚ ¹× À½¼ö
function onlyNumber3(obj){
 var kc = event.keyCode;
 if(kc.shiftKey || (kc < 48 || kc > 57) && (kc < 96 || kc > 105) && (kc != 8 && kc != 9) && (kc != 37 && kc != 39) && (kc != 46 && kc != 13) && (kc != 109 && kc != 189)){
	 alert('¼ýÀÚ¸¸(À½¼ö°¡´É) ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.');	
	 event.returnValue=false;
 }
}

//ÀüÈ­¹øÈ£ Ã¼Å©
function telephonchk(strNumb,obj,msg){
	if(strNumb.length == 0){
		alert(msg +'¸¦ ÀÔ·ÂÇÏ¼¼¿ä.');
		obj.focus();
		return false;
	}
	if(strNumb.length < 10){
			alert(msg +'¸¦ Á¤È®È÷ ÀÔ·ÂÇÏ¼¼¿ä.');
			//obj.focus();
		return false;
	}
}

//ÀüÈ­¹øÈ£ Ã¼Å©[1]
function check_TelePhon(obj1,obj2,obj3,msg){

	if((obj1.value != "") || (obj2.value != "") || (obj3.value != ""))	{
		if(obj1.value.length < 2){
			alert(msg);
			obj1.focus();
			return false;
		}
		if(obj2.value.length < 3){
			alert(msg);
			obj2.focus();
			return false;
		}
		if(obj3.value.length < 4){
			alert(msg);
			obj3.focus();
			return false;
		}
	}

}

//ÀüÈ­¹øÈ£ Ã¼Å©[2]
function check_TelePhon2(obj1,obj2,obj3,msg){

	if(obj1.value.length < 2){
		alert(msg);
		obj1.focus();
		return false;
	}
	if(obj2.value.length < 3){
		alert(msg);
		obj2.focus();
		return false;
	}
	if(obj3.value.length < 4){
		alert(msg);
		obj3.focus();
		return false;
	}

}

//ID Ã¼Å©
function check_validID(str){
	if( str == ""){
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		return false;
	}
	var retVal = check_space(str);

	if(retVal != ""){
		alert("¾ÆÀÌµð´Â ºó °ø°£ ¾øÀÌ ¿¬¼ÓµÈ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return false;
	}
	if( str.charAt(0) == '_'){
		alert("¾ÆÀÌµðÀÇ Ã¹¹®ÀÚ´Â '_'·Î ½ÃÀÛÇÒ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}

	 /* checkFormat  */
	var isID = /^[a-z0-9_]{4,20}$/;
	if( !isID.test(str)){
		alert("¾ÆÀÌµð´Â 4~20ÀÚÀÇ ¿µ¹® ¼Ò¹®ÀÚ¿Í ¼ýÀÚ,Æ¯¼ö±âÈ£(_)¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		return false;
	}
	//var numlen = id_str.match(/[0-9]+/g).join("").length;
	var numlen=0;
	for( i=0 ; i<str.length ; i++ )	{
		if (str.charAt(i) >= '0' && str.charAt(i) <= '9')
		{
			numlen++;
		}
	}

	if ( numlen > 7 ){
		 alert("¼ýÀÚ´Â ÃÖ´ë 7ÀÚ±îÁö¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		 return false;
	}
	return true;
}

//ºñ¹Ð¹øÈ£ Ã¼Å©
function check_pw(obj){
	//ºñ¹Ð¹øÈ£ Ã¼Å© ¿µ¹®,¼ýÀÚ¸¸Çã¿ë	
	var numlen=0;
	var StrObj = (obj);	
	var fmtSecret = /^[a-z0-9]{6,12}$/;
	var retVal = check_space(obj.value);
	if(StrObj.value == ""){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		StrObj.focus();
		return false;
	}
	if(retVal != ""){
		alert("ºñ¹Ð¹øÈ£´Â ºó °ø°£ ¾øÀÌ ¿¬¼ÓµÈ ¿µ¹®(6~12ÀÚ) ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		StrObj.focus();
		return false;
	}
	if(StrObj.value.length < 6){
		alert("ºñ¹Ð¹øÈ£´Â 6±ÛÀÚ ÀÌ»ó¸¸ °¡´ÉÇÕ´Ï´Ù.");
		StrObj.focus();
		return false;
	}
	if (!fmtSecret.test(StrObj.value)) {
		alert ("ºñ¹Ð¹øÈ£´Â ºó °ø°£ ¾øÀÌ ¿¬¼ÓµÈ ¿µ¹®(6~12ÀÚ) ¼Ò¹®ÀÚ¿Í ¼ýÀÚ¸¸ »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.");
		obj.value=""
		obj.focus();
		return false;
	}
}

//ºñ¹Ð¹øÈ£ ÀçÀÔ·Â Ã¼Å©
function check_rePw(obj1,obj2){
	
	if(obj2.value == ""){
		alert('ºñ¹Ð¹øÈ£ È®ÀÎÀ» ÀÔ·ÂÇÏ¼¼¿ä.');
		return false;
	}

	if(obj1.value != obj2.value){
		alert('ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.');
		return false;
	}
}


//ÇÑ±Û¸¸ ÀÔ·Â
function hangul(){
 if((event.keyCode < 12592) || (event.keyCode > 12687)){	
		alert("ÇÑ±Û¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
		event.returnValue = false;
	}
}

//¿µ¹®/¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
function chkHangul(form,name,msg){
	var f,v;
	var item1,item2;
	f=form.name=name;
	v=f.value;
	item1=v.length;
	item2=escape(v).length;
	if(!(item1==item2)){
		alert(msg);
		f.value="";
		f.focus();
		return false
	}
}

//¼ýÀÚ ÀÚµ¿ÀÚ¸®¼ö Ã¼¿ì±â
function number_format(obj){
	str = obj.value;
	str	=str.replace(/,/gi,"");
	var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');  

	while(objRegExp.test(str)){
		str = str.replace(objRegExp, '$1,$2'); 
	}
	obj.value = str;
}

//ÀÌ¸ÞÀÏ Ã¼Å©
function check_email(obj){
	var filter=re=/^[0-9a-z]([-_\.]?[0-9a-z])*@[0-9a-z]([-_\.]?[0-9a-z])*\.[a-z]{2,3}$/i; ;
	var str = obj.value
	if(str == ""){
		alert("ÀÌ¸ÞÀÏÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.focus();
		return false;
	}
	if (filter.test(str)){
		return true;
	}else{
		alert("À¯È¿ÇÑ ÀÌ¸ÞÀÏ ÁÖ¼Ò°¡ ¾Æ´Õ´Ï´Ù");
		obj.focus();
		return false;
	}
}

//ÁÖ¹Î¹øÈ£ Ã¼Å©
function check_jumin(jumin1,jumin2){	
	var jumin_ch = "234567892345";
	var tot_jumin =jumin1.value + jumin2.value;
	var tot_id = 0;
	if(jumin1.value == ""){
		alert("ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		jumin1.focus();
		return false;
	}

	if(jumin2.value == ""){
		alert("ÁÖ¹Î¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
		jumin2.focus();
		return false;
	}

	if(tot_jumin.length < 13){
		alert("À¯È¿ÇÏÁö ¾Ê´Â ÁÖ¹Îµî·Ï ¹øÈ£ÀÔ´Ï´Ù.");
		jumin1.focus();
		return false;
	}
	for(var i = 0;i < 12; i++){
		var ch1=jumin_ch.substring(i,i+1);
		var ch2=tot_jumin.substring(i,i+1);
		tot_id = tot_id + ch1 * ch2;
	}

	var check_field = (11 - (tot_id % 11)) % 10;
	if (check_field != tot_jumin.substring(12,13)){
		alert("ÁÖ¹Îµî·Ï ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
		jumin1.value="";
		jumin2.value="";
		jumin1.focus();
		return false;
	} else if (tot_jumin.substring(6,7) > 2 ||  tot_jumin.substring(6,7) < 1){
		alert("ÁÖ¹Îµî·Ï ¹øÈ£°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù.");
		jumin1.focus(); 
		return false;
	}
}

//¿Ü±¹ÀÎ¹øÈ£ Ã¼Å©
function isValid_fgnno(socno)
{
	var total =0;
	var parity = 0;

	var fgnNo = new Array(13);

	for(i=0;i < 13;i++) fgnNo[i] = parseInt(socno.charAt(i));

	if(fgnNo[11] < 6) return false;

	if((parity = fgnNo[7]*10 + fgnNo[8])&1) return false;


	var weight = 2;

	for(i=0,total=0;i < 12;i++)
	{
		var sum = fgnNo[i] * weight;
		total += sum;

		if(++weight > 9) weight=2;
	}

	if((total = 11 - (total%11)) >= 10) total -= 10;
	if((total += 2) >= 10) total -= 10;
	if(total != fgnNo[12]) return false;

	return true;
}
//»ç¾÷ÀÚ¹øÈ£ Ã¼Å©
function chkWorkNumb(strNumb,obj){
	if(strNumb.length == 0){
			alert("»ç¾÷ÀÚµî·Ï¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä");
			obj.focus();
			return false;
	}
	if(strNumb.length != 10){
			alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù.");
			obj.focus();
			return false;
	}	
	sumMod=        0;
	sumMod+=parseInt(strNumb.substring(0,1));
	sumMod+=parseInt(strNumb.substring(1,2))*3%10;
	sumMod+=parseInt(strNumb.substring(2,3))*7%10;
	sumMod+=parseInt(strNumb.substring(3,4))*1%10;
	sumMod+=parseInt(strNumb.substring(4,5))*3%10;
	sumMod+=parseInt(strNumb.substring(5,6))*7%10;
	sumMod+=parseInt(strNumb.substring(6,7))*1%10;
	sumMod+=parseInt(strNumb.substring(7,8))*3%10;
	sumMod+=Math.floor(parseInt(strNumb.substring(8,9)) * 5 / 10);
	sumMod+=parseInt(strNumb.substring(8,9)) * 5 % 10;
	sumMod+=parseInt(strNumb.substring(9,10));
	if(sumMod%10 != 0){
			alert("»ç¾÷ÀÚµî·Ï¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù.");
			obj.focus();
			return false;
	}
	return true;
}
//Æû°ª´õÇÏ±â
function input_sumNumber(){
	var returnValue = 0;

	for(var i =0; i< input_sumNumber.arguments.length;i++){
		if(input_sumNumber.arguments[i] != null){
			if(isNaN(input_sumNumber.arguments[i].value) == false && input_sumNumber.arguments[i].value != "" ){
				returnValue = returnValue + parseInt(input_sumNumber.arguments[i].value);
			}
		}
	}
	return returnValue;
}

//ÃÖ¼Ò±ÛÀÚ Á¦ÇÑ 
function input_length1(values,type){
	var str = values;
	for(var i=0;i < str.length;i++){ 
		if(str.charCodeAt(i) <= 127) {
			if(type == "1"){
				input_str_length1 = input_str_length1 + 1
			}else{
				input_str_length2 = input_str_length2 + 1
			}
		}else{
			if(type == "1"){
				input_str_length1 = input_str_length1 + 2
			}else{
				input_str_length2 = input_str_length2 + 2
			}
		}
	}
}

//Textare ±ÛÀÚ¼ö Á¦ÇÑ
function fc_chk_byte(aro_name,ari_max){
   // º¯¼öÃÊ±âÈ­
   var ls_str = aro_name.value;						// ÀÌº¥Æ®°¡ ÀÏ¾î³­ ÄÁÆ®·ÑÀÇ value °ª
   var li_str_len = ls_str.length;					// ÀüÃ¼±æÀÌ
   var li_len  = 0;									// substringÇÏ±â À§ÇØ¼­ »ç¿ë
   var ls_str2 = "";								// ±ÛÀÚ¼ö¸¦ ÃÊ°úÇÏ¸é Á¦ÇÑÇÒ¼ö ±ÛÀÚÀü±îÁö¸¸ º¸¿©ÁØ´Ù.
   var li_max = ari_max;							// Á¦ÇÑÇÒ ±ÛÀÚ¼ö Å©±â
   var li_byte  = 0;								// ÇÑ±ÛÀÏ°æ¿ì´Â 2 ±×¹Ü¿¡´Â 1À» ´õÇÔ
   var ls_one_char = "";							// ÇÑ±ÛÀÚ¾¿ °Ë»çÇÑ´Ù
   
   for(var i=0; i< li_str_len; i++){				// ÇÑ±ÛÀÚÃßÃâ
      ls_one_char = ls_str.charAt(i);
      if (escape(ls_one_char).length > 4){			// ÇÑ±ÛÀÌ¸é 2¸¦ ´õÇÑ´Ù.
         li_byte += 2;
      } else{										// ±×¹ÜÀÇ °æ¿ì´Â 1À» ´õÇÑ´Ù.
         li_byte++;
      }
      if(li_byte <= li_max){						
		  // ÀüÃ¼ Å©±â°¡ li_max¸¦ ³ÑÁö¾ÊÀ¸¸é
         li_len = i + 1;
      }
   }
   // ÀüÃ¼±æÀÌ¸¦ ÃÊ°úÇÏ¸é
   if(li_byte > li_max){
      alert( li_max + " ±ÛÀÚ¸¦ ÃÊ°ú ÀÔ·ÂÇÒ¼ö ¾ø½À´Ï´Ù. \n ÃÊ°úµÈ ³»¿ëÀº ÀÚµ¿À¸·Î »èÁ¦ µË´Ï´Ù. ");
      ls_str2 = ls_str.substr(0, li_len);
      aro_name.value = ls_str2;
   }
   aro_name.focus();   
}

//¼Ò¼öÁ¡ ÀÚ¸®Ã¼Å©
function numbercheck(obj,msg){
	var chkData		=obj.value
	var regExp		=/(\b\d+\.\d{1}\b|^\d+$)/;
	if(chkData != "" && chkData != null)	{
		if(!regExp.test(chkData))	{
			alert("¹®ÀÚÀÔ·ÂÀÌ³ª Æ¯¼ö¹®ÀÚ ÀÔ·ÂÀº ºÒ°¡ÀÔ´Ï´Ù\n\n¼ýÀÚ³ª ¼Ò¼öÁ¡À» È®ÀÎÇÏ¼¼¿ä\n\n¼Ò¼öÁ¡Àº 1ÀÚ¸®±îÁö Çã¿ëÇÕ´Ï´Ù");
			obj.focus();
			return 1;
		}
	}else{
		alert(msg);
		obj.focus();
		return 1;
	}
}

//ÆÄÀÏ¿©ºÎ°Ë»ç
function check_file(checkFileName){
	var nameAllay = checkFileName.split(".");
	if(nameAllay.length < 2 ){
	return false;
	}
}

//ÆÄÀÏ È®ÀåÀÚ °Ë»ç
function check_fileName(checkFileName,checkList){
	var nameAllay;
	var checkList;
	var checkAllay;
	var commitcheckFileName = "";
	nameAllay	= checkFileName.split(".");
	lastName	= nameAllay[1];

	checkAllay	= checkList.split(",");
	for(i=0;checkAllay.length > i;i++)	{
		if(checkAllay[i].toLowerCase() == lastName.toLowerCase() ){
			commitcheckFileName = "ok";
		}
	}
	if(commitcheckFileName != "ok"){
		alert("ÆÄÀÏÀÇ È®ÀåÀÚ°¡ ("+ checkList +") ¸¸ °¡´ÉÇÕ´Ï´Ù.");
		commitcheckFileName = ""
		return false;
	}
}

//·¹ÀÌ¾î Viewer
function show_divView(cnt,num,LayerID){

	if(cnt != "x"){
		for (var i=0; i<=cnt; i++) {
			if (i == num){
				if (document.getElementById(LayerID+i).style.display == "none"){
					document.getElementById(LayerID+i).style.display = "";
				}else{
					document.getElementById(LayerID+i).style.display = "none";
				}				
			}else{
				document.getElementById(LayerID+i).style.display = "none";
			}
		}
		
	}else{
		if(document.getElementById(LayerID).style.display == "none"){
			document.getElementById(LayerID).style.display = "";
		}else{
			document.getElementById(LayerID).style.display = "none";
		}
	}
}


//ÀÌ¹ÌÁö-ÆÄ¾÷°ü·Ã
function LoadImg(img) {
 var d=new Object();
    var imgInfo = new Image(); //ÀÌ¹ÌÁö °´Ã¼¸¦ »ý¼ºÇÏ°í
    imgInfo.src = img; //ÀÌ¹ÌÁö ÁÖ¼Ò¸¦ ´ëÀÔÇÑÈÄ¿¡,
	d.wd=imgInfo.width; //ÀÌ¹ÌÁöÀÇ ³Êºñ¿Í
	d.ht=imgInfo.height; //³ôÀÌ¸¦ ±¸ÇÑµÚ
 return d; //°ªÀ» ¹ÝÈ¯
}

function image_go(img){
   var img,x,y,x1,y1
   if (img.length < 1) {
	alert(" ÀÌ¹ÌÁö ÆÄÀÏÀÌ ¼±ÅÃµÇÁö ¾Ê¾Ò°Å³ª \n\n Àß¸øµÈ ÆÄÀÏÀÌ¸§ ÀÔ´Ï´Ù ")
	document.registform.attachFile.focus();
	return false;
   } 
   aa=LoadImg(img);
   x= aa.wd;
   y= aa.ht;

  x1=1600;    // ÆË¾÷ ÃÖ´ë »çÀÌÁî
  y1=1200;    // ÆÄ¾÷ ÃÖ´ë »çÀÌÁî
   if (x<x1) { 
	  x1=x;
   } 

   if (y<y1) {
	  y1=y;
   }
   window.open('/admin/common/pop.html?'+img,'','width='+x1+',height='+y1+',top=100,left=100,scrollbars=1,resizable=1');  
}


//ÀÌ¹ÌÁö È®ÀÎ
function show_imgView(obj,Number){
	var Product_Img_src = obj;	
	if(Product_Img_src.value ==""){
		alert(Number+">¼±ÅÃÇÏ½Å »óÇ°±×¸²ÀÌ ¾ø½À´Ï´Ù.");
		Product_Img_src.focus();
		}else{
			Product_Img = new Image();								//ÀÌ¹ÌÁö¸¦ »ý¼º
			Product_Img.src = Product_Img_src.value					//±×¸² ÁÖ¼ÒÁöÁ¤
			document.Pre_View.src = Product_Img.src ;				//»ý¼ºÇÑ ÀÌ¹ÌÁöÀÇ °ªÀ» ¹Ì¸®º¸±â Ã¢¿¡´ëÀÔ
			return;				
		}
}

//Home/Admin - ¿£ÅÍ ·Î±×ÀÎ
function proc_EnterLogin(form,id,pw,ev){
	var evCode = (window.netscape) ? ev.which : ev.keyCode
	if(evCode == 13){
		check_Login(form,id,pw);
	}
}

//Home/Admin - ·Î±×ÀÎ
function check_Login(form,id,pw){
	if(check_value(id,"¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") == false){
		return;
	}

	if(check_value(pw,"ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.") == false){
		return;
	}
	form.action = "/login/login_proc.asp";
	form.submit();
}

//¸â¹ö ·Î±×ÀÎ
function show_login(type,goUrl)
{
	if(type == ""){
		var objPopup;	
		url = "/login/login_form.asp";
		param		 = "" + goUrl;
		popName = "loginPopup";
		propertys = "width=320,height=180,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,left=400,top=280";
		objPopup = window.open(url+param,popName,propertys);
		objPopup.focus();
	}else{

	}
}

//¿ÀÇÂÆË¾÷
function window_open(pType,pName,pUrl,param,pWidth,pHeight,pOption){
	var objPopup;
	var propertys;
	if(pType == ""){
		propertys	= "width="+pWidth+",height="+pHeight+",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes"+pOption;
		objPopup	= window.open(pUrl+param,pName,propertys);
		objPopup.focus();
	}else{

	}
}

//¿ÀÇÂ¸ð´Þ
function modal_open(mUrl,param,mWidth,mHeight){
	var xpos = (screen.availWidth - mWidth) / 2;
	var ypos = (screen.availHeight - mHeight) / 2;
	window.showModalDialog (mUrl+param,"","dialogWidth:"+mWidth+"px;dialogHeight:"+mHeight+"px; dialogLeft:"+xpos+"px; dialogTop:"+ypos+"; dialogscroll:1; help:1; status:0;");
}


//¿ìÆí¹øÈ£ Ã£±â
function show_postSearch(openerFormName,openerPostName1,openerPostName2,openerAddrName){
	var objPopup;
	var url,param,popName,propertys;
	url = "/logic/post/post.asp";
	param = "?openerFormName="+ openerFormName +"&openerPostName1="+ openerPostName1 +"&openerPostName2="+ openerPostName2 + "&openerAddrName="+openerAddrName;
	popName = "postPopup";
	propertys = "width=350px,height=300px,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,left=250px,top=100px";
	objPopup = window.open(url+param,popName,propertys);
	objPopup.focus();
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------
//¶óÀÌÆ®¹Ú½º °ü·Ã
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------
//°´Ã¼»ý¼º
function createObj(type,id){
	var obj;
	obj			=  document.createElement(type);
	obj.id	=  id;					
	return obj;
}

//È­¸éÆ÷Áî
function screenPuse(){

	var bWidth	= document.body.clientWidth;
	var bHeight	= document.body.clientHeight;


	if((document.getElementById("tempDiv") == null) == true){
		var obj					=createObj("div","tempDiv","","");				
		document.body.appendChild(obj);
		obj.style.display		= "";
	}else{
		var obj					=document.getElementById("tempDiv")
		obj.style.display		= "";
	}


	obj.style.top				= "0px";
	obj.style.left				= "0px";
	obj.style.width				= bWidth+"px";
	obj.style.height			= bHeight+"px";
	obj.style.background		= "#000000";
	obj.style.display			= "";
	obj.style.zindex			= "10000000";
	obj.style.position			= "absolute";
	obj.style.filter			= "alpha(opacity:30)"; 
	obj.onclick					= function(){

		if(this.style.display == ""){
			msgDiv.style.display = "none";
			this.style.display	 = "none";
		//	document.body.removeChild(tempDiv);
		//	document.body.removeChild(msgDiv);
		}
	}
	return obj;

}

//¸Þ½ÃÁöµµ±¸
function screenPuseMsg(msg){
	var tempObj =screenPuse();
	var cWidth	= (document.body.clientWidth/2)-250;
	var cHeight	= (document.body.clientHeight/2)-50;
	
	var obj			=createObj("div","msgDiv","","");				
	document.body.appendChild(obj);
	obj.style.top				= cHeight+"px";
	obj.style.left				= cWidth+"px";
	obj.style.width				= "500px";
	obj.style.height			= "100px";
	obj.style.background		= "#FFFF00";
	obj.style.display			= "";
	obj.style.zindex			= tempObj.style.zindex+1;
	obj.style.position			= "absolute";
	obj.style.filter			= "alpha(opacity:80)"; 
	obj.style.border			= "1px solid #CC0000";
	obj.style.fontSize			= "12px";
	obj.style.color				= "#666633";
	obj.style.padding			= "10px";
	obj.innerHTML				= msg;

	obj.onclick					= function(){
		if(this.style.display == ""){
			tempDiv.style.display = "none";
			this.style.display	  = "none";
			document.body.removeChild(tempDiv);
			document.body.removeChild(msgDiv);
		}
	}
}


//¸®¿¡¾î´Ý±â
function closeLayer(){
	if(document.getElementById("tempDiv")){
		document.getElementById("tempDiv").style.display = "none";
		document.getElementById("msgDiv").style.display	= "none";
		document.body.removeChild(tempDiv);
		document.body.removeChild(msgDiv);
	}

	if(document.getElementById("msgDiv")){
		document.getElementById("tempDiv").style.display = "none";
		document.getElementById("msgDiv").style.display	= "none";
		document.body.removeChild(tempDiv);
		document.body.removeChild(msgDiv);
	}

}

//ÄíÅ°°¡Á®¿À±â
function getCookie(name){
	var nameOfCookie = name + "=";
	var x = 0;
	while(x <= document.cookie.length){
		var y = (x+nameOfCookie.length);
		if (document.cookie.substring(x,y) == nameOfCookie ){
			if((endOfCookie=document.cookie.indexOf( ";",y)) == -1)
			endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring(y,endOfCookie));
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
		break;
	}
		return "";
}

//¾Ë¸²µµ±¸
function screenMsg(msg){
	var tempObj =screenPuse();
	var cWidth	= (document.body.clientWidth/2)-250;
	var cHeight	= (document.body.clientHeight/2)-50;

	if((document.getElementById("msgDiv") == null) == true){
		var obj	=createObj("div","msgDiv","","");				
		document.body.appendChild(obj);
	}else{
		var obj = document.getElementById("msgDiv")
		document.getElementById("msgDiv").style.display = "";
	}
	obj.style.top				= cHeight+"px";
	obj.style.left				= cWidth+"px";
	obj.style.width				= "500px";
	obj.style.height			= "100px";
	obj.style.background		= "#FF9900";
	obj.style.display			= "";
	obj.style.zindex			= tempObj.style.zindex+1;
	obj.style.position			= "absolute";
	obj.style.filter			= "alpha(opacity:90)"; 
	obj.style.border			= "1px solid #CC0000";
	obj.style.fontSize			= "12px";
	obj.style.color				= "#000000";
	obj.style.padding			= "10px";
	obj.innerHTML				= msg;
	
	//setTimeout(closeLayer,2000);
	obj.onclick						= function(){
		if(this.style.display == ""){
			tempDiv.style.display	= "none";
			this.style.display		= "none";
			//document.body.removeChild(tempDiv);
			//document.body.removeChild(msgDiv);
		}
	}

}

//ÄíÅ°¼³Á¤[³¯Â¥¾øÀ½]
function setCookie1(name, value){
	document.cookie = name + '=' + escape(value) + '; path=/; '
}

//ÄíÅ°¼³Á¤[³¯Â¥ÁöÁ¤]
function setCookie2(name, value, expiredays){
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie = name + '=' + escape(value) + '; path=/; expires=' + todayDate.toGMTString() + ';'
}

//ÆòÀ» ~ §³ º¯È¯
function _chgPyeong(obj, obj2)
{
	var org_value = obj.value.replace(/\,/gi, "");
	var strValue = org_value;

	var tmpVal = (1* strValue) * 3.3058;
	var reval = numberRound(tmpVal,1);
	eval("document."+obj2+".value =" +  reval);
	
}

// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)
function flashWrite(url,w,h,id,bg,vars,win){
 // ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
 var flashStr=
 "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
 "<param name='allowScriptAccess' value='always' />"+
 "<param name='movie' value='"+url+"' />"+
 "<param name='FlashVars' value='"+vars+"' />"+
 "<param name='wmode' value='"+win+"' />"+
 "<param name='menu' value='false' />"+
 "<param name='quality' value='high' />"+
 "<param name='bgcolor' value='"+bg+"' />"+
 "<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
 "</object>";

 // ÇÃ·¡½Ã ÄÚµå Ãâ·Â
 document.write(flashStr);

}

// flashWrite(¾ÆÀÌµð, °¡·Î, ¼¼·Î, °æ·Î, ÆÄ¶ó¸ÞÅÍ, ½ºÅ¸ÀÏ)
function showFlashObject(id,width,height,movie,flashvars,style)
{
	var s = '<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" width="'+width+'" height="'+height+'" style="'+style+'"><param name="movie" value="'+movie+'"/><param name="menu" value="false"/><param name="quality" value="high"/><param name="allowScriptAccess" value="sameDomain"/><param name="play" value="true"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+flashvars+'"/><embed swLiveConnect="true" flashvars="'+flashvars+'" src="'+movie+'" quality="high" bgcolor="" wmode="transparent" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
	document.write(s);
}


// ·Î±×ÀÎ

	function member_login()
    {
	    url = "/admin/member_login.asp"
        awindow = window.open(url,"login","toolbar=no,menubar=no,scrollbars=yes,resizable=no,statubar=no,width=820,height=450");        
    }


// ·Î±×¾Æ¿ô

	function member_logout()
    {
	    url = "/admin/member_logout.asp"
        awindow = window.open(url,"logout","toolbar=no,menubar=no,scrollbars=no,resizable=no,statubar=no,width=0,height=0");
    }
