/* !!! ÀÌ ÆÄÀÏÀ» °¢ js ÆÄÀÏÀ» mergeÇÏ¿© ¸¸µé¾îÁý´Ï´Ù. ÀÌÆÄÀÏÀ» Á÷Á¢ ¼öÁ¤ÇÏÁö ¸¶¼¼¿ä !!! */
/* [gnb.js] */
/*** 1. ÇÔ¼ö  ****************************************************************************************/
//url ÀÌµ¿
function goTopUrl(url, code) {
	goStatUrl(url, code);
}
//2008-12-23 GNB GIF ¾Ö´Ï¸ÞÀÌ¼Ç ÀÌ¹ÌÁö Á¤Áö ¼³Á¤/ÇØÁ¦¸¦ À§ÇÑ Ãß°¡
function gifSetCookie( name, value, expiredays )	{
    var todayDate = new Date();
    todayDate.setDate( todayDate.getDate() + expiredays );
    document.cookie = name + '=' + escape( value ) + '; path=/; domain=11st.co.kr;  expires=' + todayDate.toGMTString() + ';';
}
function setHomePage()
{
	try{
		document.getElementById('lay_direct').style.behavior='url(#default#homepage)';
		document.getElementById('lay_direct').setHomePage('http://www.11st.co.kr/connect/Gateway.tmall?method=Xsite&tid=1000013091');
	}catch(e){}
}
function deleteCookie(cookieName)	{
	  var expireDate = new Date();
	  var domain = "www.11st.co.kr";
	  if(cookieName != null && cookieName == "TMALL_MY_IMGSTOP"){
		  domain = "11st.co.kr";
	  }
	  expireDate.setDate(expireDate.getDate()-1);
	  document.cookie = cookieName + "= " + "; path=/; domain="+domain+";  expires=" + expireDate.toGMTString() + ";";
}

function checkImageStop(n) {
	if(n == 1) {
		try {
			gifSetCookie( "TMALL_MY_IMGSTOP","Stop",1);
			document.execCommand("Stop");
		} catch(e) {
		}
	} else {
		deleteCookie("TMALL_MY_IMGSTOP");
		window.location.href = window.location.href;
	}
}

//2009.03.12 È¸¿ø Á¤º¸ ¸µÅ© ¼öÁ¤ ===========================
/**
 * ¼­¹ö¿¡¼­ cookie °ªÀ» ºÒ·¯¿Â´Ù.
 * ÀÏ¹Ý ÄíÅ°ÀÎ °æ¿ì paramName¿¡ ÄíÅ°¸í
 * ÀÎÁõ ÄíÅ°ÀÎ °æ¿ì authParamName¿¡ ÀÎÁõÄíÅ°¸íÀ» ³Ñ±ä´Ù.
 * callBackÀº call back script function¸í.
 * callBack functionÀÇ argument·Î ÄíÅ°°ªÀ» ³Ñ±ä´Ù.
 *
 * paramName,  authParamName ´Â µÑÁß ÇÏ³ª¸¸ ÆÄ¶ó¹ÌÅÍ·Î ³Ñ±ä´Ù.(¹èÅ¸ÀûÀ¸·Î »ç¿ëÇØ¾ßÇÔ.)
 */
function getSeverCookieVal( paramName, authParamName, callBack ) {
	var url = "http://www.11st.co.kr/register/checkCookie.tmall" ;
	var params = "method=getCookieVal&param="+paramName+"&authParam="+authParamName ;
	callAjax( url, params, callBack ) ;
	//var returnVal  = callAjaxPost( url, params, '' ) ;
	//alert ( '['+returnVal+']' ) ;
}
/*** 2. È¸¿ø/·Î±×ÀÎ °ü·Ã ¸µÅ©/¾×¼Ç   ***************************************************************************************/
function getAuthGubun() {
	getSeverCookieVal( '', 'gubun', 'goMemberInfoPageByGubun' ) ;
}

//11¹ø°¡ ¾÷±×·¹ÀÌµå °ü·Ã ¼öÁ¤ (2009.07.23 Àå¿ì¿µ) - Start
function goMemberInfoPages()	{
	var loc = top.location ;
	loc.href = "http://www.11st.co.kr/confirmPassword.page" ;
}

function goMemberInfoPagesAfter() {
	getSeverCookieVal( '', 'type', 'goMemberInfoPageByType' ) ;
}
//11¹ø°¡ ¾÷±×·¹ÀÌµå °ü·Ã ¼öÁ¤ (2009.07.23 Àå¿ì¿µ) - End
/////////////////////////////////////////////////////////

function goMemberInfoPageByType( returnVal ) {
	if ( returnVal == '01' ) { // ±¸¸Å
		goFrontMemberInfoPage() ;
	} else if ( returnVal == '02' ) { // ¼¿·¯
		getAuthGubun() ;
	} else {
		goSOMemberInfoPage() ;
	}
}

function goMemberInfoPageByGubun( returnVal ) {
	if ( returnVal == '01' ) { // °³ÀÎ
		goFrontMemberInfoPage() ;
	} else {	// »ç¾÷ÀÚ.
		goSOMemberInfoPage() ;
	}
}

function goFrontMemberInfoPage(code) {
	goStatUrl(_GNB_CONTEXT_PATH_ + "/register/memInfoEditForm.tmall?method=getMemberInfo",code);
}

function goSOMemberInfoPage() {
	var url = "http://soffice.11st.co.kr/Index.tmall?contentURL=/register/SellerInfoEdit.tmall?method=sellerInfoEdit" ;
	window.open( url , '','' ) ;
}

//·Î±×ÀÎ
function login(code)	{
	var retUrl 	= encodeURIComponent(document.location.href);
	var xFrom 	= "";
	if ( retUrl == _GNB_CONTEXT_PATH_ + "/html/main.html" )	{
		xFrom = "main^gnb";
	}
	goStatUrl(_LOGIN_TARGET_URL_+"/login/Login.tmall?returnURL=" + retUrl + "&xfrom=" + xFrom, code);
}

//·Î±×¾Æ¿ô
function logout(code)	{
	var retUrl 	= encodeURIComponent(document.location.href);
	var xFrom 	= "";
	if ( retUrl == _GNB_CONTEXT_PATH_ + "/html/main.html" )	{
		xFrom = "main^gnb";
	}
	try{SCP_INIT.stop();}catch(e){};
	goStatUrl(_GNB_CONTEXT_PATH_+"/login/Logout.tmall?xfrom=" + xFrom, code);
}

//È¸¿ø°¡ÀÔ
function join(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/register/memberSubscribeForm.page",code);
}

//È¸¿øÁ¤º¸
function myinfo(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/register/memInfoEditForm.tmall?method=getMemberInfo&xfrom=main^gnb', code);
}

//My tMall
function mymall()	{
	// alert('My tMall');
}

//Àå¹Ù±¸´Ï
function keep(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/cart/CartAction.tmall?method=getCartList&xfrom=main^gnb',code);
}

//°í°´¼¾ÅÍ
function c_center()	{
	// alert('°í°´¼¾ÅÍ');
}

//»óÇ°µî·Ï
function item()	{
	// alert('»óÇ°µî·Ï');
}

//¼¿·¯¸ô
function seller()	{
	// alert('¼¿·¯Åø');
}

//chapping
function chap(code)	{
	if (CP_IS_AUTH)
	{
		var url = 'http://chatping.11st.co.kr/Chatping/ChatpingAgreement.tmall';
		chatping = window.open(url, 'chatping', 'width=700,height=600,top=10,left=10,scrollbars=no,dependent=yes,status=no,resizable=yes');
	}
	else
		openLogin(1);
	doCommonStat(code);
}

//¹ÂÁ÷ ÇÃ·¹ÀÌ
function Popup()	{
	_width = "300";
    var pos_x = parseInt( (screen.width-_width) );
    windowprops = "width=300,height=176,scrollbars=no, dependent=yes,left=" + pos_x + ",top=0";
    //preview = window.open("http://www.11st.co.kr/jsp/common/musicPopup.jsp", "player", windowprops);
    preview = window.open("http://bgm.11st.co.kr/tmall/player/tmall_player.php", "player", windowprops);
}

//°Ë»ö
function r_search(search_by, search_word)	{
	alert(search_by+': '+search_word);
}

//ÀÚ¿¬¾î°Ë»ö
function f_search()	{
       var gnbFormObj = document.forms["GNBSearchForm"];
       var keyword = gnbFormObj.naturalKwd.value;

       if ( keyword == "" ) {
             alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
             // return false;
       } else {
    	   goStatUrl("http://search.11st.co.kr/SearchEmotionAction.tmall?method=getSearchEmotion&targetTab=P&isGnb=Y&kwd=" + keyword);
       }
}

//2008.10.09 ¹Ù·Î°¡±â ¾ÆÀÌÄÜ ÆË¾÷ Ãß°¡
function shortcutPopup() {
	window.open('http://www.11st.co.kr/ocx/pop_direct.jsp','shortcutPopup','width=203,height=135,left=250,top=140,resizable=no,scrollbars=no');
}
/*** 3. UI ¼³Á¤ ***************************************************************************************/
//»ö»ó
function displayPopup(url, width, height)	{
	window.open(url,'popup','width='+width+',height='+height+',top=100,left=100,scrollbars=no');
}

//»ö»óº¯°æ
function changeColor(n)	{
  	var todayDate = new Date();
  	todayDate.setDate(todayDate.getDate() + 365);
 	// alert("ÄíÅ°ÀúÀåÁß....")
  	document.cookie = "BROWSING_MAIN_COLOR=" + n + "; domain=.11st.co.kr" + "; path=/; expires=" + todayDate.toGMTString();

	skinChagne(n);
	if(document.getElementById("mainbanner")){//ºôº¸µåÇÃ·¡½¬¿ë
		changeFlashMainBillboardTheme(n);
	}
}

//11¹ø°¡ ½ºÅ² ¼³Á¤
function getSkinCss()	{
	var color = getCookie("BROWSING_MAIN_COLOR");
	var strHead = "";

	if(color == '2')
		strHead ='<link rel="stylesheet" href="' + _IMG_PATH_ + '/css/common/gnbSkin_2.css" type="text/css">';
	else if(color == '3')
		strHead ='<link rel="stylesheet" href="' + _IMG_PATH_ + '/css/common/gnbSkin_3.css" type="text/css">';
	else if(color == '4')
		strHead ='<link rel="stylesheet" href="' + _IMG_PATH_ + '/css/common/gnbSkin_4.css" type="text/css">';
	else
		strHead ='<link rel="stylesheet" href="' + _IMG_PATH_ + '/css/common/gnbSkin_1.css" type="text/css">';

	return strHead;
}

//½ÃÀÛ ÆäÀÌÁö ¼³Á¤
function setMainPage(code)	{
	var mainPage = getCookie("BROWSING_MAIN_PAGE");		// ½ÃÀÛÆäÀÌÁö¸¦ ºü¸¥À¸·Î 01, Áñ°Å¿îÀ¸·Î 02
	if(mainPage ==null || mainPage == "") mainPage = "01";
	if(code == null || code == "" ) code = "01";

	if ( mainPage != code )	{
		if ( code == "01" )	{
			quickShopping();
		} else if ( code == "02" )	{
			happyShopping();
		}
	}
}

//11¹ø°¡ GNB BI
function setGnbBI()	{
	try	{
		var biDivObj = document.getElementById("gnb_bi_div");
		if (_gnbBIImgUrl.substr(_gnbBIImgUrl.length-4,4).toLowerCase() == ".swf" )	{
			biDivObj.innerHTML = "";
			biDivObj.className = "MAinLogoZ_Fsh";
			var so = new SWFObject(getUploadImgUrl(_gnbBIImgUrl),"f_MAinLogoZ_Fsh","194","65","9.0.115");
			so.addParam("allowScriptAccess", "always");
			so.addParam("allowFullScreen", "false");
			so.addParam("quality", "high");
			so.addParam("bgcolor", "#ffffff");
			so.addParam("wmode", "transparent");
			so.addParam("scale", "noscale");
			so.addParam("menu", "false");
			so.addParam("align", "middle");
			so.addParam("salign", "t");
			so.write("gnb_bi_div");
		}	else	{
			if ( _gnbBIStyle != null && _gnbBIStyle != "" )	{
				biDivObj.className = _gnbBIStyle;
			}
			var biLinkObj = document.getElementById("gnb_bi_link");
			var biImgObj = new Image();
			biImgObj.src = getUploadImgUrl(_gnbBIImgUrl);
			biLinkObj.innerHTML = "";
			biLinkObj.appendChild(biImgObj);
		}
	} catch (ex)	{
		//jsLog();
	}
}

//11¹ø°¡ °ü¸® ¼³Á¤
function setGnb11stSetup()	{
	var mainPage = getCookie("BROWSING_MAIN_PAGE");		// ½ÃÀÛÆäÀÌÁö¸¦ ºü¸¥À¸·Î 01, Áñ°Å¿îÀ¸·Î 02
	if(mainPage ==null || mainPage =="") mainPage = "01";
	var checkImage = getCookie("TMALL_MY_IMGSTOP");

	if(mainPage == "01") {
		document.getElementById("start_01").checked = true;
	}	else if (mainPage == "02") {
		document.getElementById("start_02").checked = true;
	}

	if(checkImage == "") {
		document.getElementById("imgstop_0").checked = true;
	}	else	{
		document.getElementById("imgstop_1").checked = true;
	}
}

//GNB È¸¿ø ¿µ¿ª
function setGnbMember()	{
	var gnb_login = document.getElementById("gnb_login");
	var gnb_member = document.getElementById("gnb_member");
	if(!funcCheckIsLogin()) {
		gnb_login.className = "mYInFo_Login";
		gnb_login.innerHTML = '<a href="javascript:login(\'A0106\');">·Î±×ÀÎ<\/a>';
		gnb_member.innerHTML = '<a href="javascript:join(\'A0107\');">È¸¿ø°¡ÀÔ<\/a>';
	} else {
		gnb_login.className = "mYInFo_off";
		gnb_login.innerHTML = '<a href="javascript:logout();">·Î±×¾Æ¿ô<\/a>';
		gnb_member.innerHTML = '<a href="javascript:goMemberInfoPages();">È¸¿øÁ¤º¸<\/a>';
	}
}

//GNB °Ë»ö ¿µ¿ª ¼³Á¤
function setGnbSearch()	{
/*
	var color = getCookie("BROWSING_MAIN_COLOR");
	if ( color == null || color == "" )	color = 1;
	document.getElementById("GNB_btn").src = "/img/common/gr/topSearch_btn_search"+color+".gif";
*/
	// °Ë»ö¹Ù ¹è³Ê ¼¼ÆÃ
	var bnrImg = "";
	var bnrLink = "";
	var arrIdx = 0;
	var isSrchDomain = document.location.href.indexOf("http://search.11st.co.kr") > -1 ? true : false;

	try {
		if(!isSrchDomain && _dataIdx.length > 0) {
			arrIdx = parseInt(_dataIdx[Math.round(Math.random()*(_dataIdx.length-1))]);
			bnrImg  = _dataText[arrIdx];
			bnrLink = _dataLink[arrIdx];
		}
	} catch(e) {}

	if(bnrImg != "") {
		var AKCKwd = document.getElementById("AKCKwd");
		AKCKwd.value = bnrImg;
		AKCKwd.className = "adver";
		document.getElementById("adUrl").value = bnrLink;
	}

}

//GNB °Ë»ö ¿µ¿ª ¼³Á¤ + Ad Tracking
function setGnbSearchTrc( aId, typGubn, areaGubn )	{

	// °Ë»ö¹Ù ¹è³Ê ¼¼ÆÃ
	var bnrImg = "";
	var bnrLink = "";
	var bnrTrc = "";
	var aObj = document.getElementById(aId);
	var aObjTrcDivId = document.getElementById(aId+"_divId");
	var arrIdx = 0;
	var isSrchDomain = document.location.href.indexOf("http://search.11st.co.kr") > -1 ? true : false;

	try {
		if(!isSrchDomain && _dataIdx.length > 0) {
			arrIdx = parseInt(_dataIdx[Math.round(Math.random()*(_dataIdx.length-1))]);
			bnrImg  = _dataText[arrIdx];
			bnrLink = _dataLink[arrIdx];
			bnrTrc = _dataTrc[arrIdx];
		}
	} catch(e) {}

	if(bnrImg != "") {
		var tmpOnclick = aObj.onclick;
		aObj.onclick = function()
		{
			try {
				eval(tmpOnclick)();
			} catch (e) {}
			stck( typGubn, areaGubn, bnrTrc );
		}
		aObjTrcDivId.title = aObjTrcDivId.title + bnrTrc;

		var AKCKwd = document.getElementById("AKCKwd");
		AKCKwd.value = bnrImg;
		AKCKwd.className = "adver";
		document.getElementById("adUrl").value = bnrLink;
		var tmpUrlOnclick = document.getElementById("adUrl").onclick;
		document.getElementById("adUrl").onclick = function()
		{
			eval(tmpUrlOnclick)();
			stck( typGubn, areaGubn, bnrTrc );
		}
	}

}

//°Ë»ö¹Ù ¹è³Ê »èÁ¦
function clearAdUrl(formObj) {
	try {
		if (formObj == null )	{
			formObj = document.GNBSearchForm;
		}

		if ( formObj.adUrl.value != ""  )	{
			formObj.kwd.className = "";
			formObj.kwd.value = "";
			formObj.adUrl.value = "";
		}
	} catch(e) {
	}
}

//080104_1 Ãß°¡
function naSearch()	{
	document.getElementById("GNB_nSearch").style.display="block";
}
//__080104_1 Ãß°¡

// 2008.2.17 GNB »ö»ó º¯°æ
function changeGnbColor(n) {
	document.getElementById("gnb").setColor(n);
}

// 2008.2.22 11¹ø°¡ ¼³Á¤, ³ªÀÇ 11¹ø°¡ »ï°¢Çü ÀÌ¹ÌÁö º¯°æ
function changeTriangleImage(n) {
	imgObj = document.getElementById("gnbTriangle" + n + "");
	if(n == 1) {
		if(document.getElementById("head11stSet").style.display != "none") {
			imgObj.src = "/img/main/3rd/btn_gnb_set11stUp.gif";
		} else {
			imgObj.src = "/img/main/3rd/btn_gnb_set11st.gif";
		}
	} else if(n == 2) {
		if(document.getElementById("headMy11st").style.display != "none") {
			imgObj.src = "/img/main/3rd/utilMenu_tab_up.gif";
		} else {
			imgObj.src = "/img/main/3rd/utilMenu_tab.gif";
		}
	}
}

//GNB Left ¹è³Ê ·£´ý ³ëÃâ
function setGnb3LfBnr()	{
	try	{
		setGnbLRBnr("gnb3lfBnrUrl", gnb3lfBnrUrl, gnb3lfBnrImg);
		setGnbLRBnr("gnb3rfBnrUrl", gnb3rfBnrUrl, gnb3rfBnrImg);
	} catch (e)	{}
}

function setGnbLRBnr(aId, arrUrl, arrImg)	{
	try	{
		var aObj = document.getElementById(aId);

		if ( aObj && arrImg != null && arrUrl != null && arrImg.length > 0 )	{
			var index = Math.round(Math.random()*(arrImg.length-1));

			aObj.href = arrUrl[index];
			aObj.innerHTML = "";

			var imgObj = new Image();
			imgObj.src = getUploadImgUrl(arrImg[index]);

			aObj.appendChild(imgObj);
		}
	} catch (e)	{}
}

//GNB Left ¹è³Ê ·£´ý ³ëÃâ + Ad Tracking
function setGnb3LfBnrTrc( typGubn, areaGubn )	{
	try	{
		setGnbLRBnrTrc("gnb3lfBnrUrl", gnb3lfBnrUrl, gnb3lfBnrImg, typGubn, areaGubn, gnb3lfBnrTrc);
		setGnbLRBnrTrc("gnb3rfBnrUrl", gnb3rfBnrUrl, gnb3rfBnrImg, typGubn, areaGubn, gnb3rfBnrTrc);
	} catch (e)	{}
}

function setGnbLRBnrTrc(aId, arrUrl, arrImg, typGubn, areaGubn, arrTrc)	{
	try	{
		var aObj = document.getElementById(aId);
		var aObjTrcDivId = document.getElementById(aId+"_divId");

		if ( aObj && arrImg != null && arrUrl != null && arrImg.length > 0 )	{
			var index = Math.round(Math.random()*(arrImg.length-1));

			aObj.href = arrUrl[index];
			aObj.innerHTML = "";

			var tmpOnclick = aObj.onclick;
			aObj.onclick = function()
			{
				eval(tmpOnclick)();
				stck( typGubn, areaGubn, arrTrc[index] );
			}
			aObjTrcDivId.title = aObjTrcDivId.title + arrTrc[index];

			var imgObj = new Image();
			imgObj.src = getUploadImgUrl(arrImg[index]);

			aObj.appendChild(imgObj);
		}
	} catch (e)	{}
}

//scrolling ½Ã  ctgr_sub layer Ã¼Å©
function initCtgrSubLayPop() {
    try {
        if (_isShowCtgrSub) document.getElementById("ifrmSubCtgrAll").contentWindow.document.body.innerHTML = "&nbsp;";
    } catch(e) {
        //alert(e.message);
    }
}

function setDivSize(cate, w, h)	{
	if(cate=='CATEGORY'||cate=='CategoryNavigation'){
		_w=w;
		_h=h;
        // 2009.03.07 IE 6.0 Ãß°¡ ===========================
        if (appVer==6.0) {
            if (_w > 200) {
                document.getElementById("ifrmSubCtgrAll").style.width = _w + "px";
                document.getElementById("ifrmSubCtgrAll").style.height = "431px";
                _isShowCtgrSub = true;
            } else {
                document.getElementById("ifrmSubCtgrAll").style.width = "200px";
                document.getElementById("ifrmSubCtgrAll").style.height = "0";
                _isShowCtgrSub = false;
            }
        }
        // =========================== 2009.03.07 IE 6.0 Ãß°¡
		document.getElementById("CategoryNavigation").setAttribute("height", h);
		document.getElementById("CategoryNavigation").setAttribute("width", w);

        // ÆÐ¼Ç¸®´õ ·¹ÀÌ¾î ³ëÃâ¼ø¼­ ¼³Á¤
    	document.getElementById("fsTop_category").style.zIndex = 4;
        if(appVer==6.0) {
        	if( document.getElementById("subGoBrand").style.display == "none" ) {
		    	document.getElementById("fsTop_category").style.zIndex = 3;
        	}
        }

	}else if(cate=='SUB_CATEGORY'){	//¿ìÃø¼­ºêÄ«Å×°í¸®
		document.getElementById("CategoryNavigation").setAttribute("width",  _w+w);
		if(h>_h){
			document.getElementById("CategoryNavigation").setAttribute("height", h);
		}else{
			document.getElementById("CategoryNavigation").setAttribute("height", _h);
		}
	}
}

function setDivLeft(){
	var x=(document.body.clientWidth-980)/2;
	document.getElementById("fsTop_category").style.left = x + "px" ;
}

function openNavi()
{
	document.getElementById("CategoryNavigation").open();
	//if (appVer==6.0) selBoxHidden();
}

function closeNavi()
{
	document.getElementById("CategoryNavigation").closeSubCategory();
	document.getElementById("CategoryNavigation").close();
	//if (appVer==6.0)	selBoxView();
}

function headSel(no,optionV)	{
	obj_sel=document.getElementById("headSel_" + no);
	obj_opt=document.getElementById("headSelO_" + no)
	obj_sel.value=optionV;
	obj_opt.style.display="none";
}

// 0215 Ãß°¡
function zIndex(n,n2) {
	document.getElementById("fs_gnbSub").style.zIndex=n;
	document.getElementById("utilMenu").style.zIndex=n2;
}
// __0215 Ãß°¡

function mouseOverLi(ulId)	{
	var objUl = document.getElementById(ulId);
	objUl.value = "on";
}

function mouseOutLi(ulId)	{
	var objUl = document.getElementById(ulId);
	objUl.value = "off";
}
function mouseOutUl(ulId)    {
	if (document.getElementById(ulId).name == "true")	{
		document.getElementById(ulId).name = "false"
		setTimeout("mouseOutUlAct('" + ulId + "')",3000);
	}
}

function mouseOutUlAct(ulId)	{
	if ( document.getElementById(ulId).value == "off" )	{
		document.getElementById(ulId).style.display = "none";
	}

	document.getElementById(ulId).name = "true";
}

function cately_view(par){
	if (document.getElementById(par).style.display=="" ||document.getElementById(par).style.display=="none"){
		document.getElementById(par).style.display="block";
	}else{
		document.getElementById(par).style.display="none";
	}
}


// Ä«Å×°í¸® ¼¿·ºÆ® ¹Ú½º ·¹ÀÌ¾î ÃÊ±âÈ­
function layerChkHidden() {
	var frmCtgr = document.frmHeaderCtgr;

	if(frmCtgr.layer_chk_value.value == "open") {
		for(var i=1; i<=4; i++) {
			obj_ID=document.getElementById("headSelO_" + i + "");
			//alert(obj_ID);
			if(obj_ID != null) {
				obj_ID.style.display ="none";
				frmCtgr.layer_chk_value.value = "close";
			}else {
				break;
			}
		}
	}
}

function setSubKwd()	{
	var strHead1 = "";
	var strHead2 = "";
	if ( _arrSupKwd.length > 0 )	{
		strHead1 = strHead1	+ '<li id="gnbSKDIcon" class=""><span id="gnbSKDNo" class="num"></span><span id="gnbSKDTxt" class="txt"></span></li>';
		for ( var i = 0 ; i < _arrSupKwd.length; i++ )	{
			strHead2 = strHead2	+ '<li class="num' + (i+1) + '" onMouseOver="this.style.backgroundColor=\'#f6f6f6\';this.style.fontWeight=\'bold\';" onMouseOut="this.style.backgroundColor=\'#FFFFFF\';this.style.fontWeight=\'normal\';"  onMouseOver="this.className=\'\'"><a href="javascript:setSearchTarget(\'P\');headSel(\'0\',\'11¹ø°¡\');doCommonStat(\'C0103\');searchKwd(\'' + _arrSupKwd[i] + '\');"><span></span>' + _arrSupKwd[i] + '</a></li>';
		}

		document.getElementById("gnbSupKwd").innerHTML = strHead1;
		document.getElementById("gnbSupKwdList").innerHTML = strHead2;

		setSubKwdRolling();
	}
}

function setSubKwdRolling(curIdx)	{
	if ( _arrSupKwd.length > 0 )	{
		if ( curIdx == null || curIdx < 0 || curIdx >= _arrSupKwd.length )	{
			curIdx = 0;
		}

		var dispNo = curIdx + 1;
		document.getElementById("gnbSKDIcon").className = "icon_num" + dispNo;
		document.getElementById("gnbSKDNo").className = "num";
		if(dispNo == 10) {
			document.getElementById("gnbSKDNo").className = "num10";
		}
		document.getElementById("gnbSKDNo").innerHTML = dispNo;
		document.getElementById("gnbSKDTxt").innerHTML = _arrSupKwd[curIdx];

		self.setTimeout("setSubKwdRolling(" + dispNo + ")", 3000);
	}
}

// ÀÚµ¿¿Ï¼º Backgroud Iframe Ã³¸®
function _initDivAutoKWD() {
	try {
        if (navigator.userAgent.indexOf("MSIE 6")>-1 && navigator.userAgent.indexOf("MSIE 7")<0) {
        	if (!document.getElementById("AKCIfrmBG"))
        	{
        		var ie6_ifrm = document.createElement("iframe");

				ie6_ifrm.setAttribute("id", "AKCIfrmBG")
				ie6_ifrm.style.position = "absolute";
				ie6_ifrm.style.top = "30px";
				ie6_ifrm.style.left = "2px";
				ie6_ifrm.style.opacity = "0";
				ie6_ifrm.style.filter = "alpha(opacity=0)";
				ie6_ifrm.style.width = "257px";
				ie6_ifrm.style.height = "120px";
				ie6_ifrm.style.zIndex = "-1";
				ie6_ifrm.src = "/html/blank.html";

				document.getElementById("AKCDiv").appendChild(ie6_ifrm); //IE
        	}
        }
	} catch(e) {
	}
}

function initLayerLoad2(idName) {
	if(document.getElementById("subGoBrand").style.display == "block") {
		objLayer = document.getElementById(idName);
		objLayer.onmouseover = function () {mouseStatus2=true;}
		objLayer.onmouseout = function () {mouseStatus2=false;}
		if(!objRunFlag) {
			objRun = window.setInterval("doPlay2('"+idName+"')", "5000");
			objRunFlag = true;
		}
	}
}
function doPlay2(idName) {
	if(!mouseStatus2) {
		layerObjHide(idName);
	    document.getElementById("fsTop_category").style.zIndex = 3;
		window.clearInterval(objRun);
	}
	objRunFlag = false;
}

// ¼­ºê GNB Ä«Å×°í¸® ÀüÃ¼ º¸±â ¼¼ÆÃ
function setSubCtgrNavi(ctgrNaviXmlUrl)	{
	var color = getCookie("BROWSING_MAIN_COLOR");
	var ctgrNaviSwfUrl = getCommonImgUrl(_IMG_URL_ + "/flash/navi_2009_1028.swf");
	if ( window.document.location.protocol == "https:" )	{
		ctgrNaviXmlUrl = ctgrNaviXmlUrl.replace(".xml","_ssl.xml");
	}

	var so = new SWFObject(ctgrNaviSwfUrl, "CategoryNavigation", "100%", "100%", "9");
	so.addParam("allowScriptAccess", "always");
	so.addParam("allowFullScreen", "false");
	so.addParam("quality", "high");
	so.addParam("bgcolor", "#000000");
	so.addParam("wmode", "transparent");
	so.addParam("scale", "noscale");
	so.addParam("menu", "false");
	so.addParam("align", "middle");
	so.addParam("salign", "t");
	//============== µ¥ÀÌÅÍ ¼¼ÆÃ ½ÃÀÛ
	so.addVariable("myColor", color);
	so.addVariable("xmlPath", ctgrNaviXmlUrl);// XML °æ·Î
	//============== µ¥ÀÌÅÍ ¼¼ÆÃ ³¡
	so.write("fsTop_category");

	// 2009.03.07 IE 6.0 Ãß°¡ ===========================
	if (appVer==6.0) {
	    try{
	        if (document.getElementById("wrapBody") != null ) {
	            document.getElementById("wrapBody").attachEvent("onscroll", initCtgrSubLayPop);
	        } else {
	            parent.document.getElementById("wrapBody").attachEvent("onscroll", initCtgrSubLayPop);
	        }
	    } catch(e) {
	        //alert(e.message);
	    }
	}
	// =========================== 2009.03.07 IE 6.0 Ãß°¡
}
/*** 4. ¼­ºñ½º ¸µÅ© ***************************************************************************************/
//t-street
function t_street(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/html/tstreetMain.html',code);
}

//shopping together
function shopping(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/community/ShoppingInfoCategoryAction.tmall?method=getShoppingInfoMain',code);
}

//¿­¸°¼îÇÎ_Àü¹®°¡¸®ºä
function shoppingPR(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/community/ProfessionalReviewAction.tmall?method=getProfessionalReviewMain&xfrom=main^gnb',code);
}

//¿­¸°¼îÇÎ_Æ®·£µå´º½º
function shoppingTN(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/community/TrendNewsAction.tmall?method=getTrendNewsMain&xfrom=main^gnb',code);
}

//¿­¸°¼îÇÎ_»óÇ°¹èÆ²
function shoppingPB(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/community/ProductsBattleAction.tmall?method=getProductsBattleMain&xfrom=main^gnb',code);
}

//¿­¸°¼îÇÎ_Ã£¾ÆÁÖ¼¼¿ä
function shoppingHF(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/community/LookingForProductsAction.tmall?method=getLookingForProductsMain&xfrom=main^gnb',code);
}

//½ÎÀÌ´Ð
function gnbScinic(code)	{
	goStatUrl('http://beauty.11st.co.kr/html/beauty/scinicMain.html',code);
}

//ÇØ¿Ü¼îÇÎ
function global(code)	{
	goStatUrl('http://global.11st.co.kr',code);
}

//ÇÏ·ç¿¡Say
function talk(code)	{
	//goStatUrl('http://blog.11st.co.kr/html/talkaboutAction.html');
	goStatUrl('http://blog.11st.co.kr/community/TalkAboutAction.tmall',code);
}



//11Style(07.01)
function go11style(code)	{
	var wdt = screen.width;
	var hgt = screen.height-100;
	op = window.open(_GNB_CONTEXT_PATH_+'/html/stylezine/index.html', "11style", "location=yes,fullscreen=no,scrollbars=yes,resizable=no,left=0,top=0,width="+wdt+",height="+hgt);
	doCommonStat(code);
}

//11Style URLS(07.01)
function go11styleURL(urls, code)	{
	var wdt = screen.width;
	var hgt = screen.height-100;
	op = window.open(urls, "11style", "location=yes,fullscreen=no,scrollbars=yes,resizable=no,left=0,top=0,width="+wdt+",height="+hgt);
	doCommonStat(code);
}

//ÀüÈ­±â¾ÆÀÌÄÜ
function phone(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/ShoppingInfo.page',code);
}

//¸¶ÀÌÅ©¾ÆÀÌÄÜ
function mic(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + '/browsing/LiverankingFrontAction.tmall?method=getRealTimeStaticsList&xfrom=main^gnb',code);
}



//ºü¸¥¼îÇÎ
function quick(code)	{
	if ( code == null || code == "" )	{
		code = "A0105";
	}
	if(_ENJOY_SEARCH_VAR_ == "NONE"){
		goStatUrl(_GNB_CONTEXT_PATH_+'/html/main.html',code);
	}else{
		goStatUrl(_ENJOY_SEARCH_VAR_,code);
	}
	//to do...
}

//Áñ°Å¿î¼îÇÎ
function fun(code)	{
	//goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/specialcorner/AuthTmapFrontAction.tmall?method=tmapMain&xfrom=main^gnb');
	goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/specialcorner/AuthTmapFrontAction.tmall?method=tmapMain&xzone=main^plan&xfrom=main^plan',code);
}

//º£½ºÆ®¼¿·¯
function best(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/BestSeller.tmall?method=getBestSellerMain&xfrom=main^gnb',code);
}

//°øµ¿±¸¸Å
function joint_buy(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/CooperativeBuyingNewAction.tmall?method=getCoopBuyingBest100',code);
}

//À¯´ÏÅ©¼ÒÈ£
function u_soho(code)	{
	goStatUrl('http://soho.11st.co.kr/index.jsp',code);
}

//ÇÏÇÁÅ¬·´
function gnbHalf(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/Bsshop.tmall?method=getBsshop&bsshopId=half',code);
}

//½ÎÀÌ´Ð SCINIC
function scinic(code)	{
	goStatUrl('http://shop.11st.co.kr/scinic',code);
}

//ÇÃ·¯½ºÁ¸(ÀÌº¥Æ®/ÄíÆù/Ä¨)
function point(code)	{
	//goStatUrl(_GNB_CONTEXT_PATH_+'/html/pluszoneMain.html';
	goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/AuthChipExchPlace.tmall?method=getPluszoneMain&xfrom=main^gnb',code);
}

//¸ÞÀÎÈ¨
function main(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/browsing/Main.tmall?method=showMain&xfrom=main^gnb',code);
}

//Áñ°Å¿î ¼îÇÎÀ¸·Î ½ÃÀÛÇÏ±â
function happyShopping(code)	{
	displayPopup(_GNB_CONTEXT_PATH_+'/jsp/common/selectFlashPage.jsp', 420, 250);
	doCommonStat(code);
}

//ºü¸¥ ¼îÇÎÀ¸·Î ½ÃÀÛÇÏ±â
function quickShopping(code)	{
	displayPopup(_GNB_CONTEXT_PATH_+'/jsp/common/selectNormalPage.jsp', 420, 250);
	doCommonStat(code);
}



//¸ð¹ÙÀÏ ½ºÅ×ÀÌ¼Ç
function mobilest(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_+'/ShoppingInfo.page',code);
}

//µµ¼­ 11¹ø°¡
function book11st(code)	{
	//window.open("http://www.morning365.com/Affiliate.do?cmd=gateway&PARTNER_CD=2120&returnUrl=");
	//top.location.href = "http://www.morning365.com/Affiliate.do?cmd=gateway&PARTNER_CD=2120&returnUrl=";
	goStatUrl("http://book.11st.co.kr",code);
}

//ºäÆ¼ 11¹ø°¡
function beuty11st(code)	{
	//window.open("http://www.cherrya.com/Affiliate.do?cmd=gateway&PARTNER_CD=2550&returnUrl=");
	//top.location.href = "http://www.cherrya.com/Affiliate.do?cmd=gateway&PARTNER_CD=2550&returnUrl=";
	goStatUrl("http://beauty.11st.co.kr",code);
}

function gnbOnlyToday(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/TodaySpecial.tmall?method=todaySpecialMain",code);
}

function gnbNewRegPrd(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/NewArrival.tmall?method=getNewArrivalMain",code);
}

function gnbBenefit(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/BenefitMain.tmall?method=getBenefitMainPageInfo",code);
}

function gnbShopLine(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/ShoppingLinemapAction.tmall?method=getShoppingLinemapMain",code);
}

function gnbChipExch(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/AuthChipExchPlace.tmall?method=getChipExchPlaceMain",code);
}

// 091019 dire
function gnbMiracle11st(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/event/miracle11st.page",code);
}

function gnb11Avenue(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/html/brandMallMain.html",code);
}

function gnb11Days(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/Bsshop.tmall?method=getBsshop&bsshopId=11days",code);
}

// 091012 dire
function gnbBrandMania(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/Bsshop.tmall?method=getBsshop&bsshopId=leadon",code);
}
function gnbForever21(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/Bsshop.tmall?method=getBsshop&bsshopId=forever",code);
}

function gnbIfuMall(code)	{
	goStatUrl("http://shop.11st.co.kr/ifumall",code);
}

// 091008 dire
function gnbIPark(code)		{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/Bsshop.tmall?method=getBsshop&bsshopId=iparkm",code);
}

function gnbDonga(code)		{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/Bsshop.tmall?method=getBsshop&bsshopId=donga",code);
}

function gnbEnter6(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/browsing/Bsshop.tmall?method=getBsshop&bsshopId=enter6",code);
}

function gnbFashion(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/community/TrendNewsAction.tmall?method=getFashionTrendMain",code);
}

function gnbKnowBeauty(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/html/openshopping/knowledgeBeautyMainNew.html",code);
	//goStatUrl(_GNB_CONTEXT_PATH_ + "/community/KnowledgeBeautyMain.tmall?method=getKnowledgeBeautyMain&xzone=shoppingInfo^17&detail=knowledgeBeauty",code);
}

function gnbDigital(code)	{
	goStatUrl(_GNB_CONTEXT_PATH_ + "/community/DigitalAction.tmall",code);
}

/*** 5. ±âÅ¸ ÀÌº¥Æ® ***************************************************************************************/
//¸ô¸µ ÀÌº¥Æ® °ü·Ã 2009.07.15 ===========================
function mallingSetCookie( name, value, expiredays ) {
	if(expiredays != null) {
	    var todayDate = new Date();
	    todayDate.setDate( todayDate.getDate() + expiredays );
	    document.cookie = name + '=' + escape( value ) + '; path=/; domain=11st.co.kr;  expires=' + todayDate.toGMTString() + ';';
	}else {
	    document.cookie = name + '=' + escape( value ) + '; path=/; domain=11st.co.kr;';
	}
}
function mallingDelCookie( name ){
	var expireDate = new Date();
	expireDate.setDate(expireDate.getDate()-1);
	document.cookie = name + '= ' + '; path=/; domain=11st.co.kr;  expires=' + expireDate.toGMTString() + ';';
}
function getMallingUseWt() {
	var url = "http://www.11st.co.kr/wingBanner/WingBannerAjaxAction.tmall?method=getMallingEventUseWt" ;
	var protocol = document.location.protocol ;
	if ( "https:" == protocol ) {
		url = "https://www.11st.co.kr/wingBanner/WingBannerAjaxAction.tmall?method=getMallingEventUseWt" ;
	}
	var params   = "";
	var callBack = "mallingReadData";
	callAjax ( url, params, callBack ) ;
}
function mallingReadData(_useWt) {
	var mallingUseWt = -1;
	if(_useWt != null && _useWt != "" && _useWt != "FAIL") {
		mallingUseWt = _useWt;
  	}
	// ÄíÅ° °ª ¼³Á¤
	mallingSetCookie("MALLING_EVENT_USEWT", mallingUseWt);
	// ¸ô¸µ ÀÌº¥Æ® ÇÃ·¡½Ã °ª ¼³Á¤
	callMallingEvent(1, mallingUseWt);
}
//___¸ô¸µ ÀÌº¥Æ® °ü·Ã 2009.07.15 ===========================
/* [searchCommon.js] */
/* [searchCommon.js] */
/**
	°Ë»ö GNB javascript

	/js/common/type_check.js ÇÊ¿ä!!
**/
/*
 * GNB ÄÞº¸¹Ú½ºº° ´ë»ó action, method ¼³Á¤
 */
function setSearchTarget( code ) {
	var gnbFormObj = document.forms["GNBSearchForm"];
	var actionStr = "http://search.11st.co.kr/SearchPrdAction.tmall";
	var method = "getTotalSearchSeller";

	/*if ( code == "NP" || code == "RP" ) {
		actionStr = "http://search.11st.co.kr/SearchPrdAction.tmall";
		if (  code == "RP" ) {//´ëÇ¥»óÇ°
			gnbFormObj.prdType.value = "M";
			method = "getMasterPrd";
		} else {//ÀÏ¹Ý»óÇ°
			gnbFormObj.prdType.value = "S";
			method = "getSellerPrd";
		}
		//code = "P";	// ÄÚµå Àç¼³Á¤.
	}*/

	if ( code == "M" ) {	// ´ëÇ¥»óÇ°
		actionStr = "http://search.11st.co.kr/SearchPrdAction.tmall";
		gnbFormObj.prdType.value = "M";
		method = "getMasterPrd";
	} else if ( code == "I" ) { // ¼îÇÎÁ¤º¸
		actionStr = "http://search.11st.co.kr/SearchShoppingInfoAction.tmall";
		method = "getSearchShp";
		gnbFormObj.pageSize.value = "5";
	} else if ( code == "S" ) {	//°¡°Ô
		actionStr = "http://search.11st.co.kr/SearchSellerShopAction.tmall";
		method = "getSearchSellerShop";
		gnbFormObj.pageSize.value = "5";
	} else if ( code == "H" ) {	// ÆÇ¸ÅÀÚID-ÆÇ¸ÅÀÚÈ¨¿¡ ´ëÇÑ action Á¤º¸ ÇÊ¿äÇÔ. ³ªÁß¿¡  buy or seller¿¡ ¿äÃ»ÇÒ °Í.
		actionStr = "http://search.11st.co.kr/SearchShoppingInfoAction.tmall";
		method = "getSearchShp";
		gnbFormObj.pageSize.value = "5";
	} else if ( code == "K" ) {	// ÆÇ¸ÅÀÚ ´Ð³×ÀÓ-ÆÇ¸ÅÀÚÈ¨¿¡ ´ëÇÑ action Á¤º¸ ÇÊ¿äÇÔ. ³ªÁß¿¡  buy or seller¿¡ ¿äÃ»ÇÒ °Í.´Ð³×ÀÓ°Ë»ö
		actionStr = "http://search.11st.co.kr/SearchShoppingInfoAction.tmall";
		method = "getSearchNck";
		gnbFormObj.pageSize.value = "5";
	} else if ( code == "D" ) {
		actionStr = "http://search.11st.co.kr/SearchInvoiceNoAction.tmall";	// ¿î¼ÛÀå¹øÈ£°Ë»ö action ¿¬µ¿
		method = "";
	} else if ( code == "CH" ) { //ºäÆ¼ 11¹ø°¡
		actionStr = "http://beauty.11st.co.kr/TotalSearch.do";
		method = "";
		gnbFormObj.category.value = "cherrya";
		gnbFormObj.cmd.value = "productList";
	} else if ( code == "MO" ) { //µµ¼­ 11¹ø°¡
		actionStr = "http://book.11st.co.kr/TotalSearch.do";
		method = "";
		gnbFormObj.category.value = "morning365";
		gnbFormObj.cmd.value = "productList";
	} else if ( code == "SC" ) { //Áñ°Ü¿î ¼îÇÎ
		actionStr = "http://www.11st.co.kr/browsing/specialcorner/enjoyShopping.tmall";
		method = "tSearch";
	} else { // T/P/NP
		actionStr = "http://search.11st.co.kr/SearchPrdAction.tmall";
		method = "getTotalSearchSeller";
		if( code == "T") gnbFormObj.pageSize.value = "30";
		else gnbFormObj.pageSize.value = "50";

	}
	if ( trim(code) == "" ) code = "T";
	gnbFormObj.targetTab.value = code;
	gnbFormObj.action = actionStr;
	gnbFormObj.target = "_top";
	gnbFormObj.method.value = method;
}

/*
 * GNB ¿µ¿ª °Ë»ö¾î È®ÀÎ ¹× submit
 */
function goSearch() {
	var gnbFormObj = document.forms["GNBSearchForm"];
	var keyword = trim(gnbFormObj.kwd.value);
	if(gnbFormObj.targetTab.value == "K" || gnbFormObj.targetTab.value == "I"){	 //ÆÇ¸ÅÀÚ ´Ð³×ÀÓ/¼îÇÎÁ¤º¸
		gnbFormObj.action = "http://search.11st.co.kr/SearchShoppingInfoAction.tmall";
	}else if(gnbFormObj.targetTab.value == "S"){ // °¡°Ô
		gnbFormObj.action = "http://search.11st.co.kr/SearchSellerShopAction.tmall";
	}else if(gnbFormObj.targetTab.value == "CH"){	// ºäÆ¼11¹ø°¡
		gnbFormObj.action = "http://beauty.11st.co.kr/TotalSearch.do";
		gnbFormObj.category.value = "cherrya";
		gnbFormObj.cmd.value = "productList";
	}else if(gnbFormObj.targetTab.value == "MO"){	// µµ¼­11¹ø°¡
		gnbFormObj.action = "http://book.11st.co.kr/TotalSearch.do";
		gnbFormObj.category.value = "morning365";
		gnbFormObj.cmd.value = "productList";
	}
	/*
	// Today
	var td = new Date();
	var yyyy = "" + td.getYear();
	var mm = "" + (td.getMonth()+1);
	var dd = "" + td.getDate();
	if(mm.length == 1) {
		mm = "0" + mm;
	}
	if(dd.length == 1) {
		dd = "0" + dd;
	}
	var yyyymmdd = "" + yyyy + mm + dd;

	// ¹Ý°ªµ¥ÀÌ
	var eventSDate = "20080801";
	var eventEDate = "20081231";

	// 99% ÀÌº¥Æ®
	var eventSDate2 = "20080616";
	var eventEDate2 = "20081231";

	// SKT Ã»±¸¼­ ÀÌº¥Æ®
	var eventSDate3 = "20080910";
	var eventEDate3 = "20080930";

	// ¸®ÇÃ·¿ ÀÌº¥Æ®
	var eventSDate4 = "20080923";
	var eventEDate4 = "20081024";
	*/

	var ad_banner_url = gnbFormObj.adUrl.value;
	if(ad_banner_url == "") {

		if ( keyword == "" ) {
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			gnbFormObj.kwd.focus();
			// return false;
		} else if ( chkKeywordEvent(keyword) ){
			return;
		/*
		} else if ( (keyword == "¹Ý°ªµ¥ÀÌ" || keyword == "¹Ý°ª µ¥ÀÌ") && yyyymmdd >= eventSDate && yyyymmdd <= eventEDate ) {
			document.location.href = "http://www.11st.co.kr/event/halfdayEvent.page";
		} else if ( keyword == "99% ÀÌº¥Æ®" && yyyymmdd >= eventSDate2 && yyyymmdd <= eventEDate2 ) {
			document.location.href = "http://www.11st.co.kr/event/skInboxing.page";
		} else if ( (keyword == "SKT Ã»±¸¼­" || keyword == "SKTÃ»±¸¼­" || keyword == "skt Ã»±¸¼­" || keyword == "sktÃ»±¸¼­") && yyyymmdd >= eventSDate3 && yyyymmdd <= eventEDate3 ) {
			document.location.href = "http://www.11st.co.kr/event/sktbill.page";
		} else if ( keyword == "1À§" && yyyymmdd >= eventSDate4 && yyyymmdd <= eventEDate4 ) {
			document.location.href = "http://www.11st.co.kr/event/sktleaflet.page";
		*/
		} else if ( gnbFormObj.targetTab.value == "D" && !IsNumeric(keyword) ) {
			alert("¿î¼Û¹øÈ£ Á¶È¸´Â ¼ýÀÚ(Á¤¼ö)¸¸ °¡´ÉÇÕ´Ï´Ù.");
			gnbFormObj.kwd.focus();
		} else if ( gnbFormObj.targetTab.value == "D" && keyword.length < 10 ) {
			alert("¿î¼Û¹øÈ£ 10ÀÚ¸® ÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
			gnbFormObj.kwd.focus();
		} else if ( gnbFormObj.targetTab.value == "N"  ) {
			if ( !IsNumeric(keyword) ) {
				alert("»óÇ°¹øÈ£´Â ¼ýÀÚ(Á¤¼ö)¸¸ °¡´ÉÇÕ´Ï´Ù.");
				gnbFormObj.kwd.focus();
			} else {
				document.location.href = _GNB_CONTEXT_PATH_ + "/product/SellerProductDetail.tmall?method=getSellerProductDetail&xfrom=search^prd&prdNo=" + keyword;
			}
		 } else if ( gnbFormObj.targetTab.value == "H") {
				if(!keyword.match(/^[a-zA-Z0-9]+$/)) {
		 		alert("ÆÇ¸ÅÀÚ ID´Â ¿µ¹®¼Ò¹®ÀÚ(¼ýÀÚÆ÷ÇÔ) 6ÀÚ ÀÌ»ó 20ÀÚ ¹Ì¸¸À¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.ÆÇ¸ÅÀÚ ID¸¦ ´Ù½Ã È®ÀÎÇØÁÖ¼¼¿ä.");
				gnbFormObj.kwd.focus();
				return;
			}else if(!(keyword.length >= 6 && keyword.length < 20)) {
				alert("ÆÇ¸ÅÀÚ ID´Â ¿µ¹®¼Ò¹®ÀÚ(¼ýÀÚÆ÷ÇÔ) 6ÀÚ ÀÌ»ó 20ÀÚ ¹Ì¸¸À¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.ÆÇ¸ÅÀÚ ID¸¦ ´Ù½Ã È®ÀÎÇØÁÖ¼¼¿ä.");
				gnbFormObj.kwd.focus();
				return;
			}
			fucnSetSearchKey(keyword); //³» °Ë»ö ±â·Ï ÄíÅ° ³²±â±â
			document.location.href = _GNB_CONTEXT_PATH_ + "/"+ keyword;
		 } else if ( gnbFormObj.targetTab.value == "K"  ) {
		 	if(!(keyword.length >= 3 && keyword.length < 20)) {
		 		alert("ÆÇ¸ÅÀÚ ´Ð³×ÀÓÀº ÇÑ±Û,¿µ¹®¼Ò¹®ÀÚ, ¼ýÀÚ¸¦ Æ÷ÇÔÇØ 3ÀÚ ÀÌ»ó 20ÀÚ ¹Ì¸¸À¸·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.ÆÇ¸ÅÀÚ ´Ð³×ÀÓÀ» ´Ù½Ã È®ÀÎÇØÁÖ¼¼¿ä.");
				gnbFormObj.kwd.focus();
				return;
		 	}
			fucnSetSearchKey(keyword); //³» °Ë»ö ±â·Ï ÄíÅ° ³²±â±â
			gnbFormObj.kwd.value = keyword;
			gnbFormObj.submit();
		} else { // T/P/NP/M/I/S

			fucnSetSearchKey(keyword); //³» °Ë»ö ±â·Ï ÄíÅ° ³²±â±â
			/*if ( gnbFormObj.targetTab.value == "P" ) {		// »óÇ°ÅÇÀÌµ¿ÈÄ gnb°Ë»öÇÒ¶§ ¸Þ¼Òµå ¼³Á¤
				if (gnbFormObj.prdType.value == "M") {
				  gnbFormObj.method.value = "getMasterPrd";
				} else {
				  gnbFormObj.method.value = "getSellerPrd";
				}
			} else {
				setSearchTarget(gnbFormObj.targetTab.value);
			}*/
			/*
				if ( gnbFormObj.targetTab.value == "M" ) {
			    	gnbFormObj.method.value = "getMasterPrd";
			    } else {	// P(±âÁ¸ 11¹ø°¡ ÅëÇÕ °Ë»ö) or T(New OM/MM ÅëÇÕ °Ë»ö)

//			    	setSearchTarget(gnbFormObj.targetTab.value);
				}
				*/
			setSearchTarget(gnbFormObj.targetTab.value);
			//alert(gnbFormObj.pageSize.value);
			gnbFormObj.kwd.value = keyword;
			gnbFormObj.submit();
		}

	} else {
		top.location.href = ad_banner_url;
	}
}

/*
 * Å°¿öµå Å¬¸¯ °Ë»öÃ³¸®
 */
function searchKwd(kwd) {
	var gnbFormObj = document.forms["GNBSearchForm"];
	var keyword = kwd;

	if(keyword == "") {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
	}
	else {
	    /*
	     * OM/MM ÅëÇÕ°Ë»ö(targetTab=T)¿¡¼­ °ü·Ã/ÃßÃµ °Ë»ö¾î´Â 11¹ø°¡ ÅëÇÕ°Ë»öÀ¸·Î º¸³½´Ù. - ÀÌÁö¿¬ Ãß°¡.
	     */
	    if( gnbFormObj.targetTab.value == "T" ) gnbFormObj.targetTab.value = "P";
		gnbFormObj.kwd.value = keyword;
		gnbFormObj.target = "_top";
  		gnbFormObj.submit();
	}
}

/*
 * »ó´Ü ÅÇ(ÅëÇÕ°Ë»ö/11¹ø°¡/ºäÆ¼/µµ¼­)  ÀÌµ¿.
 */
function goTabSearch( targetTab ){
	if(targetTab == 'MO') {
		var formObj = document.forms["searchMOForm"];
		formObj.submit();
	} else {
		var gnbFormObj = document.forms["GNBSearchForm"];
		gnbFormObj.targetTab.value = targetTab;
		if( targetTab == "T") gnbFormObj.pageSize.value = "30";
		else gnbFormObj.pageSize.value = "50";
		goSearch();
	}
}

/*
 * »óÇ° ¸ÞÀÎÅÇ º¯°æ ( ÅëÇÕ/»óÇ°/¼îÇÎÁ¤º¸/¼¿·¯¼¥ )
 */
function changeMainTab( tab ) {
	var formObj = document.forms["searchMoveForm"];
	var actionStr = "";
	var method = "";

	if ( tab == "T" ) {	// ÅëÇÕ°Ë»ö
		actionStr = "http://search.11st.co.kr/SearchPrdAction.tmall";
		method = "getTotalSearchSeller";
		formObj.prdType.value = "S";
	} else if ( tab == "P" ) {	// »óÇ°
		actionStr = "http://search.11st.co.kr/SearchPrdAction.tmall";
		method = "getSellerPrd";
		formObj.prdType.value = "S";
	} else if ( tab == "I" ) {	// ¼îÇÎÁ¤º¸
		actionStr = "http://search.11st.co.kr/SearchShoppingInfoAction.tmall";
		method = "getSearchShp";
		formObj.prdType.value = "";
		formObj.targetDomain.value = "shoppingInfo";
//		formObj.targetDomain.value = "shoppingTogether";
	} else if ( tab == "S" ) {	// ¼¿·¯¼¥
		actionStr = "http://search.11st.co.kr/SearchSellerShopAction.tmall";
		method = "getSearchSellerShop";
		formObj.prdType.value = "";
	}

	formObj.action = actionStr
	formObj.targetTab.value = tab;
	formObj.method.value = method;
	formObj.target = "_top";
	formObj.pageNum.value = 1;

	formObj.submit();
}


//³ªÀÇ°Ë»ö¾î °ü·Ã Ãß°¡ ½ÃÀÛ
function funcGetDateTime() {
  var dt_datetime = new Date()
  var year  = dt_datetime.getFullYear();
  var month = (dt_datetime.getMonth()+1);
  var day   = dt_datetime.getDate();
  var hours = dt_datetime.getHours();
  var min   = dt_datetime.getMinutes();
  if(hours <10) hours = "0"+hours;
  if(min <10) min = "0"+min;

  if( parseInt(month) < 10 )
  {
	month = "0" + month;
  }

  if( parseInt(day) < 10 )
  {
	day = "0" + day;
  }

  return ( new String( year + "/" + month + "/" + day + " " +hours+ ":"+ min));
}


function funcSetCookieSearchKey( name, value, expiredays )
{
	var todayDate = new Date();
	var domains = "11st.co.kr";
	if(name == "TMALL_MY_SEARCHLIST") domains = "www.11st.co.kr";
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + '=' + escape( value ) + '; path=/; domain=' + domains + ';  expires=' + todayDate.toGMTString() + ';';
}

function getCookieSearchKeyList(str){
	var cookieData = "";
	var data = getCookie(str);
	data = unescape(data);
	cookieData = data;

	return cookieData;
}
function fucnSetSearchKey(kwd)
{
	var cookieData = "";
	var cookieDataList = "";

	if(kwd.length > 0){
		cookieData =    getCookieSearchKeyList('TMALL_SEARCHLIST');

		var dateTime = funcGetDateTime();
		var searchKeyValue = kwd+"¨ç"+dateTime;
		cookieData = searchKeyValue + "¨è" + cookieData  ;

		var token1   = cookieData.split(/¨è/g);
		var sizeLimit = 10;
		for(i=0; i<token1.length &&  i<sizeLimit ; i++)
		{
			if(i == (sizeLimit-1)){
				cookieDataList += token1[i];
			}else{
				cookieDataList += token1[i]+"¨è";
			}
		}
		funcSetCookieSearchKey("TMALL_SEARCHLIST", cookieDataList,1);
		funcSetCookieSearchKey("TMALL_MY_SEARCHLIST", cookieDataList,1);//°Ë»ö¾î °ãÄ§Çö»óÀ» À§ÇÑ ÄíÅ° »ý¼º 2008-12-19
	}

}
//³ªÀÇ°Ë»ö¾î °ü·Ã Ãß°¡ ³¡

/* Å°¿öµå ±¤°í ¼öµ¿ Ã³¸® ½ÃÀÛ */
function KeywordEvent(keywordList, stDate, enDate, url)	{
	var isUse = false;
	var targetUrl = "";

	// Today
	var td = new Date();
	var yyyy = new String(td.getFullYear());
	var mm = new String(td.getMonth()+1);
	var dd = new String(td.getDate());
	if(mm.length == 1) {
		mm = "0" + mm;
	}

	if(dd.length == 1) {
		dd = "0" + dd;
	}

	var curDate =  parseInt(new String(yyyy + mm + dd));

	if (curDate >= parseInt(stDate) &&  curDate <= parseInt(enDate)  )	{
		isUse = true;
		targetUrl = url;
	}

	this.goEventUrl = function(keyword)	{

		if(isUse && (keywordList.toUpperCase()).indexOf("/" + new String(keyword.toUpperCase()) + "/") > -1 )	{
			top.location.href = targetUrl;
			return true;
		}
		return false;
	}
}

function getInnocentWord(keyword) {
	var reg = /[^\uAC00-\uD7AF\u1100-\u11FF\u3130-\u318f a-zA-Z0-9]+/;
	while(keyword.match(reg)) {
		keyword = keyword.replace(reg,"");
	}

	while(keyword.match(/\s/)) {
		keyword = keyword.replace(/\s/,"");
	}

	return keyword;
}

var arrEvents = new Array( new KeywordEvent("","", "", ""));

try{
	if(isUTF8 == true);
}catch(e)
{
	isUTF8 = false;
}

if(isUTF8 == undefined || isUTF8 == null || isUTF8 == false){
	document.write('<script type="text/javascript" src="' + getCommonImgUrl("http://www.11st.co.kr/html/reserveKeywordList.js") + '"></script>');
}
function chkKeywordEvent(keyword)	{
	for ( var i = arrEvents.length - 1; i > -1 ; i-- )	{
		if (arrEvents[i].goEventUrl(getInnocentWord(keyword)))	{
			return true;
		}
	}
	return false;
}
/* Å°¿öµå ±¤°í ¼öµ¿ Ã³¸® ³¡ */


/* Ç²ÅÍ°Ë»öÃ¢ Ãß°¡ */
function goFooterSearch(code) {
	var footerFormObj = document.forms["FooterSearchForm"];
	var keyword = trim(footerFormObj.kwd.value);

	if( keyword == "" ) {
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		footerFormObj.kwd.focus();
		return;
	} else if ( chkKeywordEvent(keyword) ){
		return;
	} else {
		footerFormObj.kwd.value = keyword;
		footerFormObj.submit();
		doCommonStat(code);
	}
}
/* Ç²ÅÍ°Ë»öÃ¢ Ãß°¡  ³¡*/
/* [swfformfix2.js] */
/**
 * SWFFormFix v2.1.0: SWF ExternalInterface() Form Fix - http://http://www.teratechnologies.net/stevekamerman/
 *
 * SWFFormFix is (c) 2007 Steve Kamerman and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Project sponsored by Tera Technologies - http://www.teratechnologies.net/
 */
////////////////////////////////////////////////////
////////////  Configurable options  ////////////////
////////////////////////////////////////////////////
var EnableFullAuto	= false; // set this to true and all of your flash objects will be fixed automatically
var SWFFormFixDebug = false; // set this to true to be alerted whenever a flash object is found and fixed
var NotLoadedWarning = false; // set this to true to alert the users when they try to access a function from
							 // the ExternalInterface() that isn't loaded yet
var NotLoadedMsg = "Please wait for the page to load..."; // this is the warning they will see
////////////////////////////////////////////////////
//////////  END Configurable options  //////////////
////////////////////////////////////////////////////
/**
 * Usage:
 * ------------------------------------------------------------
 * There are three ways to use SWFFormFix, FULL AUTO, Auto and Manual mode.
 * To use either method you need to include this file in the 
 * HEAD section of your page like this: 

<script src="swfformfix.js" type="text/javascript"></script>

 * 
 * NOTE: If you want Javascript to call Flash, you need to make
 * a dummy object like follows:
 
window["myFlashObject"] = new Object();

 * Put this line directly above your call to SWFObject().
 * Replace "myFlashObject" with the ID of your object (the 2nd
 * parameter you give to SWFObject() ).  This will prevent your
 * page from dieing with an error like "myFlashObject is undefined".
 * 
 * --> FULL AUTO Mode:
 * This will attempt to find every Flash Movie that you have on
 * the page and apply the fix to each of them as the page loads.
 * It will poll the page for all the objects and determine if it
 * needs to apply the fix to them every 100ms until the page is
 * completely loaded.  All you need to do to use this mode is
 * include the script in the head of your document and set the
 * "EnableFullAuto" directive to true at the top of the script.
 *
 * --> Auto Mode:
 * This will attempt to find every Flash Movie that you have on
 * the page and apply the fix to each of them.  To use auto mode
 * put the following code before the </body> tag. More specifically
 * it needs to be AFTER your last Flash object.

<script type="text/javascript">
// <![CDATA[
	SWFFormFixAuto();
// ]]>
</script>

 * 
 * --> Manual Mode:
 * This lets you fix just a single Flash object if you don't want
 * the auto mode to try to fix every Flash object on the page.
 * This mode is faster than the auto mode and may work better in
 * some situations.  To use manual mode put the following code
 * after the Flash object you want to fix, where "myFlashObject"
 * is the ID of the Flash Object:

Example for normal EMBED style:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="200" height="100" id="myFlashObject" align="middle">
<param name="movie" value="myMovie.swf" />
<param name="quality" value="high" />
<embed src="myMovie.swf" quality="high" width="200" height="100" name="myFlashObject" type="application/x-shockwave-flash" />
</object>

<script type="text/javascript">
// <![CDATA[
SWFFormFix("myMovieObjectName");
// ]]>
</script>

Example for SWFObject style:

<div id="flashcontent" style="width:200px;height:100px;">This is replaced by the Flash movie.</div>
<script type="text/javascript">
// <![CDATA[
// Please note that the ID that you need to use for SWFFormFix() is the second argument in SWFObject().
var so = new SWFObject("myMovie.swf", "myFlashObject","200", "100", "6.0.0", "#ffffff");
so.addParam("quality", "high");
so.write("flashcontent");
SWFFormFix("myFlashObject");
// ]]>
</script>

 * 
 * Changelog:
 * ------------------------------------------------------------
 * v2.1
 *   Fixed IE cache bug that prevents JS -> Flash after refresh.  Now SWFFormFix
 *   rebuilds all the ExternalInterface() methods that were inadvertently destroyed.
 * v2.0
 *   Added FULL AUTO mode - just enable it below and include the script!
 *   Special thanks to Geoff Stearns from deconcept and onDOMload by Aaron Barker
 * 
 * v1.0
 *   Added the SWFFormFixAuto() function, very well optimized and fast.
 * 
 * v0.2
 *   Changed helper element from <input> element to hidden <div> element
 *
 * v0.1
 *   Initial release.
 */

finished = false; // this is set to true when the body's onload is called, to stop the script
timeout = 10; // seconds to wait before giving up
starttime = new Date().getTime();
flashObjectList = Array();
fixedList = Array();
makeFuncArr = Array();
SWFFormFixAuto2 = function(){
//alert("running...");
	if(navigator.appName.toLowerCase() != "microsoft internet explorer")return true;
	var flashObjectList = document.getElementsByTagName("object");
	for(var i=0;i<flashObjectList.length;i++){
		var obj = flashObjectList[i];
		// here's all the objects on the page, now lets find the flash objects
		if(obj.getAttribute('classid') == "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"){
			var id = obj.getAttribute('id');
			var alreadyfixed = false;
			for(var c=0;c<fixedList.length;c++){if(fixedList[i] == id)alreadyfixed=true;}
			// this is a flash movie, apply the fix (unless it's already been fixed)
			if(!alreadyfixed){
				var debugtxt = '';
				for(var b in window[id]){
					// ExternalInterface() tried to add some functions to the incorrect object
					if(typeof(window[id][b])=="function"){
						// this function will need to be rebuilt when the page is done loading.
						makeFuncArr.push(Array(obj,b));
						obj[b] = function(){
//							if(NotLoadedWarning)alert(NotLoadedMsg);
							return("");
						}
/*
 * it seems like this would work to copy the function, but it doesn't:
 *
 * eval('obj[b]='+window[id][b].toString());
 * 
 * This is the actual function that we're trying to copy:

function () { 
  return eval(instance.CallFunction("<invoke name=\""+name+"\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));
}

 * it will fail if you copy it to the new object though because "instance" and "name" are undefined
 * Here's how to see the actual function def: document.getElementById("txt_debug").value=window[id][b];
 */
					}
				}
				window[id]=obj;
				if(SWFFormFixDebug)alert("Fixed: "+id);
			}
		}
	}
	if(!finished){
		setTimeout("SWFFormFixAuto2()", 100);
	}else{
		for(var i=0;i<makeFuncArr.length;i++){
			// this is executed after the page is loaded - it rebuilds the custom
			// ExternalInterface() functions
			SWFFormFix_rebuildExtFunc(makeFuncArr[i][0],makeFuncArr[i][1]);
		}
	}
	return true;
}
SWFFormFix_rebuildExtFunc = function(obj,functionName){
	eval('obj[functionName] = function(){return eval(this.CallFunction("<invoke name=\\"'+functionName+'\\" returntype=\\"javascript\\">" + __flash__argumentsToXML(arguments,0) + "</invoke>"));}');
	if(SWFFormFixDebug)alert("Rebuilt ExternalInterface() function: "+functionName);
}
SWFFormFixOnloadAppend = function() {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = function(){
			finished=true;
		}
	} else {
		window.onload = function() {
			oldonload();
			finished=true;
		}
	}
}
SWFFormFixAuto = function(){
	if(navigator.appName.toLowerCase() != "microsoft internet explorer")return true;
	var objects = document.getElementsByTagName("object");
	if(objects.length == 0) return true;
	for(i=0;i<objects.length;i++){
		// here's all the objects on the page, now lets find the flash objects
		if(objects[i].classid == "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"){
			// this is a flash movie, apply the fix
			window[objects[i].id] = objects[i];
		}
	}
	var out = "";
	return true;
}
SWFFormFix = function(swfname){
	if(navigator.appName.toLowerCase() != "microsoft internet explorer")return false;
	var testnodename = "SWFFormFixTESTER";
	document.write('<div id="'+testnodename+'" onclick="SWFFormFixCallback(this,\''+swfname+'\');return false;" style="display:none">&nbsp;</div>');
	document.getElementById(testnodename).onclick();
}
SWFFormFixCallback = function (obj,swfname){
	var path = document;
	var error = false;
	var testnode = obj;
	while(obj = obj.parentNode){
		if(obj.nodeName.toLowerCase() == "form"){
			if(obj.name != undefined && obj.name != null && obj.name.length > 0){
				path = path.forms[obj.name];
			}else{
				alert("Error: one of your forms does not have a name!");
				error = true;
			}
		}
	}
	testnode.parentNode.removeChild(testnode);
	if(error) return false;
	window[swfname]=path[swfname];
	return true;
}
function noCacheIE(url){
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	if(!isIE)return(url);
	var newUrl = '?';
	if(url.indexOf('?') != -1)newUrl = '&';
	var now = new Date();
	var rand = Math.random().toString().substring(2,4);
	newUrl = url+newUrl+"noCacheIE="+rand+'-'+now.getTime().toString();
	return(newUrl);
}
if(EnableFullAuto){
	SWFFormFixAuto2();
	SWFFormFixOnloadAppend();
}
/* [swfobject.js] */
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	//this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.skipDetect = true;
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {

	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			swfNode += '<param name="wmode" value="transparent" />';
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			try {
				var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
				n.innerHTML = this.getSWFHTML();
				return true;
			} catch (e) { }
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			 var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.9");
		}catch(e){
			try{
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}catch(e){
				try {
					var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
					axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
				} catch(e) {
					if (PlayerVersion.major == 6) {
						return PlayerVersion;
					}
				}
				try {
					axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				} catch(e) {}
			}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
/*
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
*/

deconcept.SWFObjectUtil.cleanupSWFs = function() {
	try{
			if (window.opera || !document.all) return;
			//var objects = document.getElementsByTagName("OBJECT");
			//for (var i=0; i < objects.length; i++) {
				//objects[i].style.display = 'none';
//				for (var x in objects[i]) {
	//				if (typeof objects[i][x] == 'function') {
		//				objects[i][x] = function(){};
			//		}
				//}
			//}
			for (var i=0,swfLen=deconcept.hasFuncSwfs.length; i < swfLen; i++) {
				for (var x in deconcept.hasFuncSwfs[i]) {
					if (typeof deconcept.hasFuncSwfs[i][x] == 'function') {
						deconcept.hasFuncSwfs[i][x] = function(){};
					}
				}
			}
		}catch(e){
		}
	}


// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;

/* flashcommon.js ****************************************************************/
function FF_changeFlashSize(movieid, w, h)
{
	setDivSize(movieid, w,h);

    var swfmovie = document.getElementById(movieid);

	if(swfmovie)
	{
		if(w != null)
			swfmovie.setAttribute("width", w);

		if(h != null)
			swfmovie.setAttribute("height", h);
	}
}

function FF_gotoPage(pageUrl, target)
{
	// ÇØ´ç pageUrl °æ·Î·Î target ÀÌµ¿ÇÕ´Ï´Ù.
	if(target == "_blank"){
		window.open(pageUrl);
	}else if(target == "_top") {
		top.location.href = pageUrl;
	}else{
		location.href = pageUrl;
	}
}

function FF_setCookie(key, value)
{
	if(value == null || value == "null")
		value = "";
	setCookie(key, value);
}

function FF_getCookie(key)
{
	return getCookie(key);
}

function FF_clearCookies()
{
	setCookie("f_movieCode", "");
	setCookie("f_cinemaCode", "");
	setCookie("f_cinemaTypeCode", "");
	setCookie("f_screenCode", "");
	setCookie("f_playDate", "");
	setCookie("f_playNo", "");
}
/* [type_check.js] */
function isBlank( obj )
{
	if( typeof(obj) == "object" )
	{
		if( obj.value == "" )
		{
			return true;
		} else {
			return false;
		}
	} else {
		alert( "Object °¡ ¾Æ´Õ´Ï´Ù." );
		return false;
	}
}


/*
 * ÇØ´ç object ·Î focus ¸¦ ÀÌµ¿½ÃÅ²ÈÄ ´«¿¡ ¶ç°Ô bgcolor ¸¦ ¹Ù²ãÁØ´Ù.
 *
 */
function alertInput( obj )
{
	var oldBackColor = "";

	if( event )
	{
		oldBackColor = event.srcElement.style.backgroundColor;
	}
	else
	{
		oldBackColor = obj.style.backgroundColor;
	}

	if( typeof(obj) == "object" )
	{
		obj.focus();
		obj.style.backgroundColor = "#E4E4E4";	// È¸»ö °è¿­.

		obj.onblur = function(){
			//event.srcElement.style.backgroundColor = oldBackColor;
			this.style.backgroundColor = oldBackColor;
		};
	} else {
	}
}

/*
 * ¹®ÀÚÀÇ length ¸¦ È®ÀÎÇØ ÁöÁ¤ÇÑ num º¸´Ù Å©¸é false ¸¦ µ¹·ÁÁØ´Ù.
 *
 */
function checkFigure( str, num1, num2 )
{
	if( str.length < num1 || str.length > num2  )
		return false;
	else
		return true;
}

/*
 * ¹®ÀÚ¿­À» °Ë»çÇÏ¿© ¼ýÀÚÀÎÁö¸¦ Ã¼Å©ÇÑ´Ù.
 *
 */
function IsNumeric(checkStr)
{
  for (i = 0;  i < checkStr.length;  i++)
  {
	ch = checkStr.charAt(i);
	//alert(ch);
	if (ch < "0" || ch > "9")
	  return false;
  }
  return true;
}


/*
 * ¹®ÀÚ¿­ÀÇ ¾ÕµÚ °ø¹éÀ» ¾ø¾ÖÁØ´Ù.
 *
 */
function trim(str) {
  var count = str.length;
  var len = count;
  var st = 0;

  while ((st < len) && (str.charAt(st) <= ' ')) {
	 st++;
  }
  while ((st < len) && (str.charAt(len - 1) <= ' ')) {
	 len--;
  }
  return ((st > 0) || (len < count)) ? str.substring(st, len) : str ;
}


/*
 * Á¤±Ô½ÄÀ» ÀÌ¿ëÇÑ ¼ýÀÚ Ã¼Å©.
 *
 */
function checkNumber( value, isNeed ){
	// value °ªÀÌ ÀÖÀ»°æ¿ì¸¸ Ã¼Å©ÇÑ´Ù.
	if( value != "" )
	{
		var x = value;

		var anum =/(^\d+$)|(^\d+\.\d+$)|(^[-]\d+$)|(^[-]\d+\.\d+$)/;

		if (anum.test(x))
		{
			return true;
		}
		else{
			return false;
		}
	} else {
		return true;
	}
}


/*
 * ¼Ò¼öÁ¡ ÀÚ¸® Ã¼Å©.
 *
 */
function checkDecimals(fieldName, fieldValue) {
	decallowed = 2;  // Çã¿ëÇÒ ¼Ò¼ýÁ¡ ÀÚ¸®¼ö ¼³Á¤

	if (isNaN(fieldValue) || fieldValue == "") {
		alert("¼ýÀÚ¸¸ ³Ö¾î ÁÖ¼¼¿ä");
		fieldName.select();
		fieldName.focus();
	}
	else {
		if (fieldValue.indexOf('.') == -1) fieldValue += ".";
			dectext = fieldValue.substring(fieldValue.indexOf('.')+1, fieldValue.length);

		if (dectext.length > decallowed)
		{
			alert ("¼Ò¼öÁ¡Àº " + decallowed + " ÀÚ¸® ±îÁö¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
			fieldName.select();
			fieldName.focus();
		}
		else {
			alert ("Àß ÀÔ·Â ÇÏ¼Ì³×¿ä");
			// return true
		}
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////
/*
 * Form ÀÇ Ç×¸ñÁß¿¡ "INPUT" ÀÎ°Í¸¸ value °ªÀ» trim ÇØÁØ´Ù.
 *
 */
function FormObjTrim( obj ) {
	if( (typeof(obj) == "object") && (obj.tagName.toUpperCase() == "FORM") )
	{
		var oItem = obj.elements;

		for( i=0; i<oItem.length; i++ )
		{
			if( oItem.item(i).tagName.toUpperCase() == "INPUT" ||
				oItem.item(i).tagName.toUpperCase() == "TEXTAREA" )
			{
				oItem.item(i).value = trim( oItem.item(i).value );
			}
		}
	} else {
		alert( "Form Object °¡ ¾Æ´Õ´Ï´Ù." );
		return false;
	}
}

/*
 * INPUT type=radio °¡ ÇÏ³ªµµ ¼±ÅÃµÇ¾î ÀÖÁö ¾ÊÀ» °æ¿ì, return false
 *
 */
function checkRadio( obj, msg )
{
	if( typeof( obj ) == "object" )
	{
		for( i=0; i < obj.length; i++ )
		{
			if( obj[i].checked )
			{
				return true;
			}
		}

		alert( msg );
		if( obj.length )
		{
			obj[0].focus();
		}
		else
		{
			obj.focus();
		}
		//alertInput( obj );

		return false;
	} else {
		alert("Object °¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
}

/*
 * INPUT type=radio °¡ ¼±ÅÃµÇ¾î ÀÖ´Â°æ¿ì return Value ¾ø´Â°æ¿ì, return false
 *
 */
function checkRadioValue( obj )
{

	if( typeof( obj ) == "object" )
	{
		for( i=0; i < obj.length; i++ )
		{
			if( obj[i].checked )
			{
				return obj[i].value;
			}
		}
		return false;
	} else {
		alert("Object °¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
}


/*
 * ¼ýÀÚ Å¸ÀÔ Ã¼Å©
 * ¼ýÀÚÀÇ ¹üÀ§´Â -2147483648 ~ 2147483647 ±îÁö...
 *
 * obj : <input> ÀÇ object.
 * msg : ¿À·ù½Ã ³ªÅ¸³¯ ¸Þ¼¼Áö.
 * limit_num : Á¦ÇÑÇÒ ÀÚ¸´¼ö.
 * isNeed : °ø¹é Ã¼Å© ¿©ºÎ
 */
function numberCheck( obj, msg, limit_num1, limit_num2, isNeed )
{
	if( typeof(obj) == "object" )
	{
		if( isNeed )
		{
			if( isBlank( obj ) )
			{
				alert( msg );
				alertInput( obj );

				return false;
			}
		}

		if(!isBlank(obj))
		{
			if( !checkNumber( obj.value, isNeed ) )
			{
				alert( msg );
				alertInput( obj );

				return false;
			}
			else if( !checkFigure( obj.value, limit_num1, limit_num2 ) )
			{
				if( limit_num1 != limit_num2 )
				{
					alert( limit_num1 + "~" + limit_num2 + " ÀÚ¸®±îÁö ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
				}
				else
				{
					alert( limit_num1 +" ÀÚ¸®±îÁö ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.");
				}
				alertInput( obj );
				return false;
			}
		}

		return true;
	} else {
		alert("Object °¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
}

function dateCheck( obj, title, isNeed )
{
	if( typeof(obj) == "object" )
	{
		if( isNeed )
		{
			if( isBlank( obj ) )
			{
				alert( title +'´Â(Àº) ¹Ýµå½Ã [2004-07-20]¿Í °°Àº ÇüÅÂ·Î \n\n Á¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À' );
				alertInput( obj );

				return false;
			}
		}

		if(!isBlank(obj))
		{
			// ÀÚ¸´¼ö Ã¼Å©.
			var value = obj.value;
			if( value.indexOf("-") == -1 )
			{
				alert( title +'´Â(Àº) ¹Ýµå½Ã [2004-07-20]¿Í °°Àº ÇüÅÂ·Î \n\n Á¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À' );
				alertInput( obj );

				return false;
			}

			// 2004-07-20 ÇüÅÂÀÇ ³»¿ëÀÎÁö È®ÀÎ.
			if( value.substring(0, 4).length < 4 ||
				value.substring(5, 7).length < 2 ||
				value.substring(8, 10).length < 2 )
			{
				alert( title +'´Â(Àº) [2004-07-20]¿Í °°ÀÌ 4ÀÚ¸®-2ÀÚ¸®-2ÀÚ¸® ÇüÅÂ·Î \n\nÁ¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À' );
				alertInput( obj );

				return false;
			}
			if( !checkNumber(value.substring(0, 4), isNeed) ||
				!checkNumber(value.substring(5, 7), isNeed) ||
				!checkNumber(value.substring(8, 10), isNeed) )
			{
				alert( title +"´Â(Àº) [2004-07-20]¿Í °°Àº ÇüÅÂÀÌ¸ç '-'¸¦ Á¦¿ÜÇÑ \n³ª¸ÓÁö´Â ¸ðµÎ ¼ýÀÚ·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿À" );
				alertInput( obj );

				return false;
			}

			if (!(parseInt(value.substring(0, 4),10) > 1899 && parseInt(value.substring(0, 4),10) < 3000))
			{
				alert( title + "ÀÇ ¿¬µµ´Â 1900³â ~ 2999³â ±îÁö ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù. \n\nÁ¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À" );
				alertInput( obj );

				return false;
			}
			
			if (!(parseInt(value.substring(5, 7),10) > 0 && parseInt(value.substring(5, 7),10) < 13))
			{
				alert( title + "ÀÇ ¿ùÀº 01¿ù ~ 12¿ù ±îÁö ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù. \n\nÁ¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À" );
				alertInput( obj );

				return false;
			}
			
			if (!(parseInt(value.substring(8, 10),10) > 0 && parseInt(value.substring(8, 10),10) < 32))
			{
				alert( title + "ÀÇ ÀÏÀº 01ÀÏ ~ 31 ±îÁö ÀÔ·ÂÀÌ °¡´ÉÇÕ´Ï´Ù. \n\nÁ¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À" );
				alertInput( obj );

				return false;
			}
		}

		return true;
	} else {
		alert("Object °¡ ¾Æ´Õ´Ï´Ù. ");
		return false;
	}
}

/*
 * ¹®ÀÚ¿­ Å©±â Ã¼Å©.
 */
function stringCheck( obj, msg, isNeed )
{
	if( typeof(obj) == "object" )
	{
		if( isNeed )
		{
			if( isBlank( obj ) )
			{
				alert( msg );
				alertInput( obj );
				return false;
			}
		}

		return true;
	} else {
		alert("Object °¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
}

/*
 * ÀüÈ­ ¹øÈ£ Ã¼Å©
 * 000-0000-0000
 *
 */
function telephoneCheck( obj, msg, isNeed )
{
	if( typeof(obj) == "object" )
	{
		if( isNeed )
		{
			if( isBlank( obj ) )
			{
				alert( msg );
				alertInput( obj );
				return false;
			}
		}


		if ( isBlank( obj ) == false )
		{
			flg=0;
			var cmp="()-0123456789";


			for (var i=0; i < obj.value.length; i++)
			{
				tst = obj.value.substring(i,i+1);

				if (cmp.indexOf(tst) < 0)
				{
					flg++;
				}
			}

			if (flg!=0)
			{

				alert( msg );
				alertInput( obj );
				return false;
			}
		}


		return true;
	} else
	{
		alert("Object °¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
}


var NUM = "0123456789";
var SALPHA = "abcdefghijklmnopqrstuvwxyz";
var ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"+SALPHA;
var EMAIL = "!#$%&*+-./=?@^_`{|}"+NUM+ALPHA;

/**
 * ÀÔ·ÂÇÑ ¹®ÀÚ¿­(aSource)°¡ sCompareÀÇ ¹®ÀÚ¿­¿¡ Æ÷ÇÔµÇ¾î ÀÖ´Â ¹®ÀÚ·Î µÇ¾î ÀÖ´ÂÁö¸¦ Ã¼Å©ÇØÁØ´Ù.
 */
function IsCheckValidString( sSource, sCompare )
{
	var i ;
	for( i=0; i< sSource.length; i++ )
	{
		if( sCompare.indexOf( sSource.substring( i, i+1 ) ) < 0)
		{
			return false ;
		}
	}

	return true ;
}

/**
 * sSource ÀÇ ±æÀÌ°¡ nMinº¸´Ù Å©°í nMaxº¸´Ù ÀÛÀ¸¸ç ¸¸¾à¿¡ ¹üÀ§¸¦ ¹þ¾î³¯ °æ¿ì¿¡´Â
 * sName¿¡ ´ëÇÑ ¿À·ù·Î º¸¿©ÁØ´Ù. nIsConsonant ÀÌ True¸é "À»" ¾Æ´Ï¸é "¸¦" ·Î Ç¥½ÃÇØÁØ´Ù.
 */
function IsCheckEnglish( sSource, sName, nMin, nMax, nIsConsonant )
{
	var nStrSize = GetStringSize( sSource ) ;
	var cPostN, cPostL ;

	if( nIsConsonant )
	{
		cPostL = "À»" ;
		cPostN = "Àº" ;
	}
	else
	{
		cPostL = "¸¦" ;
		cPostN = "´Â" ;
	}

	if( nStrSize == 0 && nMin > 0 )
	{
		ErrorMessage = sName + cPostL + "  ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." ;
		return false ;
	}

	if( nMin == 0 && nStrSize > nMax )
	{
		ErrorMessage = sName + cPostN + " " + nMax +
			"ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.\nÇöÀç ÀÔ·ÂµÈ ±æÀÌ : " +
			nStrSize + "ÀÚ" ;
		return false;
	}
	if( nStrSize < nMin || nStrSize > nMax )
	{
		ErrorMessage = sName + cPostN + " " + nMin +
			"ÀÚ ÀÌ»ó, " + nMax +
			"ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.\nÇöÀç ÀÔ·ÂµÈ ±æÀÌ : " +
			nStrSize + "ÀÚ" ;
		return false ;
	}

	return true ;
}

/**
 * ÀÌ¸ÞÀÏÀ» FormatÀ» Ã¼Å©ÇÑ´Ù.
 */
function isEmail( emailObj, isNeed )
{
	var i ;
	var s ;
	if( !IsCheckValidString( emailObj.value, EMAIL ) )
	{
		alert( "[¸ÞÀÏÁÖ¼Ò]¿¡ Àß¸øµÈ ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù." );
		alertInput( emailObj );
		return false;
	}

	if( !IsCheckEnglish( emailObj.value, "[ÀÌ¸ÞÀÏ]", 7, 50, 0 ) )
	{
		alert( "[ÀÌ¸ÞÀÏ]¿¡ Àß¸øµÈ ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù." );
		alertInput( emailObj );
		return false;
	}

	i = emailObj.value.indexOf('@');
	if( i<=0 || i == emailObj.value.length-1 )
	{
		alert( "[¸ÞÀÏÁÖ¼Ò]Àº webmaster@example.com µîÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
		alertInput( emailObj );
		return false;
	}

	i = emailObj.value.indexOf( '.', i+1 ) ;
	if( i<=0 || i == emailObj.value.length-1 )
	{
		alert( "[¸ÞÀÏÁÖ¼Ò]Àº webmaster@example.com µîÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." );
		alertInput( emailObj );
		return false;
	}

	/*
	s = sEmail.substring( i+1 ) ;
	if( !IsCheckValidStringType( s, SALPHA ) )
	{
		ErrorMessage = "[¸ÞÀÏÁÖ¼Ò]Àº webmaster@toxmall.com µîÀÇ ÇüÅÂ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù." ;
		return false ;
	}
	*/
	return true;
}

/**
 * ÁÖ¹®µî·Ï FormatÀ» Ã¼Å©ÇÑ´Ù.
 */
function isResident( sRIDFirst, sRIDLast, isNeed )
{
	var chk		= 0 ;

	// °ø¹é Ã¼Å©
	if( isNeed )
	{
		if( isBlank( sRIDFirst ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ ¾ÕºÎºÐ]Àº ²À ÀÛ¼ºÇØ¾ß ÇÕ´Ï´Ù." );
			alertInput( sRIDFirst );
			return false;
		}
		if( isBlank( sRIDLast ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ µÞºÎºÐ]Àº ²À ÀÛ¼ºÇØ¾ß ÇÕ´Ï´Ù." );
			alertInput( sRIDLast );
			return false;
		}
	}

	// ÁÖ¹Î¹øÈ£ ¾ÕÀÌ³ª µÞÀÚ¸®¿¡ °ªÀÌ ÀÔ·ÂµÇ¾î ÀÖ´Ù¸é, Ã¼Å©.
	if( !isBlank( sRIDFirst ) || !isBlank( sRIDLast ) )
	{
		if( !IsNumeric( sRIDFirst.value ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ ¾ÕºÎºÐ]Àº ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( sRIDFirst );
			return false;
		}
		if( !IsNumeric( sRIDLast.value ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ µÞºÎºÐ]Àº ¼ýÀÚ¸¸ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( sRIDLast );
			return false;
		}

		var nYear	= sRIDFirst.value.substring(0,2) ;
		var nMondth = sRIDFirst.value.substring(2,4) ;
		var nDay	= sRIDFirst.value.substring(4,6) ;

		var nSex	= sRIDLast.value.charAt(0) ;

		if( !IsCheckValidString( sRIDFirst.value, NUM ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ ¾ÕºÎºÐ]¿¡ Àß¸øµÈ ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù." );
			alertInput( sRIDFirst );
			return false;
		}

		if( sRIDFirst.value.length!=6 ||  nMondth<1 || nMondth>12 || nDay<1 || nDay>31)
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ ¾ÕºÎºÐ]À» Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( sRIDFirst );
			return false;
		}

		if( !IsCheckValidString( sRIDLast.value, NUM ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ µÞºÎºÐ]¿¡ Àß¸øµÈ ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù." );
			alertInput( sRIDFirst );
			return false;
		}

		if( sRIDLast.value.length!=7 || ( nSex!=1 && nSex!=2 && nSex!=3 && nSex!=4 ) )
		{
			alert( "[ÁÖ¹Îµ¿·Ï¹øÈ£ µÞºÎºÐ]À»Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( sRIDLast );
			return false;
		}

		var i;

		// a1*2+a2*3+a3*4+a4*5+a5*6+a6*7
		for( i=0; i<6; i++ )
		{
			chk += ( ( i+2 ) * parseInt( sRIDFirst.value.charAt( i ) ) ) ;
		}

		// b1*8+b2*9+b3*2+b4*3+b5*4+b6*5
		for( i=6; i<12; i++ )
		{
			chk += ( ( i%8+2 ) * parseInt( sRIDLast.value.charAt( i-6 ) ) ) ;
		}

		chk = 11 - ( chk%11 ) ;
		chk %= 10 ;

		if( chk != parseInt( sRIDLast.value.charAt( 6 ) ) )
		{
			alert( "[ÁÖ¹Îµî·Ï¹øÈ£]°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù. È®ÀÎÇÏ½Å ÈÄ¿¡ Á¤È®È÷ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À." );
			alertInput( sRIDFirst );
			return false;
		}
	}

	return true;
}

///////// »ç¿ëÇÒ Fuction ///////////////////////////////////////////////////////////////////////

function isDate( obj, title, isNeed )
{
	return dateCheck( obj, title, isNeed );
}

function isNumber( obj, title, isNeed )
{
	return numberCheck( obj, title + 'Àº(´Â) ¹Ýµå½Ã ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.', 0, 14, isNeed );	// 10 Á¶±îÁö ÀÔ·Â°¡´É.
}

function isString( obj, title, isNeed )
{
	return stringCheck( obj, title + "Àº(´Â) ¹Ýµå½Ã ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.", isNeed );
}

function isTel( tel1, tel2, tel3, title, isNeed )
{
	if( isNeed )
	{
		if( isBlank( tel1 ) )
		{
			alert( title + "ÀÇ Ã¹Â°ÀÚ¸®¸¦ ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( tel1 );
			return false;
		}
		if( isBlank( tel2 ) )
		{
			alert( title + "ÀÇ µÑÂ°ÀÚ¸®¸¦ ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( tel2 );
			return false;
		}
		if( isBlank( tel3 ) )
		{
			alert( title + "ÀÇ ¼ÂÂ°ÀÚ¸®¸¦ ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( tel3 );
			return false;
		}
	}

	msg = title + "Àº(´Â) ¹Ýµå½Ã ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.";
	// ÇÏ³ª¶óµµ ÀÔ·ÂµÇ¾ú´Ù¸é Ã¼Å©.
	if( !isBlank( tel1 ) || !isBlank( tel2 ) || !isBlank( tel3 ) )
	{
		if( !checkNumber( tel1.value, isNeed ) )
		{
			alert( msg );
			alertInput( tel1 );
			return false;
		}
		else if( !checkNumber( tel2.value, isNeed ) )
		{
			alert( msg );
			alertInput( tel2 );
			return false;
		}
		else if( !checkNumber( tel3.value, isNeed ) )
		{
			alert( msg );
			alertInput( tel3 );
			return false;
		}
	}

	return true;
	//return telephoneCheck( obj, title + "Àº(´Â) ¹Ýµå½Ã ¿¹)'000-0000-0000' ¿Í °°ÀÌ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.", isNeed );
}

/*
 * ÇÚµåÆù ¹øÈ£ Ã¼Å©
 */
function isCellPhone( cp1, cp2, cp3, isNeed )
{
	var msg = "ÇÚµåÆùÀº ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.";
	if( isNeed )
	{
		if( isBlank( cp1 ) )
		{
			alert( 'ÇÚµåÆùÀÇ Ã¹Â°ÀÚ¸®¸¦ ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.' );
			alertInput( cp1 );
			return false;
		}
		if( isBlank( cp2 ) )
		{
			alert( 'ÇÚµåÆùÀÇ µÑÂ°ÀÚ¸®¸¦ ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.' );
			alertInput( cp2 );
			return false;
		}
		if( isBlank( cp3 ) )
		{
			alert( 'ÇÚµåÆùÀÇ ¼ÂÂ°ÀÚ¸®¸¦ ¹Ýµå½Ã ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.' );
			alertInput( cp3 );
			return false;
		}
	}

	msg = "ÇÚµåÆùÀº ¹Ýµå½Ã ¼ýÀÚ·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.";
	// ÇÏ³ª¶óµµ ÀÔ·ÂµÇ¾ú´Ù¸é Ã¼Å©.
	if( !isBlank( cp1 ) || !isBlank( cp2 ) || !isBlank( cp3 ) )
	{
		if( !checkNumber( cp1.value, isNeed ) )
		{
			alert( msg );
			alertInput( cp1 );
			return false;
		}
		else if( !checkNumber( cp2.value, isNeed ) )
		{
			alert( msg );
			alertInput( cp2 );
			return false;
		}
		else if( !checkNumber( cp3.value, isNeed ) )
		{
			alert( msg );
			alertInput( cp3 );
			return false;
		}

		if( cp1.value != "011" && cp1.value != "017" && cp1.value != "016" && cp1.value != "018" && cp1.value != "019" && cp1.value != "010" )
		{
			alert( "ÇÚµåÆùÀº '011,017,016,018,019,010' ÁßÀÇ ÇÏ³ª·Î ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À." );
			alertInput( cp1 );
			return false;
		}
	}

	return true;
	//return telephoneCheck( obj, title + "Àº(´Â) ¹Ýµå½Ã ¿¹)'000-0000-0000' ¿Í °°ÀÌ ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.", isNeed );
}

/*
 * Radio ¼±ÅÃ ¿©ºÎ
 */
function isRadio( obj, title )
{
	return checkRadio( obj, title + "À»(¸¦) ¼±ÅÃÇØÁÖ½Ê½Ã¿À.");
}

/*
 * ½ºÆä¼È ¹®ÀÚ°¡ ÀÖ´ÂÁö Ã¼Å©(Á¸ÀçÇÏ¸é : true)
 */
function isSpecialChar( obj )
{
	return !IsCheckValidString( obj.value, SALPHA+NUM );
}

/*
 * ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÀ» ÇØ¾ß ÇÒ°æ¿ì
 */

function isSpecial(obj, title, isNeed)
{
	if( !isSpecialChar(obj) )
	{
		return stringCheck( obj, title + "Àº(´Â) ¹Ýµå½Ã ÀÔ·ÂÇØÁÖ½Ê½Ã¿À.", isNeed );
	} else
	{
		alert( title + "Àº(´Â) ¹Ýµå½Ã ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿À." );
		alertInput( obj );	
	}
}

function isSelect(obj, title, isNeed)
{
	if( typeof( obj ) == "object" )
	{
		if(obj.value == "")
		{
			alert( title +'Àº(´Â) ¹Ýµå½Ã ¼±ÅÃÇØ ÁÖ½Ê½Ã¿À.' );
			alertInput( obj );
		
			return false;
		}

		return true;
	} else {
		alert("Object °¡ ¾Æ´Õ´Ï´Ù.");
		return false;
	}
}

function limit( str, num1, num2 )
{
	if( str.length >= num1 && str.length <= num2  )
		return true;
	else
		return false;
}


function isLoginId(obj)
{
	if( isSpecialChar(obj) )
	{
		alert( "¾ÆÀÌµð´Â ¹Ýµå½Ã ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À¸·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿À." );
		alertInput( obj );	
	} else
	{
		if( !limit(obj.value, 4, 12) )
		{
			alert( "¾ÆÀÌµð´Â ¹Ýµå½Ã 4ÀÚ ÀÌ»ó 12ÀÚ ÀÌÇÏ·Î ÀÔ·ÂÇØÁÖ½Ê½Ã¿À." );
			alertInput( obj );			
		} else
		{
			return true;
		}
	}
}
