/****************************************************************************************
(1) ½Ã½ºÅÛ¸í 			: µ¿¿øÀÎÀç°³¹ß¿ø
(2) ÇÁ·Î±×·¥¸í 		: °øÅëÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö
*****************************************************************************************/

/* Page Init */
var windowname = "µ¿¿ø½Ã½ºÅÛÁî-Á¤¹Ð";
var actionfrm = "actionfrm";
var actionfrm1 = "actionfrm1";	 //TEST
var popupfrm = "popupfrm";
var contDeleteMsg = "»èÁ¦ÇÏ½Ã¸é º¹±¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\n»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?";
var contLeaveMsg = "Å»ÅðÇÏ½Ã¸é º¹±¸ÇÒ ¼ö ¾ø½À´Ï´Ù.\nÅ»ÅðÇÏ½Ã°Ú½À´Ï±î?";

var contErrorMsg = "¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.\n¿À·ù¸Þ¼¼Áö : ";
var contFormcheck = 1;
var contFormMsg = "ÀÌ¹ÌÀü¼ÛÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·ÁÁÖ¼¼¿ä.";


function _jsHideStatus(){ 
//	window.status= ":: Welcome To "+ windowname +" ::"
	return true 
} 


if (document.layers) 
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.ONCLICK) 
document.onmouseover=_jsHideStatus 
document.onmouseout=_jsHideStatus 
document.onclick=_jsHideStatus


//¸µÅ©Á¡¼¶¾ø¾Ö±â..
function _jsBlur(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=_jsBlur; 

function _jsRetFalse(){
	var tag = event.srcElement.tagName;
	if ( tag == "TEXTAREA" || tag == "INPUT" || tag == "DIV" ) return true;
	else return false;		
}

//document.oncontextmenu = _jsRetFalse;
//document.ondragstart = _jsRetFalse;
//document.onselectstart = _jsRetFalse; 
/* ÆäÀÌÁöÀÇ ÃÊ±âÈ­·Î, ¸¶¿ì½º¿ìÃø, µå·¡±× µîÀ» ¹æÁöÇÑ´Ù. */ 



function _jsOneClick(){
	if ((event.button==2) || (event.button==2) || (event.ctrlKey) || (event.shiftKey) ) {
		return;
	}
}

function _jsProcessKey(){
	if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82 || event.keyCode== 65 || event.keyCode==80 ))) { 
		event.keyCode = 0; 
		event.cancelBubble = true; 
		event.returnValue = false; 
	} 
}




//ÆäÀÌÁöÀÌµ¿.
function _jsGoto(code,subp){
	var folder
	if (code!=null){
		var url = "";
		if (arguments[2]) {	url = arguments[2]; }
		window.location.href="/?code="+ code +"&subp=" + subp + url;
	}
}

function _jsGotoShop(code,subp){
	var folder
	if (code!=null){
		var url = "";
		if (arguments[2]) {	url = arguments[2]; }
		window.location.href="/shopsub.asp?code="+ code +"&subp=" + subp + url;
	}
}


function _jsGoHome(){
	window.location.href="/";
}

function _jsOpen(url,name,features){	//À©µµ¿ì¿ÀÇÂ;
	var contWin  = name;
	if( (contWin != null) && (contWin.closed == false) ){contWin.close();}
	contWin=window.open(url,name,features);
	contWin.focus();
}



function _jsFullOpen(url,name){	//À©µµ¿ì¿ÀÇÂ;
	var contWin  = name;
	if( (contWin != null) && (contWin.closed == false) ){contWin.close();}
	var width = screen.availWidth;
	var height = screen.availHeight;
	contWin=window.open(url,name,"width="+width+", height="+height);
	contWin.focus();
}




function _jsModal(URL , name , features){
	window.showModalDialog(URL, window , features);
	//window.showModalDialog(URL, window , "dialogWidth:100px ; dialogHeight:50px;status:no;");
}


function _jsGotoBack(){
	window.history.go(-1);
}



function _jsPrintPage(){
	var obj = document.getElementById("printHTML")
	if (obj!=null){
		_jsOpen('/popup/printpage.asp','printpopup','width=660,height=500,scrollbars=yes');
	}
	else{
		alert("ÀÎ¼âÇÒ ³»¿ëÀÌ ¾ø½À´Ï´Ù.");
	}
}


function _jsPrint(){	window.print();}

function _jsClose(){ 
	opener = self;
	self.close();
}

function _jsNotReady(gubun){
	alert("¼­ºñ½ºÁØºñÁßÀÔ´Ï´Ù.");
	return;
}

function _jsNeedLogin(){
	alert("·Î±×ÀÎÀÌ ÇÊ¿äÇÑ ¼­ºñ½º ÀÔ´Ï´Ù.\n·Î±×ÀÎ ÈÄ ÀÌ¿ëÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
	window.location.href="/?code=06&subp=01&returl="+escape(window.location.pathname+window.location.search);
	return;
}




function _jsDownLoad(bbsid, ix){
	var url = "/pb_download.asp?bbsid="+bbsid+"&ix="+ix;
//	if (!frame) { frame ="actionfrm";	}
	document.all[actionfrm].src= url ;
//	window.open(url, '','');
}



function _jsLoginGo(){
	var strparameter = window.location.search; 
	if (strparameter.length>0) {
		if (strparameter.indexOf("returl" , 0) > 0){
			window.location.reload();
		}
		else {
			window.location.href="/subpage.asp?code=06&subp=01_1&returl="+escape(window.location.pathname+window.location.search);
		}
	}
	else {
		window.location.href="/subpage.asp?code=06&subp=01_1&returl="+escape(window.location.pathname+window.location.search);
	}

	return;
}





//ÇÑ°³»èÁ¦.
function _jsDeleteOne(f,ix){
	try {
		if (confirm(contDeleteMsg)) {
			f.gbn.value = "delete";
			f.ix.value = ix;
			f.action = f.actionurl.value;
			f.target = actionfrm; 
			f.submit();
		}
	}
	catch (e) {
		alert(contErrorMsg + e.description);
	}
}


//ÀüÃ¼»èÁ¦
function _jsDeleteAll(f){
	try {
		if (_jsChkValue("chkbox[]" , "»èÁ¦ÇÒ ¸ñ·ÏÀ» ¼±ÅÃÇÏ¼¼¿ä.")) {
			if (confirm(contDeleteMsg)){
				f.gbn.value="alldelete";
				f.action = actionurl;
				f.target= actionfrm;
				f.submit();
			}
			else{
				return;
			}
		}
		
	}
	catch (e) {
		alert(contErrorMsg + e.description);
	}
}

//ÀüÃ¼»èÁ¦
function _jsMoveAll(f){
	try {
		if (_jsChkValue("chkbox[]" , "ÀÌµ¿ÇÒ ¸ñ·ÏÀ» ¼±ÅÃÇÏ¼¼¿ä.")) {

			popupmove = window.open('','popupmove','width=400, height=300');
			f.target = "popupmove";
			f.action = "/server/popup_move.asp"
			f.submit();

		}		
	}
	catch (e) {
		alert(contErrorMsg + e.description);
	}

}


//Á¦Ç°¼Ò°³
function _jsProductZoom(image){
	_jsOpen('/popup/pop_zoom.asp?image='+image,'product_zoom','width=500,height=500');
}



//Á¦Ç°¼Ò°³
function _jsMapZoom(image){
	_jsOpen('/popup/map_zoom.asp?image='+image,'map_zoom','width=600,height=500');
}


//·Î±×ÀÎ;
function _jsLoginEnter(f){
	if (event.keyCode==13) { _jsLogin(f); }	
}


function _jsLogin(f){

	if (!_jsRegularExp("" , f.userid , "¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä. ")) return;
	if (!_jsRegularExp("" , f.userpwd , "ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä")) return;


	 if (f.login.checked == true )
	 {
		f.action = "https://www.dwdf.co.kr:444/common/pb_login.asp"
	 }else{
		f.action = "/common/pb_login.asp"
   }

	//f.action = "https://www.dwdf.co.kr:444/common/pb_login.asp"
	f.target = actionfrm;
	//f.target = "_blank";
	f.submit();
}



function _jsLogout(){
	window.location.href="/common/pb_logout.asp";
}


//¿ÞÂÊ¸Þ´º ÃÊ±âÈ­
function _jsLeftMenuInit(code){
	try{		
		if (code > 0){
			var obj_img = document.all["left_tt"+code] ;
			var img_name = obj_img.name;
			obj_img.src = "/images/"+imgfolder+"/"+img_name+"_over.gif";
			_jsLeftMenuInitTR(code);
		}
	}
	catch (e) {return;}
}

//¿ÞÂÊ¸Þ´º¼­ºê¸Þ´ºº¸¿©ÁÖ±â
function _jsLeftMenuInitTR(code){
	try{		
		if (code > 0){
			var obj_tr = document.all["l_menu"+ code +"_tr"]; 
			if (typeof(obj_tr)=="object") {
				if (obj_tr.style.display=="none") {
					obj_tr.style.display = "block";
				}
			}
		}
	}
	catch (e) { return;}
}


//ÀÚµ¿Æ÷Ä¿½ºÀÌµ¿
function _jsChangeFocus(val,len,nextfrm){
	if( val.length == len) nextfrm.focus();
}



// ±ÛÀÚ°¹¼öÃ¼Å©
function _jsCheckLen(ftxt,fnum,num) {
		var ftxt,fnum,num;
		var temp;
		var mycount;
		mycount = 0;

		len = ftxt.value.length;
		for(k=0;k<len;k++){
			temp = ftxt.value.charAt(k);
			if(escape(temp).length > 4)
				mycount += 2;
			else
				mycount++;
		}
		fnum.value = mycount;
		if (mycount > num) { alert( num + 'ÀÚ ÀÌ³»·Î ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿ä.');}

		return mycount;
}







//ÀÓ½Ã FILE¸í;
function _jsEditorInitCode(){
	curr_date	= new Date();
	year        = curr_date.getYear();
	month       = curr_date.getMonth();
	day         = curr_date.getDay();
	hours       = curr_date.getHours();
	mins        = curr_date.getMinutes();
	secs        = curr_date.getSeconds();

	return year.toString() + month.toString() + day.toString() + hours.toString() + mins.toString() + secs.toString();
}


//ÆÄÀÏ»èÁ¦.
function _jsFileUpload(url, limitfilecnt, f){

	if ((f.attfile.length-1) < limitfilecnt) {
		_jsOpen('/board/pb_board_upload.asp?bbsid='+url, 'upload', 'width=400,height=150')
	} else {
		alert("Ã·ºÎÆÄÀÏÀº "+limitfilecnt + "°³ ÀÌ»ó ¿Ã¸± ¼ö ¾ø½À´Ï´Ù.");
		return;
	}

}

function _jsFileDelete(f){
	try {
		var frm = document.frmdelete; 

		if (f.attfile.length==1)	{
			alert("Ã·ºÎµÈ ÆÄÀÏÀÌ ¾ø½À´Ï´Ù."); return;
		} 

		if (f.attfile.selectedIndex<=0) {
			alert("¼±ÅÃµÈ ÆÄÀÏÀÌ ¾ø½À´Ï´Ù."); return; 
		}

		selectedfile = f.attfile.selectedIndex;	//ÆÄÀÏ¼ö 
		frm.oldfile.value = f.attfile.options[selectedfile].value;

		if (confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")) {
			frm.action = "/board/pb_board_upload_ok.asp";
			frm.gbn.value = "delete";	//µî·Ï,¼öÁ¤½Ã Ã³¸® º°µµ·Î.
			frm.target = actionfrm;
			frm.submit();
		}
		
	    // ¸®½ºÆ®ÀÇ À§Ä¡¸¦ ÇÑÄ­¾¿ À§·Î ¿Ã¸°´Ù.
	    for(i = selectedfile; i < f.attfile.length-1; i++) {
	        f.attfile.options[i].value = f.attfile.options[i+1].value;
	        f.attfile.options[i].text = f.attfile.options[i+1].text;
	    }

	    f.attfile.length--;		// ±æÀÌ¸¦ ÁÙ¿©ÁØ´Ù.
		return;

	}
	catch (e) { return;}
}




//¼¿·ºÆ®¹Ú½º ½ºÅ¸ÀÏ
function _jsSelectV(){
	var strID , strST , strNo, strVa, strEv , Html , strBr, ArgsNum = arguments.length;
	if (ArgsNum){
		strID = arguments[0];		//¾ÆÀÌµð;
		strST = arguments[1];	//½ºÅ¸ÀÏ;
		strBr = arguments[2];	 	//Border Color ;
		strNo = arguments[3];	//¼±ÅÃµÇ¾îÁø °ª; ¾øÀ¸¸é ºóÄ­;
		strVa = arguments[4];	//Options °ª;
		strEv = arguments[5];	//Event;
		
		if (strEv==null){ strEv = "";} 
		if (!strVa){strVa="-¼±ÅÃ";}

		intLen = 1;
		//¹®ÀÚ¿­ÀÇ ±æÀÌ¿¡¼­ Æ¯Á¤±¸ºÐÀÚÀÇ °¹¼ö ±¸ÇÔ;
		for (i = 1 ; i < strVa.length; i++){
			if (strVa.charAt(i)=="@"){
				intLen ++;
			}
		}

		//Æ¯Á¤±¸ºÐÀÚ¿¡ ÀÇÇØ ¹®ÀÚ¿­ ÀÚ¸£°í, option ÅÂ±× »ý¼º .
		Html = "<select name='"+strID+"' style='"+strST+"'"+strEv+"  unselectable=\"on\"  >";
		for (j = 0 ; j < intLen ; j++){
			strSplit = strVa.split("@")[j];
			strtext = strSplit.split("-");
		
			if (strNo == strtext[0]){ strSelected = " selected"; }
			else {strSelected = ""; }
		
			Html = Html + "<option value='"+strtext[0]+"' "+strSelected+">"+strtext[1]+"</option>\n";
		
		
		}
		Html = Html + "</select>";

		SS_ENV.CR.Border = strBr;		
		SS_write(Html,7, '','select_bull_gray.gif');	//°¹¼ö

	}
	else{
		alert("¿À·ù°¡ ¹ß»ýÇÏ¿´½À´Ï´Ù.\n\n¼¿·ºÆ®¹Ú½º¸¦ »ý¼ºÇÒ¼ö ¾ø½À´Ï´Ù.");
		return;
	}
}




function _jsRegularExp(chk,frm,msg){	//Á¤±Ô½ÄÀ¸·Î Ã¼Å©ÇÔ.
	var strValue =  frm.value;
	var bitExp = false;

	switch (chk){
		case "id" : 
			if (frm.value.match(/[A-Za-z0-9]{4,15}\w*/g)!=strValue){break;}
			bitExp = true;
		case "email" :
			if (frm.value.match(/[\w\-]+\@[\w\-]+(\.[\w\-]+)+/g)!=strValue){break;}
			bitExp = true;
		case "number" :
			if (frm.value.match(/\d+/g)!=strValue){ break;}
			bitExp = true;
		case "phone" :
			if (frm.value.match(/[0-9]{2,3}\-[0-9]{3,4}\-[0-9]{4}/g)!=strValue){break;}
			bitExp = true;
		case "mphone" :		
			if (frm.value.match(/01[016789]\-[0-9]{3,4}\-[0-9]{4}/g)!=strValue){ break;}
			bitExp = true;
		case "date" :
			if (frm.value.match(/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/g)!=strValue){break;}
			bitExp = true;
		case "homepage" :
			if (frm.value.match(/\w+:\/\/[^#]*/g)!=strValue){		break;}
			bitExp = true;
		case "checked" : 
			if (typeof(frm)=="object"){
				if (typeof(frm.length)=="undefined"){
					if (frm.checked) { bitExp = true; }
				}
				else{
					for (i = 0 ; i < frm.length; i++){
						if (frm[i].checked){	bitExp = true;		}
					}
				}
			}
			
			break;
		case "selected" :
			if (frm.value==""){ break ;}
			bitExp = true;
		case "none" :
			if (frm.value==""){ break ;}
			bitExp = true;
		case "idn1" :
			if (frm.value.match(/[0-9]{6}/g)!=strValue){ break; }
			bitExp = true;
		case "idn2" :
			if (frm.value.match(/[0-9]{7}/g)!=strValue){break; }
			bitExp = true;
		case "company" :
			if (frm.value.match(/[0-9]{3}\-[0-9]{2}\-[0-9]{5}/g)!=strValue){break;}
			bitExp = true;	
		default : //°ø¹éÃ¼Å©;
			if (frm.value.match(/\S/)==null){break;}
			bitExp = true;
	}
	
	if (!bitExp){ if (msg) alert(msg);if ((chk!="checked")&&(chk!="selected")&&(chk!="none")){frm.focus();};	return false;	}
	else{return true;}
	
}


//¼ýÀÚÃ¼Å©
function _jsNumberCheck(f,max,msg){
	if (parseInt(f.value) > max) {
		alert(msg+"Àº(´Â) "+max+" ÀÌ»ó ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.") ;
		f.value = "";
		f.focus();
		return false;
	}
	else {
		return true;
	}
}



//ÇöÀç¼±ÅÃµÈ Radio¹öÆ°ÀÇ VALUE °ª ¸®ÅÏ
function _jsCheckedValue(frm){
	try { 
		var returnvalue;

		if (typeof(frm)=="object"){
			if (typeof(frm.length)=="undefined"){
				if (frm.checked) { returnvalue = frm.value; }

			}
			else{
				for (i = 0 ; i < frm.length; i++){
					if (frm[i].checked){ returnvalue = frm[i].value; }
				}
			}
		}

		return returnvalue;

	}
	catch (e) {
		alert(contErrorMsg + e);
	}


}


function _jsOnlyNum(){
   	if((event.keyCode<48)||(event.keyCode>57))
   	event.returnValue=false;
}

//¿£ÅÍÅ°¸·À½
function _jsNoEnterkey() { 
	if (event.keyCode == 13) {
		return false;
	}
}



//¼îÇÏÀÌµå 
function _jsShowHide(obj,action){
	obj.style.display = action;
}



function _jsShowHideYN(obj){
	var value = (obj.style.display=="none") ? false : true ;
	return value;
}



//¹è¿­¼îÇÏÀÌµå
function _jsShowHideArray(id , num){
	var num , tr = document.all[id] , len = tr.length;

	if (len == null)	{
		(_jsShowHideYN(tr)) ? _jsShowHide(tr,"none") : _jsShowHide(tr,"block")
	}
	else{
		for ( i = 0; i < len ; i++){
			if (i == num){
				(_jsShowHideYN(tr[num])) ? _jsShowHide(tr[num],"none") : _jsShowHide(tr[num],"block")
			}
			else{
				_jsShowHide(tr[i],"none");
			}
		}
	}
}



//TABLE , TR ,TD µîÀÇ ¼îÇÏÀÌµå ; °¹¼ö¸¸Å­ º¸¿©ÁÖ´Â ±â´É;
function _jsExchageSelected(f,id){
//	var tr1 = document.getElementById(id);
	var tr1 = document.all.item(id);
	var trlen = tr1.length;
	var v = parseInt(f.options[f.selectedIndex].value);
	
	for (i = 0; i < trlen; i ++){
		if (tr1 != null){
			if (i > v-1) {tr1[i].style.display = "none"; }
			else { tr1[i].style.display = "";} 
		}
	}
}



//¹öÆ° Å¬¸¯½Ã ÆäÀÌÁö ÀÌµ¿ÇÏ±â.
function _jsRootGo(url){
	window.location.href=url;
}


//ÀÌ¹ÌÁö ¸®»çÀÌÁî;
function _jsImageResize(imgid , sizeW){
	var sizeW;
	var img = document.images(imgid);
	if (img){
		if (img.length==null){
			imgwidth = img.width ; imgheight = img.height;
			if (sizeW < imgwidth){
				imgW = sizeW; 
				imgH = parseInt((sizeW/imgwidth) * imgheight);
			}
			else{
				imgW = imgwidth ;
				imgH = imgheight;
			}
			img.width = imgW;
			img.height = imgH;		
		}
		else{
			for (i = 0 ; i < img.length; i++) {
				imgwidth = img[i].width ; imgheight = img[i].height;
				if (sizeW < imgwidth){
					imgW = sizeW; 
					imgH = parseInt((sizeW/imgwidth) * imgheight);
				}
				else{
					imgW = imgwidth ;
					imgH = imgheight;
				}
				img[i].width = imgW;
				img[i].height = imgH;
			}
		}
	}
}


function _jsResizeImg(imgObj, maxWidth, maxHight)
{
	//var maxHight = 50;
	//var maxWidth = 70;
	var imgOriginal = new Image();
	imgOriginal.src = imgObj.src;
	
	
	if(imgOriginal.width >= maxWidth && imgOriginal.height >= maxHight)
	{
		//alert(1);
		var baseAxis;
		if((imgOriginal.width/maxWidth) > (imgOriginal.height/maxHight))
		{
			baseAxis = 'width';
		}
		else
		{
			baseAxis = 'height';
		}
		
		
		if(baseAxis == 'width')
		{
			imgObj.height = Math.round(imgOriginal.height*(maxWidth/imgOriginal.width));
			imgObj.width = Math.round(imgOriginal.width*(imgObj.height/imgOriginal.height));
		}
		else
		{
			imgObj.width = Math.round(imgOriginal.width*(maxHight/imgOriginal.height));
			imgObj.height = Math.round(imgOriginal.height*(imgObj.width/imgOriginal.width));
		}

	}
	else if(imgOriginal.width >= maxWidth && imgOriginal.height < maxHight)
	{
		//alert(2);
		imgObj.width = maxWidth;
		imgObj.height = Math.round(imgOriginal.height*(maxWidth/imgOriginal.width));
	}
	else if(imgOriginal.width < maxWidth && imgOriginal.height >= maxHight)
	{
		//alert(3);
		imgObj.width = Math.round(imgOriginal.width*(maxHight/imgOriginal.height));
		imgObj.height = maxHight;
	}
	else
	{
		//alert(4);
		imgObj.width = imgOriginal.width;
		imgObj.height = imgOriginal.height;
	}
}


function _jsSmsSubmit(pnum,pid) {
	_jsOpen('/popup/pop_sms.asp?pnum='+pnum+'&pid='+pid,'smspop','width=300,height=330,scrollbars=no');
}





function _jsChkAll(f){
	var chkvalue = document.all.item(f);
	if (chkvalue) {
		var chklen = chkvalue.length;
	
		if (chklen==null || chklen==""){
			if(chkvalue.checked) { chkvalue.checked=false; }
			else { chkvalue.checked=true; }
		}
		else{
			for(i=0;i<chklen;i++){
				if(chkvalue[i].type=='checkbox'){
					if(chkvalue[i].checked) { chkvalue[i].checked=false; }
					else {chkvalue[i].checked=true; }
				}
			}
		}
	}
	
}


function _jsChkValue(f,msg){
	var v="" , msg ;
	var chkvalue = document.all.item(f);
	var chklen = chkvalue.length;
	
	if (chklen==null || chklen==""){
		if (chkvalue.checked){
			v=chkvalue.value+",";
		}
	}
	else{
		for(i=0;i<chklen;i++){
			if(chkvalue[i].type=='checkbox'){
				if(chkvalue[i].checked) { 
					v=chkvalue[i].value+","+v
				}
			} else {
				v = chkvalue[i].value +  "," + v
			}
		}
	}
	
	if (v==""){	alert(msg); return false;}
	else{return v;}
}




//SELECT ¹Ú½º¿¡¼­ ÀüÃ¼Ãë¼ÒÇÔ
function _jsSelectedAllCancel(id){
	try{
		var obj = document.all[id];
		if (typeof(obj)=="object"){	//ÀüÃ¼Ãë¼Ò½Ã¿¡´Â ¾Æ·¡ºÎÅÍ »èÁ¦ÇØ¾ß Á¤»óÀûÀ¸·Î ÀÌ·ç¾îÁø´Ù.
			if (obj.length < 0 ) { alert("Ãë¼ÒÇÒ ¸ñ·ÏÀÌ ¾ø½À´Ï´Ù."); return; }
			if (confirm("ÀüºÎ Ãë¼ÒÇÏ½Ã°Ú½À´Ï±î?")){
				for (i=obj.length; i>=0; i--){
					obj.options[i] = null;
				}
			}
		}
	}
	catch (e) {
		alert(contErrorMsg + e.description);
	}	
}

//SELECT ¹Ú½º¿¡¼­ Ãë¼ÒÇÔ
function _jsSelectedCancel(id){
	try{
		var obj = document.all[id];
		if (typeof(obj)=="object"){
			if (obj.length < 0) { alert("Ãë¼ÒÇÒ ¸ñ·ÏÀÌ ¾ø½À´Ï´Ù."); return; }
			var ix = obj.options.selectedIndex;	//ÇöÀç¼±ÅÃ SELECT
			if (ix > -1) {
				if (obj.length==null) { obj.options=null; }
				else { obj.options[ix]=null; }
				_jsSelectedCancel(id);	//Àç±ÍÈ£Ãâ
			}
			else {
				//alert("Ãë¼ÒÇÒ ¸ñ·ÏÀ» ¼±ÅÃÇÏ¼¼¿ä."); return;
			}
		}
	}
	catch (e) {
		alert(contErrorMsg + e.description);
	}
}



//IFRAME ¸®»çÀÌÁî
function _jsResizeFrame(name){
	var frame = parent.document.getElementById(name);
	if (frame){
		frame.style.height=document.body.scrollHeight;
	}
}



//³¯Â¥ ÀÚµ¿»Ñ·ÁÁÖ±â.
function _jsGetDateInitEx(f){	//start ´Â ½ÃÀÛÀÏ , end Á¾·áÀÏ , ¹ßÇ¥ÀÏÀÚ

	try {

		_jsGetDateYear(f , f.value);
		
	}
	catch (e) {
		alert(contErrorMsg + e);
	}
}


//³¯Â¥ ÀÚµ¿»Ñ·ÁÁÖ±â.
function _jsGetDateInit(start,end){	//start ´Â ½ÃÀÛÀÏ , end Á¾·áÀÏ , ¹ßÇ¥ÀÏÀÚ

	try {

		_jsGetDateYear(document.frm.sYear , start);
		if (end!='') {	_jsGetDateYear(document.frm.eYear , end); 	}

		if ( (start != '') ){
			_jsGetDateMonth(document.frm.sMonth , start);
			_jsGetDateDay(document.frm.sMonth.value , document.frm.sDay , start);
		}

		if ( (end != '') ){
			_jsGetDateMonth(document.frm.eMonth , end);
			_jsGetDateDay(document.frm.eMonth.value , document.frm.eDay , end);
		}
		
	}
	catch (e) {
		alert(contErrorMsg + e);
	}
}


//³¯Â¥ ÀÚµ¿»Ñ·ÁÁÖ±â(»ý³â¿ùÀÏ)
function _jsGetDateInitBirth(start){	//start ´Â ½ÃÀÛÀÏ , end Á¾·áÀÏ 

	try {
		_jsGetDateYearBirth(document.frm.sYear , start);
		if ( (start != '') ){
			_jsGetDateMonth(document.frm.sMonth , start);
			_jsGetDateDay(document.frm.sMonth.value , document.frm.sDay , start);
		}
		
	}
	catch (e) {
		alert(contErrorMsg + e);
	}
}



datez = new Date();


//*****************************************************************************************
//³âµµ SELECT BOX ¼¼ÆÃ
function _jsGetDateYear(obj,data){
	try{
		var old_data = data.substr(0,4);

		var sY = parseInt(datez.getYear());
		var inum = 1;
		for (y=2000 ;  y <= sY+2  ; y++){
			var option1 = new Option(""+y,""+ y);
			obj.options[inum] = option1;

			if (y==Math.ceil(old_data)){
				obj.options[inum].selected = true;
			}


			inum++;
		}
	}

	catch (e) { alert(e); }

}

//³âµµ SELECT BOX ¼¼ÆÃ (»ý³â¿ùÀÏ)
function _jsGetDateYearBirth(obj,data){
	try{
		var old_data = data.substr(0,4);

		var sY = parseInt(datez.getYear());
		var inum = 1;
		for (y=1910 ;  y <= sY  ; y++){
			var option1 = new Option(""+y,""+ y);
			obj.options[inum] = option1;

			if (y==Math.ceil(old_data)){
				obj.options[inum].selected = true;
			}


			inum++;
		}
	}

	catch (e) { alert(e); }

}


//*****************************************************************************************
//¿ù SELECT BOX ¼¼ÆÃ
function _jsGetDateMonth(obj,data){
	try{
		var old_data = data.substr(5,2);

		var inum = 1;
		for (m=1 ; m <= 12 ; m++){
			var option1 = new Option(""+m,""+ m);
			obj.options[inum] = option1;

			if (m==Math.ceil(old_data)){
				obj.options[inum].selected = true;
			}

			inum++;
		}
	}

	catch (e) { alert(e); }
}


//*****************************************************************************************
//ÀÏ SELECT BOX ¼¼ÆÃ
function _jsGetDateDay(nowmonth , obj , data){

	try{
		var old_data = data.substr(8,2);

		days = 31
		
		if (nowmonth == "2") {
			days = 28
		}

		var inum = 1;

		//ÀüÃ¼¾ø¾Ö°í ³¯Â¥ ´Ù½Ã »ý¼º.
		for (i=obj.length; i>=1; i--){
			obj.options[i] = null;
		}


		for (d=1 ; d <= days ; d++){
			var option1 = new Option(""+d,""+ d);
			obj.options[inum] = option1;

			if (d==Math.ceil(old_data)){
				obj.options[inum].selected = true;
			}

			inum++;
		}
	}

	catch (e) { alert(e); }
}





//³¯Â¥ ºñ±³ÇÏ±â.
function _jsIsDate(sYear,sMonth,sDay,eYear,eMonth,eDay){

	
	var cur_y = datez.getYear();		//³âµµ
	var cur_m = datez.getMonth();	//¿ù
	var cur_d  = datez.getDate();	//³¯ÀÚ
	var cur_date = new Date(cur_y,cur_m,cur_d);
	//num=3;

	var start_date = new Date(sYear,sMonth-1,sDay);
	var end_date = new Date(eYear,eMonth-1,eDay);



	var now_date = new Date(Date.parse(cur_date));
	var start_date = new Date(Date.parse(start_date));
	var end_date = new Date(Date.parse(end_date));
	


	if (now_date > end_date) {
		alert("Á¾·áÀÏÀÌ ¿À´Ãº¸´Ù ÀÌÀü ÀÏ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	else {
		if (start_date > end_date){
			alert("Á¾·áÀÏÀÌ ½ÃÀÛÀÏº¸´Ù ÀÌÀü ÀÏ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
		else {
			return true;
		}
	}
}



function _jsIsDateAll(sDate,eDate){
	
	var cur_y = datez.getYear();		//³âµµ
	var cur_m = datez.getMonth();	//¿ù
	var cur_d  = datez.getDate();	//³¯ÀÚ
	var cur_date = new Date(cur_y,cur_m,cur_d);

	var spdate1 = sDate.split("-");
	var spdate2 = eDate.split("-");

	var start_date = new Date(spdate1[0],spdate1[1]-1,spdate1[2]);
	var end_date = new Date(spdate2[0],spdate2[1]-1,spdate2[2]);

	var now_date = new Date(Date.parse(cur_date));
	var start_date = new Date(Date.parse(start_date));
	var end_date = new Date(Date.parse(end_date));
	
	if (now_date > end_date) {
		alert("Á¾·áÀÏÀÌ ¿À´Ãº¸´Ù ÀÌÀü ÀÏ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	}
	else {
		if (start_date > end_date){
			alert("Á¾·áÀÏÀÌ ½ÃÀÛÀÏº¸´Ù ÀÌÀü ÀÏ¼ö ¾ø½À´Ï´Ù.");
			return false;
		}
		else {
			return true;
		}
	}
}






//===== ÆË¾÷ °øÁö»çÇ× =============================================
var nowDate = new Date();
var nowHours = nowDate.getHours();
var nowMin = nowDate.getMinutes();
var setCookieValue = 1440 - (nowHours*60+nowMin);		//¿À´ÃÀÚÁ¤±îÁö¸¸..


//ÄíÅ°¼³Á¤ ¹× °¡Á®¿À±â
function _jsGetCookie( 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 _jsSetCookie( name, value, expiredays ) { 
	var todayDate = new Date();
	todayDate.setTime( todayDate.getTime() + (1000*60*parseInt(expiredays)) );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 



function _jsCloseToday(popid){
	_jsSetCookie(popid , "yes" , setCookieValue);
	_jsCloseWindow();
}


function _jsCloseWindow(){
	window.close()
}


function _jsFindZip(v){
	_jsOpen('/common/pb_findzip.asp?v='+v,'findzip','width=450,height=490,scrollbars=yes');
}

function _jsFindZip2(v){
	_jsOpen('/common/pb_findzip_new.asp?v='+v,'findzip','width=450,height=490,scrollbars=yes');
}

function _jsFindAdd(v, id){
	_jsOpen('/common/pb_findadd.asp?v='+v+'&id='+id,'findadd','width=450,height=490,scrollbars=yes');
}

//ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© (ÂüÀÏ¶§ True ¸®ÅÏ)
function _jsCheckIDN(idn1,idn2){
	try {
		var values = idn1.value + idn2.value; 
		var sum = 0;
		for (i=0 ; i<8 ; i++) {sum+= values.substring(i,i+1)*(i+2); }
		for (i=8 ; i<12 ; i++) { sum+=values.substring(i,i+1)*(i-6); }
		sum=11-(sum%11);
		if (sum>=10) { sum-=10; }
		if (values.substring(12,13) != sum || (values.substring(6,7) !=1 && values.substring(6,7) != 2)) {
			alert("ÁÖ¹Îµî·Ï¹øÈ£¿¡ ¿À·ù°¡ ÀÖ½À´Ï´Ù. ´Ù½Ã È®ÀÎÇÏ½Ê½Ã¿À.");
			idn1.focus();
			return false;
		}
		else {
			return true;
		}
	}
	catch (e) {
		alert(contErrorMsg + e.description);
	}
}



function _jsByteCheck(input,id,length) {
	try {
		obj = document.all[id];

		var j=0;
		for(var i=0;i<input.value.length;i++) {
			val=escape(input.value.charAt(i)).length;
			if(val== 6) { j++; }
			else{ j++; }
		}
		
		obj.innerHTML = j;
		if(j > length) {
			alert(length+'ÀÚ ÀÌÇÏ·Î ÇØÁÖ¼¼¿ä!   '); return false;
		} 
		else {  return true;  }
	}
	
	catch (e){  return; }
}


var imgext = new Array("gif","jpg","bmp","png"); 

/* ÀÌ¹ÌÁöÈ®ÀåÀÚ¸¸ ÀÌ¶óµµ °Ë»öÇÏ±â */
function _jsImageFileCheck(frm1,frm2){
	var imgfile = frm1.value;
	var isimg = false; 

	if (imgfile)	{
		var imgfilename = imgfile.toLowerCase();

		for (i=0; i<imgext.length; i++ ) {
			if (imgfile.substring(imgfile.length-3) == imgext[i]) {
				isimg = true;
				break;
			}	
		}

		if (isimg==false) {
			alert("ÀÌ¹ÌÁöÆÄÀÏÀº ¾Æ½±°Ôµµ~ GIF ¸¸ °¡´ÉÇÕ´Ï´Ù.");
			return false;
		} else {
			frm2.src = imgfile; 
			return true;
		}
	}
}


function _jsImageSizeCheck(size){

	var sizeWidth = size.width; 
	var sizeHeight = size.height;


}



function jsGotoFlash(num,gbn){
	var gotourl 
	if (gbn=="Main") {
		switch (num) {
			case 1 : gotourl = "/subpage.asp?code=sp01"; break;
			case 2 : gotourl = "/subpage.asp?code=sp02"; break;
			case 3 : gotourl = "/subpage.asp?code=sp03"; break;
			case 4 : gotourl = "/subpage.asp?code=sp04"; break;
		}
	}

	if (gbn=="Sub") {
		switch (num) {
			case 1 : gotourl = "/subpage.asp?code=sp01&subp=01"; break;
			case 2 : gotourl = "/subpage.asp?code=sp01&subp=02"; break;
			case 3 : gotourl = "/subpage.asp?code=sp01&subp=03"; break;
			case 4 : gotourl = "/subpage.asp?code=sp01&subp=04"; break;

			case 11 : gotourl = "/subpage.asp?code=sp02&subp=01"; break;

			case 21 : gotourl = "/subpage.asp?code=sp03&subp=01"; break;
			case 22 : gotourl = "/subpage.asp?code=sp03&subp=02"; break;
			case 23 : gotourl = "/subpage.asp?code=sp03&subp=03"; break;
			case 24 : gotourl = "/subpage.asp?code=sp03&subp=04"; break;

			case 31 : gotourl = "/subpage.asp?code=sp04&subp=01"; break;
			case 32 : gotourl = "/subpage.asp?code=sp04&subp=02"; break;
			case 33 : gotourl = "/subpage.asp?code=sp04&subp=03"; break;


		}
	}
	window.location.href=gotourl;

}



//**************************************************************************
//DESIGN¿¡ ÇÊ¿äÇÑ ½ºÅ©¸³Æ®
//**************************************************************************
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}




//**************************************************************************
// ÇÃ·¡±×ÀÎ ÆÐÆ¼ Àû¿ë ÆÐÄ¡
//**************************************************************************


// ÇÃ·¡½Ã ÆÄÀÏ Object - _jsFlashPatch(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î, ¾ÆÀÌµð, ¹è°æ»ö, º¯¼ö, À©µµ¿ì¸ðµå)

function _jsFlashPatch(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);

}


function _jsFlashObject(url, width, height, strparam) {
	this.wmode = "transparent";
	this.id = "";
	this.quality = "high";
	this.menu = "false";
	this.allowScriptAccess = "sameDomain";

	var flash='';
	flash += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ width +'" height="'+ height +'"> ';
	flash += '<param name="movie" value="'+ url +'">';
	flash += '<param name="quality" value="'+ this.quality +'">';
	flash += '<param name="menu" value="'+ this.menu +'">';
	flash += '<param name="wmode" value="'+ this.wmode +'">';
	flash += '<param name="FlashVars" value="'+ strparam +'">';
	flash += '<embed src="'+ url +'" quality="'+ this.quality +'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'"></embed> ';
	flash += '</object>';

	document.write(flash);
}



//µ¿¿µ»ó ºä
//function _jsMovieObject(Url,Width,Height){                 
//	document.write("<OBJECT ID=\"Player\" codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701 CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' width='" + Width + "' height='" + Height +"'>"); 
//	document.write("<PARAM name='autoStart' value='True'>"); 
//	document.write("<PARAM name='URL' value='"+Url+" '>"); 
//	document.write("<param name='volume' value='100'> "); 
//	document.write("<param name='autostart'   value='true' > ")
//	document.write("<param name='showcontrols' value='0'> ")
//	document.write("<param name='showstatusbar' value='0'> ")
//	document.write("<param name='enablecontextmenu' value='false'> ")
//	document.write("<param name='transparentatstart' value='true'> ")
//	document.write("<param name='transparentonstop' value='true'> ")
//	document.write("<param name='EnableContextMenu' value='0'>"); 
//	document.write("<param name='ShowControls' value='false'>"); 
//	document.write("<embed type='application/x-mplayer2' name='mplay1' width='" + width + "' height='" + Height + "'></embed>"); 
//	document.write("</OBJECT>"); 
//}  

function _jsMovieObjectMOV(Url,Width,Height){     
	var htmlCode = ""
	htmlCode += ' <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="' + Height + '" width="' + Width + '" >\n';
	htmlCode += ' <param name="bgcolor" value="#000000">\n';
	htmlCode += ' <param name="loop" value="palindrome">\n';
	htmlCode += ' <param name="cache" value="true">\n';
	htmlCode += ' <param name="src" value="'+ Url + '">\n';
	htmlCode += ' <param name="autoplay" value="true">\n';
	htmlCode += ' <param name="controller" value="true">\n';
	htmlCode += ' <embed height="' + Height + '" pluginspage="http://www.apple.com/quicktime/download/" src="' + Url + '" type="video/quicktime" width="' + Width + '"  controller="true" \n';
	htmlCode += ' autoplay="true" cache="true" \n';
	htmlCode += ' loop="palindrome"> \n';
	htmlCode += ' </object>\n';

	document.write(htmlCode);
}

function _jsMovieObjectWMV(Url,Width,Height){     
	var htmlCode = ""
	htmlCode = '<object name="MediaPlayer1" id="MediaPlayer1" width="' + Width + '"  height="' + Height + '"\n';
	htmlCode += ' classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" VIEWASTEXT codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" \n';
	htmlCode += '  standby="loading windows media player components..."\n';
	htmlCode += '  type="application/x-oleobject">\n';
	htmlCode += ' <param name="filename" value="' + Url + '">\n';
	htmlCode += ' <param name="CurrentPosition" value="true">\n';
	htmlCode += ' <param name="SetCurrentEntry" value="true">\n';
	htmlCode += ' <param name="ClickToPlay" value="true">\n';
	htmlCode += ' <param name="AutoSize" value="true">\n';
	htmlCode += ' <param name="AutoResize" value="true">\n';
	htmlCode += ' <param name="AutoStart" value="true">\n';
	htmlCode += ' <param name="showcontrols" value="true">\n';
	htmlCode += ' <param name="ShowAudioControls" value="false">\n';	
	htmlCode += ' <param name="ShowDisplay" value="false">\n';	
	htmlCode += ' <param name="ShowTracker" value="true">\n';
	htmlCode += ' <param name="showstatusbar" value="true">\n';
	htmlCode += ' <param name="enablecontextmenu" value="true">\n';
	htmlCode += ' <param name="ShowPositionControls" value="1">\n';
	htmlCode += ' <param name="DisplayBackColor" value="0">\n';
	htmlCode += ' <param name="SendOpenStateChangeEvents" value="0">\n';
	htmlCode += ' <param name="SendPlayStateChangeEvents" value="0">\n';
	htmlCode += ' <param name="ShowCaptioning" value="0">\n';
	htmlCode += ' <param name="transparentatstart" value="true">\n';
	htmlCode += ' <param name="transparentonstop" value="true">\n';
	htmlCode += ' <param name="AutoRewind" value="0">\n';
	htmlCode += ' <embed type="application/x-mplayer2" name="mplay1"  width="' + Width + '"  height="' + Height + '"></embed> \n';
	htmlCode += ' </object>\n';
	
	document.write(htmlCode);
}
//**************************************************************************
// Shop Æã¼Ç ºÎºÐ
//**************************************************************************

function _jsImageZoom(code,gbn){
	var code;
	var gbn;
	window.open("/gnc30/zoom.asp?pCode="+code+"&gbn="+gbn ,"","width=100,height=100,top=10,left=10");
}

function _jsCntplus(opt){	//opt=1 plus , opt=2 minus
	var f = document.frm;
	if (opt=="1"){//plus
		f.pEa.value=parseInt(f.pEa.value)+1;
	}
	else if (opt=="2"){
		if(f.pEa.value>1){
			f.pEa.value=parseInt(f.pEa.value)-1;
		}
		else{
			return;
		}
	}
}

function _jsTopSearchEnter(){
	if (event.keyCode==13){ fncTopSearch(); }
}

function _jsTopSearch(){
	var f = document.sfrm
	var skey = document.all.item("key1");
	if (!skey.value){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù..");
		skey.focus();
		return;
	}
	else{
		f.sw1.value=skey.value;
		f.LCode.value="";
		f.MCode.value="";
		f.SCode.value="";
		f.submit();
	}
}

function _jsGoWish(f,pCode){
	f.pCode.value = pCode;
	f.action = "/gnc30/_GoodsWish.asp"
	f.target = actionfrm;
	f.submit();
}



//ÀÎÇ²¹Ú½º¿¡ ÄÞ¸¶ Âï¾îÁÖ±â(±Ý¾×ÀÔ·Â½Ã)
function _jsNumOnMask(me){
 if (event.keyCode<48||event.keyCode>57){//¼ýÀÚ¿Ü±ÝÁö
     event.returnValue=false;
	 }
 var tmpH		
	if(me.charAt(0)=="-"){//À½¼ö°¡ µé¾î¿ÔÀ»¶§ '-'¸¦ »©°íÀû¿ëµÇ°Ô..
		tmpH=me.substring(0,1);
		me=me.substring(1,me.length);
	}	//me.indexOf('-')
 	if(me.length > 3){
 		var c=0;
 		var myArray=new Array();
   		for(var i=me.length;i>0;i=i-3){
    			myArray[c++]=me.substring(i-3,i);
  	 	}
   		myArray.reverse();
  	 	me=myArray.join(",");
 	 }
 	 if(tmpH){
 	 	me=tmpH+me;
 	 }
return me
}

function _jsNumOffMask(me){
	    var tmp=me.split(",");
 	    tmp=tmp.join("");
	    return tmp;
}

function _jsCheckValue(me){
	var myStr=_jsNumOffMask(me.value);
	me.value=_jsNumOnMask(myStr);
}


//**************************************************************************
// Å¾¹öÆ° 
//**************************************************************************

ScroolTop = function(className, id) {
    this.IE = document.all ? 1 : 0;
    this.NN = document.layer ? 1 : 0;
    this.N6 = document.getElementById ? 1 : 0;
    if(this.IE) this.layer = document.all(id);
    else if(this.NN) this.layer = document.layer[id];
    else if(this.N6) this.layer = document.getElementById(id);
    else return;
    this.className = className;
    this.top = this.oldY = parseInt(this.layer.style.top,10);
    setInterval(this.className + ".move()", 10);
    }
    ScroolTop.prototype.move = function() {
        var diffY = (this.IE) ? document.body.scrollTop+this.top : self.pageYOffset+this.top; // Ç¥ÁØ¿¡´Â document.documentElement.scrollTop
        if(diffY != this.oldY) {
            var percentY = .1 * (diffY - this.oldY);
            percentY = (percentY > 0) ? Math.ceil(percentY) : Math.floor(percentY);
    
            this.oldY += percentY;
            this.layer.style.top = this.oldY + "px";
        }
    }


   	function goTop(orix,oriy,desx,desy) {
		var Timer;
		var winHeight = document.body.scrollTop;
		if(Timer) clearTimeout(Timer);
		startx = 0;
		starty = winHeight;
		if(!orix || orix < 0) orix = 0;
		if(!oriy || oriy < 0) oriy = 0;
		var speed = 7;
		if(!desx) desx = 0 + startx;
		if(!desy) desy = 0 + starty;
		desx += (orix - startx) / speed;
		if (desx < 0) desx = 0;
		desy += (oriy - starty) / speed;
		if (desy < 0) desy = 0;
		var posX = Math.ceil(desx);
		var posY = Math.ceil(desy);
		window.scrollTo(posX, posY);
		if((Math.floor(Math.abs(startx - orix)) < 1) && (Math.floor(Math.abs(starty - oriy)) < 1)){
			clearTimeout(Timer);
			window.scroll(orix,oriy);
		}else if(posX != orix || posY != oriy){
			Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
		}else{
			clearTimeout(Timer);
		}
	}

function menuOn(imgEl)
{
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}

function menuOut(imgEl)
{
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}// flash ¸Þ´º ¸µÅ©°ª

//ÇÏ´Ü °è¿­»ç ¸Þ´ºÀÌµ¿
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  if( selObj.selectedIndex > 0 ) {
  	window.open(selObj.options[selObj.selectedIndex].value, 'winGlobal');
  }
}

function GoMenu(aa) {
	
	if (aa == "b1") {parent.document.location = "/?code=02&subp=01"; }
	if (aa == "b2") {parent.document.location = "/?code=02&subp=02"; }
	if (aa == "b3") {parent.document.location = "/?code=02&subp=03"; }
	if (aa == "b4") {parent.document.location = "/?code=02&subp=04"; }
	
	//if (aa == "m0") {parent.document.location = "/"; }
	if (aa == "m1") {parent.document.location = "/?code=01&subp=01"; }
	if (aa == "m11") {parent.document.location = "/?code=01&subp=01"; }
	if (aa == "m12") {parent.document.location = "/?code=01&subp=02"; }
	if (aa == "m13") {parent.document.location = "/?code=01&subp=03"; }
	if (aa == "m14") {parent.document.location = "/?code=01&subp=04"; }
	if (aa == "m15") {parent.document.location = "/?code=01&subp=05"; }
	if (aa == "m16") {parent.document.location = "/?code=01&subp=06"; }
	if (aa == "m17") {parent.document.location = "/?code=01&subp=07"; }
	if (aa == "m18") {parent.document.location = "/?code=01&subp=08"; }
	if (aa == "m19") {parent.document.location = "/?code=01&subp=09"; }
	if (aa == "m20") {parent.document.location = "/?code=01&subp=10"; }
	
	if (aa == "m2") {parent.document.location = "/?code=02&subp=01"; }
	if (aa == "m21") {parent.document.location = "/?code=02&subp=01"; }
	if (aa == "m22") {parent.document.location = "/?code=02&subp=02"; }
	if (aa == "m23") {parent.document.location = "/?code=02&subp=03"; }
	if (aa == "m24") {parent.document.location = "/?code=02&subp=04"; }

	if (aa == "m3") {parent.document.location = "/?code=03&subp=01"; }
	if (aa == "m31") {parent.document.location = "/?code=03&subp=01"; }
	if (aa == "m32") {parent.document.location = "/?code=03&subp=02"; }
	if (aa == "m33") {parent.document.location = "/?code=03&subp=03"; }

	if (aa == "m4") {parent.document.location = "/?code=04&subp=01"; }
	if (aa == "m41") {parent.document.location = "/?code=04&subp=01"; }
	if (aa == "m42") {parent.document.location = "/?code=04&subp=02"; }
	if (aa == "m43") {parent.document.location = "/?code=04&subp=03"; }
	if (aa == "m44") {parent.document.location = "/?code=04&subp=04"; }
	if (aa == "m45") {parent.document.location = "/?code=04&subp=05"; }
	if (aa == "m46") {parent.document.location = "/?code=04&subp=06"; }

	if (aa == "m5") {parent.document.location = "/?code=05&subp=01"; }
	if (aa == "m51") {parent.document.location = "/?code=05&subp=01"; }
	if (aa == "m52") {parent.document.location = "/?code=05&subp=02"; }

	if (aa == "m6") {parent.document.location = "/?code=06&subp=01"; }
	if (aa == "m61") {parent.document.location = "/?code=06&subp=01"; }
	if (aa == "m62") {parent.document.location = "/?code=06&subp=02"; }
	if (aa == "m63") {parent.document.location = "/?code=06&subp=03"; }


	
}

function _jsPIMG(v1)
{
	document.PIMG.src = v1;
}