
function OpenLayer(LayerNam,TopMargin) {
	var LayerWidth = $(LayerNam).style.width;
	LayerWidth = LayerWidth.replace('px','');
	$(LayerNam).style.left=(document.body.scrollWidth-LayerWidth)/2+'px';
	if(TopMargin=="") TopMargin=200;
	var tPos=parseInt(TopMargin)+parseInt(document.documentElement.scrollTop);
	//document.getElementById(LayerNam).style.top=tPos/2+'px';	
	$("WaitLayer").style.height=( document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight  ) + 'px';
	$("WaitLayer").style.filter="alpha(opacity=16);"; //IE¿ë
	$("WaitLayer").style.opacity=0.16; //±âÅ¸ ºñ IE¿ë
	$("WaitLayer").style.display="";
	$(LayerNam).style.display="";
	
	//MoreBright(LayerNam,80,tPos-8,tPos);	
	
	$(LayerNam).style.top=tPos+'px';
	$(LayerNam).style.filter="alpha(opacity=100);";	//IE¿ë
	$(LayerNam).style.opacity=1;						//±âÅ¸ ºñ IE¿ë
	if(LayerNam=='LayerLogin2') {
        if(document.frmLogin2.ID.value=="") {
            document.frmLogin2.ID.focus();
        }
        else {
            document.frmLogin2.PassWord.focus();
        }
    }
}

function MoreBright(LayerNam,opacityValue,TopMargin,tPos){
	var oV = opacityValue;
	$(LayerNam).style.filter="alpha(opacity="+ oV +");";	//IE¿ë
	$(LayerNam).style.opacity=oV/100;						//±âÅ¸ ºñ IE¿ë
	$(LayerNam).style.top=TopMargin+'px';
	if(oV >= 100) {
	    if(LayerNam=='LayerLogin2') {
	        if(document.frmLogin2.ID.value=="") {
	            document.frmLogin2.ID.focus();
	        }
	        else {
	            document.frmLogin2.PassWord.focus();
	        }
	    }
	    return;
	}
	oV = oV + 10;
	TopMargin=TopMargin+2;
	if(TopMargin>=tPos) TopMargin=tPos;
	setTimeout("MoreBright('"+LayerNam+"'," + oV + "," + TopMargin + "," + tPos + ")",100);
}

function CloseLayer(LayerNam) {
	$("WaitLayer").style.display="none";
	LessBright(LayerNam,100);
}

function CloseLayer2(LayerNam) {
    $("WaitLayer").style.display="none";
	$(LayerNam).hide();
}

function LessBright(LayerNam,opacityValue){
	var oV = opacityValue;
	$(LayerNam).style.filter="alpha(opacity="+ oV +");";	//IE¿ë
	$(LayerNam).style.opacity=oV/100;						//±âÅ¸ ºñ IE¿ë
	//document.getElementById(LayerNam).filters.alpha.opacity = oV;
	if(oV <= 0) {
		$(LayerNam).style.display="none";
		//eval(LayerNam).style.display="none";
		return;
	}
	oV = oV - 20;
	setTimeout("LessBright('"+LayerNam+"'," + oV + ")",50);
}

function WaitGo() {
	var LayerWidth = 442;
	$("WaitPop").style.left=(document.body.scrollWidth-LayerWidth)/2+'px';
	$("WaitPop").style.top=document.documentElement.scrollTop+200+'px';

	$("WaitLayer").style.height=( document.body.scrollHeight > document.body.clientHeight ? document.body.scrollHeight : document.body.clientHeight  ) + 'px';
	$("WaitLayer").style.filter="alpha(opacity=16);"; //IE¿ë
	$("WaitLayer").style.opacity=0.16; //±âÅ¸ ºñ IE¿ë
	$("WaitLayer").style.display="";
	$("WaitPop").style.display="";
}

function WaitOut() {
	$("WaitLayer").style.display="none";
	$("WaitPop").style.display="none";
}

function loginenter(event) {
	var KeyValue = (window.netscape) ? event.which : event.keyCode;
	if (KeyValue == 13 ) {
		LoginGo();
	}
}

function BigImgView(G_Cod) {
	window.open('/popup/Popup_BigImg.asp?G_Cod=' + G_Cod,'È®´ëÀÌ¹ÌÁö','width=475, height=600,top=0,left=0, resize=yes'); 
}
	
//¹è³Ê ·Î±×
function LogBanner(SessionID, BanCod){
	iProc.location.href="/Public/LogBanner.asp?SessionID="+SessionID+"&BanCod="+BanCod;
}

//¼¼ÀÚ¸®¾¿ , ³Ö±â
function CurFormat(obj) 
{ 
    var txtNumber;
    if (obj =='[object]')  
        txtNumber= obj.value;
    else
        txtNumber= obj;

    txtNumber = String(txtNumber);  
    if (isNaN(filterNum(txtNumber))) 
    {
        if (obj =='[object]')  
            obj.value = ""; 
        return;
    }

    var rxSplit = new RegExp('([0-9])([0-9][0-9][0-9][,.])');
    var arrNumber = txtNumber.split('.'); 
    var result;
    arrNumber[0] += '.';

    do
    {
        arrNumber[0] = arrNumber[0].replace(rxSplit, '$1,$2');
    } while (rxSplit.test(arrNumber[0]));
 
    if (arrNumber.length > 1) 
        result = arrNumber.join(''); 
    else
        result = arrNumber[0].split('.')[0]; 
    if (obj =='[object]') 
        obj.value = result;

    return result; 
}

//,¾ø¾Ö±â
function filterNum(str){
    re = /^\$|,/g;
    str = String(str);
    return str.replace(re, "");
} 

function EscrowChk(){
	var status  = "width=500 height=450 menubar=no,scrollbars=no,resizable=no,status=no";
	var obj     = window.open('', 'kcp_pop', status);

	document.shop_check.method = "post";
	document.shop_check.target = "kcp_pop";
	document.shop_check.action = "http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp";
	document.shop_check.submit();
}