/* Title */
//document.title="Çàº¹ÇÏ¼¼¿ä. ¡º 63City ¡» ¿¡ ¿À½Å °ÍÀ» È¯¿µÇÕ´Ï´Ù..";
document.title="Çàº¹ÇÏ¼¼¿ä.63ºôµù¿¡ ¿À½Å °ÍÀ» È¯¿µÇÕ´Ï´Ù..";

/**
 * Created on 2003-08-30
 *
 * @author Yong-sang Cho
 */
 function _NSID_(obj) {
	document.write(obj.text);
	obj.id="";
}

/* PNG Img */
function setPNG24(obj) {
	obj.width=obj.height=1;
	obj.className=obj.className.replace(/\bPNG24\b/i,'');
	obj.style.filter =
	"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src='';
	return '';
}

/* Blur */

//¸µÅ© ÁÖº¯ Á¡¼± ¾ø¾Ö±â
var myAnchors=document.all.tags("A");
function allblur() {
	for (i=0;i<myAnchors.length;i++) {
		myAnchors[i].onfocus=new Function("blur()");
	}
}

allblur();

function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus();
}
document.onfocusin=bluring;



/* RollOver */
function ImageOver(imgEL){
	imgEL.src = imgEL.src.replace(".gif", "_.gif");
}
function ImageOut(imgEL){
	imgEL.src = imgEL.src.replace("_.gif", ".gif");
}

/* Image Tab RollOver */
function TabImageOver(imgEL){
	if (  imgEL.src.indexOf("_" + String(char_idx) ) < 1 ) {
		imgEL.src = imgEL.src.replace(".gif", "_.gif");
	}
}
function TabImageOut(imgEL){
	// ÀÌ¹ÌÁö¸í¿¡ _.gif°¡ Æ÷ÇÔµÇ¾úÀ» °æ¿ì¿¡¸¸ µ¿ÀÛ!
	if (  imgEL.src.indexOf("_" + String(char_idx)  ) < 1 ) {
		imgEL.src = imgEL.src.replace("_.gif", ".gif");
	}

}

/* Dic List */
function initToggleDefList(listEl) {
        listEl.currentItem = false;
        listEl.dtList = listEl.getElementsByTagName("dt");
        listEl.ddList = listEl.getElementsByTagName("dd");

        for (i=0; i<listEl.getElementsByTagName("dt").length; i++) {
                listEl.dtList.item(i).dlEl = listEl;
                listEl.dtList.item(i).listNum = i;
                listEl.dtList.item(i).onclick = toggleDefinitionList;
        }
}

function toggleDefinitionList() {
        if (this.dlEl.dtList.item(this.dlEl.currentItem) && this.dlEl.ddList.item(this.dlEl.currentItem) && this.dlEl.currentItem != this.listNum) {
                this.dlEl.dtList.item(this.dlEl.currentItem).className = null;
                this.dlEl.ddList.item(this.dlEl.currentItem).className = null;
        }

        if (this.dlEl.ddList.item(this.listNum).className == "on") {
                this.dlEl.dtList.item(this.listNum).className = null;
                this.dlEl.ddList.item(this.listNum).className = null;
        } else {
                this.dlEl.dtList.item(this.listNum).className = "on";
                this.dlEl.ddList.item(this.listNum).className = "on";
        }

        this.dlEl.currentItem = this.listNum;
}


/* Shopping Sort List Box */
function gn_ClickSortList( nType )
{
	document.all.SortBox1.style.display = 'none';
	document.all.SortBox2.style.display = 'none';

	if ( nType == 1 )
		document.all.SortBox1.style.display = '';
	else if ( nType == 2 )
		document.all.SortBox2.style.display = '';
}

/* Shopping Goods Num*/
function setncheck(){

	var chkflag=true;
	num = document.ProdDetail.cnt.value

	for(var i =0;i<num.length;i++){
		c=num.charAt(i);
	    if(!(c>='0' && c<='9')) {
     		chkflag = false;
    		break;
	    }
	}
	if(chkflag == false) document.ProdDetail.cnt.value = 1;
}
function setProdCNT(type){
	cnt = document.ProdDetail.cnt.value;
	cnt = ncheck(cnt);
	if(type == 'up'){
		if(cnt >= 1 && cnt <= 999)
			document.ProdDetail.cnt.value = eval(eval(cnt)+1);
		else
			document.ProdDetail.cnt.value = 1;
	}else{
		if(cnt > 1)
			document.ProdDetail.cnt.value = eval(eval(cnt)-1);
		else
			document.ProdDetail.cnt.value = 1;
	}
	return;
}
function ncheck(num){
	var chkflg=true;
	for(var i =0;i<num.length;i++){
		c=num.charAt(i);
	    if(!(c>='0' && c<='9')) {
	            chkflag=false;
	            break;
	    }
	}
	if(chkflg) return num;
	else return 1;
}


// faq »ç¿ë
function initToggleDefList(listEl) {
        listEl.currentItem = false;
        listEl.dtList = listEl.getElementsByTagName("dt");
        listEl.ddList = listEl.getElementsByTagName("dd");

        for (i=0; i<listEl.getElementsByTagName("dt").length; i++) {
                listEl.dtList.item(i).dlEl = listEl;
                listEl.dtList.item(i).listNum = i;
                listEl.dtList.item(i).onclick = toggleDefinitionList;
        }
}

function toggleDefinitionList() {
        if (this.dlEl.dtList.item(this.dlEl.currentItem) && this.dlEl.ddList.item(this.dlEl.currentItem) && this.dlEl.currentItem != this.listNum) {
                this.dlEl.dtList.item(this.dlEl.currentItem).className = null;
                this.dlEl.ddList.item(this.dlEl.currentItem).className = null;
        }

        if (this.dlEl.ddList.item(this.listNum).className == "on") {
                this.dlEl.dtList.item(this.listNum).className = null;
                this.dlEl.ddList.item(this.listNum).className = null;
        } else {
                this.dlEl.dtList.item(this.listNum).className = "on";
                this.dlEl.ddList.item(this.listNum).className = "on";
        }

        this.dlEl.currentItem = this.listNum;
}

// faq»ç¿ë
var old_menu = '';
function menuclick(submenu)
{
	if( old_menu != submenu ) {
		if( old_menu !='' ) {
		old_menu.style.display = 'none';
	}
		submenu.style.display = 'block';
		old_menu = submenu;
	} else {
		submenu.style.display = 'none';
		old_menu = '';
	}
}

/***** Ç¥ÁØÇü SCROLL TOP ************************************************************/


function A2YSlide(name,id,range,sec,tb,margin){ //°´Ã¼¸í,·¹ÀÌ¾îid,ÀÌµ¿°ª,ÀÌµ¿ÃÊ,»óÇÏÀ§Ä¡(false)?t:b,°è»êµÈ »óÇÏ À§Ä¡¿¡¼­ ¶³¾îÁú ¹üÀ§
	//¼Ó¼º
	this.name = name;
	this.obj = document.getElementById(id);
	this.range = range;
	this.sec = sec;
	this.tb = tb;
	this.margin = margin;

	this.Timer();
}

/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬private ¸Þ¼Òµå ÇÔ¼ö ¼±¾ðºÎ¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
A2YSlide.prototype.Move = function A2YSlide_Move(fix_y){
	objY = parseInt(this.obj.style.top);
	if(objY != fix_y){
		this.obj.style.top = (objY + this.GetMoveValue(objY,fix_y)) + 'px';
	}
	this.Timer();
}

A2YSlide.prototype.GetMoveValue = function A2YSlide_GetMoveValue(start, end){ //ÇöÀç À§Ä¡¿Í ÀÌµ¿ÇÒ À§Ä¡¿¡ µû¸¥ ÀÌµ¿°Å¸®¸¦ ¸®ÅÏÇÑ´Ù.
	return (end - start) * this.range;
}

A2YSlide.prototype.GetDocTnB = function A2YSlide_GetDocTnB(bTB){ //¹®¼­ÀÇ »ó´ÜorÇÏ´Ü ÇÈ¼¿°ªÀ» ¹ÝÈ¯ÇÑ´Ù. (!bTB) ? Top : Bottom
	return ((bTB)?document.documentElement.clientHeight:0) + document.documentElement.scrollTop;
}

A2YSlide.prototype.Timer = function A2YSlide_Timer(){
	setTimeout(this.name + '.Move('+(this.GetDocTnB(this.tb)+this.margin)+')',this.sec);
}


/*¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¿ÜºÎ ¸¶¹ý»ç ÄÚµå¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬¦¬*/
function A2Wzd_YSlide(id,range,sec,tb,margin){ //A2YSlideÀÇ »ý¼ºÀ» µµ¿ÍÁØ´Ù.
	eval('C'+id+" = new A2YSlide('C"+id+"','"+id+"',"+range+","+sec+","+tb+","+margin+');');
	//½ÇÇà¿¹ - CSMenu = new A2YSlide('CSMenu','SMenu',0.2,10,0,50); => varÀ» »ç¿ëÇÏÁö ¾ÊÀº Àü¿ªº¯¼ö¸¦ »ý¼ºÇÑ´Ù.
}

function OnTop(){
	scrollTo(0,0);
}



/*ActiveX ÇÃ·¡½¬<script>Flash(¡®mnav¡¯,¡®/Common/fla.mnav.swf¡¯, ¡®960¡¯, ¡®160¡¯, ¡®#FFFFFF¡¯, ¡®transparent¡¯);</script>*/
// id: flash id // allowScriptAccess=sameDomain/always
// url: source url
// w: source width
// h: source height
// t: wmode (window/transparent/opaque)
function FlashStr(id,url,w,h,bg,t){
	return ("\
<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+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='always' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}
function Flash(id,url,w,h,bg,t){
document.write("\
<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+">\
<param name='movie' value="+url+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='always' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}
function FlashObj(id,url,param,w,h,bg,t){
document.write("\
<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+">\
<param name='movie' value="+url+" />\
<param name='FlashVars' value="+param+" />\
<param name='wmode' value="+t+" />\
<param name='bgcolor' value="+bg+" />\
<param name='allowScriptAccess' value='always' />\
<param name='quality' value='high' />\
<param name='menu' value='false' />\
<embed src="+url+" width="+w+" height="+h+" name="+id+" bgcolor="+bg+" allowScriptAccess='always' quality='high' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />\
</object>\
");
}


/* ÆäÀÌÁö°æ·Î ***************************************************************************************************************/
// XML¸µÅ©
var xmlDoc , lineMapStr = "" , currentPath="" , index = 0;
var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');
var ie = (typeof window.ActiveXObject != 'undefined');

//importXML("/inc/js/menu.xml");
function importXML(file) {
	if (moz) {
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.async = false;
	} else if (ie) {
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = false;
	}
	xmlDoc.load(file);
}

function getLineMapNode(id){
	var menuXpath , node;
	menuXpath = "//menu[@id='" + id + "']";
	if (moz) {
		node = xmlDoc.evaluate(menuXpath, xmlDoc, null, 9,null).singleNodeValue;
	} else if (ie) {
		node = xmlDoc.selectSingleNode(menuXpath);
	}
	return node;
}

function setString(node){
	var spStr = "" , last="";
	var name = node.getAttribute("name");
	var url  = node.getAttribute("url");
	var nodeId  = node.getAttribute("id");

	if(index++ != 0) spStr = "<span class='ico'></span>";
	if(node != xmlDoc.documentElement) 	setString(node.parentNode);
//		lineMapStr += name + spStr;
	if(currentPath != nodeId)
		lineMapStr += "<a href='"+url+"'>"+ name+"</a>" + spStr;
	else
		lineMapStr += "<em class='point1'>"+ name+"</em>" + spStr;
}

function path(id){
	try{
		var node = getLineMapNode(id);
		lineMapStr = "";
		index = 0;
		currentPath=id;
		setString(node);
		document.write(lineMapStr);
	}catch(e){
		if(node == null){
			document.write("¾ÆÀÌµð°¡ Á¸Àç ÇÏÁö ¾Ê½À´Ï´Ù : " + id);
		}else{
			document.write("¿¹¿ÜÃ³¸® ¹ß»ý : " +  e);
		}
	}
}

function name(id){
	var node = getLineMapNode(id);
	var name  = node.getAttribute("name");
	var url  = node.getAttribute("url");
	var nameStr = "<a href='"+url+"'>"+ name+"</a>";
	document.write(nameStr);
}


function link(){
	var id = "";
	var depth = arguments.length;
	try {
		if(depth==0) return;
		else if(depth==1) id = eval("'"+arguments[0]+"'");
		else if(depth==2) id = eval("'"+arguments[0]+"_"+arguments[1]+"'");
		else if(depth==3) id = eval("'"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"'");
		else if(depth==4) id = eval("'"+arguments[0]+"_"+arguments[1]+"_"+arguments[2]+"_"+arguments[3]+"'");

		if(id=="") { alert("ÁØºñÁßÀÔ´Ï´Ù."); }
		else {
			var node = getLineMapNode(id);
			var url  = node.getAttribute("url");
			location.href = url;
		}

	}catch(e) { alert("ÁØºñÁßÀÔ´Ï´Ù."); }
}



/* Popup */
function pop(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=no') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½)
function pops(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
function popr(url,name,w,h){ window.open(url,name,'width='+w+',height='+h+',scrollbars=auto,resizable=1') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½)
function popL(url,name,w,h,t,l){ window.open(url,name,'top='+t+',left='+l+',width='+w+',height='+h+',scrollbars=auto') } //Popup(½ºÅ©·Ñ¹Ù¾øÀ½), À§Ä¡ÁöÁ¤
function popsL(url,name,w,h,t,l){ window.open(url,name,'top='+t+',left='+l+',width='+w+',height='+h+',scrollbars=yes') } //Popup(½ºÅ©·Ñ¹ÙÀÖÀ½), À§Ä¡ÁöÁ¤
function newwin(url,w,h){ window.open(url,'new','width='+w+',height='+h+',location=1,directories=1,resizable=1,status=1,toolbar=1,menubar=1,scrollbars=1') } //NewPopup(½ºÅ©·Ñ¹Ù¾øÀ½)

/*******************************************************************
	¼³  ¸í :
	ÆÄ¶ó¸ÞÅÍ :
	ÀÛ¼ºÀÚ : ±èÁ¾¹Î
*******************************************************************/
function onFileUpload(uploadType, subDir,formNameVar, fileNameVar){
	fileup = window.open("/xuc63city/common/popup/fileUpload.jsp?uploadType=" + uploadType
				+ "&subDir=" + subDir
				+ "&formNameVar=" + formNameVar
				+ "&fileNameVar=" + fileNameVar,"FileUpload","width=400,height=185");
    fileup.focus();
}

var flashPath = "/home/63CITY";

//Å©·¹¼¾µµ ½ºÅ©¸³Æ® ½ÃÀÛ 

var EchoID = "63city63";
var EchoGoodNm = "";
var EchoAmount = "";
var EchoUIP = "";
var EchoTarget = "e63.co.kr";

document.writeln("<scr"+"ipt language='javascr"+"ipt' src='http://www.63.co.kr/home/63CITY/inc/js/EchoScriptV2.js'></scr"+"ipt>");


// Acecounter ·Î±×ºÐ¼® ASP¿ë
if( typeof NU_rl == 'undefined'){
function get_cook_Value(str,name,div){
        str = str + div ;
        while(str.indexOf(div) > -1){
                tmpstr = str.substring(0,str.indexOf(div));
                str = str.substring(str.indexOf(div)+div.length,str.length);
                if( tmpstr.indexOf(name+'=') == 0 ){
                        return tmpstr.substring(name.length+1,tmpstr.length);
                }
        }
        return '';
}
// Acecounter ·Î±×ºÐ¼® ASP¿ë
// AC_USERINFO ºÐ¼®

var NL_gd = 'unknown';
var NL_id = '';
var NL_mr='unknown';
var NL_ag = 0;

var NL_cookie = unescape(get_cook_Value(document.cookie,'LOGCK','; '));
if( NL_cookie.length > 0 ){
	var NL_spl = NL_cookie.split(':');
	NL_id = NL_spl[0];
	NL_ag = parseInt(NL_spl[1]);
	NL_mr = (NL_spl[2]=='1'?'married':'single');
	NL_gd = (NL_spl[3]=='1'?'man':'woman');
}
//var NL_id = NL_cookie;
// »ç¿ëÀÚ ¼ºº°
// º¯¼ö°ª : 'man' or 'woman' or 'unknown'
if( document.URL.indexOf('/home/63CITY/member/memberJoin_step4.jsp') > 0 ){
	var NL_jn = 'join';
}

// Acecounter ±âº» ÄÚµå
var NU_rl = 'http://'+'203.231.48.50:8088'; var NCHKIMG = new Image(); var NL_bn=navigator.appName;
if( NL_bn.indexOf("Netscape") > -1 || NL_bn=="Mozilla"){
setTimeout("NCHKIMG.src = NU_rl+'/?cookie';",1); } else{ NCHKIMG.src = NU_rl+'/?cookie'; };
document.writeln("<scr"+"ipt language='javascr"+"ipt' src='http://www.63.co.kr/home/63CITY/inc/js/loginside_subscr"+"ipt.js'></scr"+"ipt>");
}


//allMenu ChgMode;
function openAllMenuLayer(){
	var objAllMenu = document.getElementById("allMenu");
	objAllMenu.style.display = "block";
	objAllMenu.innerHTML = FlashStr('allmenu', '/home/63CITY/swf/63city_allView.swf?sPath=/home/63CITY/swf/', 567, 445, '#ffffff', 'transparent')
}

function closeAllMenuLayer(){
	var objAllMenu = document.getElementById("allMenu");
	objAllMenu.style.display = "none";	
}
