//==============================================================
//Prototype Base Function Lib
function loadAjaxXML(url, pars, fncSuccess, fncFailure){
	var myAjax = new Ajax.Request(
					url, 
					{
							method: 'get',
							parameters: pars,
							onSuccess: fncSuccess,
							onFailure: fncFailure
					});
}
//==============================================================
//==============================================================

// Ajax Process Function
// url = Call Page Full URL INCOUDE PARAMITER
function AjaxProc(url)
{	
	loadAjaxXML(url, '', AjaxSuc, AjaxFail);
}
// Ajax Process Success Function
// originalRequest = Ajax Request
function AjaxSuc(originalRequest)
{
	var objXML;
	objXML = new JSONParser(originalRequest);
	var json = objXML.data;


	if ( json.Content.IsAlert != "" && json.Content.IsAlert != null && json.Content.IsAlert == "1" ) {
		alert(json.Content.Message);
	}
	
	if ( json.Content.IsFunction != "" && json.Content.IsFunction != null && json.Content.IsFunction == "1" ) {
		eval(json.Content.FunctionName);
	}
}
// Ajax Process Fail Function
function AjaxFail()
{
        alert("처리에 실패하였습니다.");
}


function leftloginpop() {
	var winopts = "width=1000,height=750,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=10,left=10";
	window.open("/popup/popup_member_join.html","mempop", winopts);
}

function WindowOpen(Url, popName, popwidth, popheight){
	var height = screen.height;
	var width = screen.width;
	var left = 0;
	var top = 0;
	popheight = popheight + 27;
	window.open(Url, popName, "width="+popwidth+",height="+popheight+",scrollbars=no,toolbar=no,left="+left+",top="+top+"")
}

function fnResizePopup(nWidth, nHeight)
 {
   var strAgent = navigator.userAgent.toLowerCase();
   var bIE = (strAgent.indexOf("msie") != -1);
   var bXP = (strAgent.indexOf("nt 5.1") != -1);
   var bIE7 = (strAgent.indexOf("msie 7.0") != -1);
   var bSafari = (strAgent.indexOf("konqueror") != -1 || strAgent.indexOf("safari") != -1);
   var bFirefox = (strAgent.indexOf("firefox")!= -1);
   window.resizeTo(nWidth, nHeight + (bXP ? (bIE7 ? 40: 20) : 0));
 }

 
function MemberJoin()
{
        opener.leftloginpop() ;
        self.close();
}


function check_email(index_email1,index_email2)
{	
	var m_mail = index_email1 + '@' + index_email2;
	if(m_mail == "") return;
	if(m_mail.indexOf('@', 1) == -1 || m_mail.length < 5) {
		alert("전자메일 주소를 정확하게 입력하여 주십시오");
		document.fo.email_1.value = "";
		document.fo.email_1.focus();
	}
	var l_num = m_mail.length;
	if(m_mail.substring(l_num-11,l_num) == "hanmail.net") {
		alert("hanmail.net 계정은 입력할 수 없습니다.");
		document.fo.email_3.value = "";
		document.fo.email_1.value = "";
		document.fo.email_1.focus();
	}
	if(m_mail.substring(l_num-8,l_num) == "daum.net") {
		alert("daum.net 계정은 입력할 수 없습니다.");
		document.fo.email_3.value = "";
		document.fo.email_1.value = "";
		document.fo.email_1.focus();
	}
}

var popWindow = null;
function newpanel(filename, height, width)
{
	var winopts;
	winopts = "width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
	var popWindow = window.open(filename,'panel', winopts);
	if (navigator.appVersion.indexOf("(X11") != -1 || navigator.appVersion.indexOf("(MSIE") != -1) {
		popWindow = window.open(filename,'panel', winopts);
		remote.opener.name="opener";
	}
	popWindow.display = self;
}

function GetPost(m_post1,m_post2,  m_addr)
{
	str="/mypage/pop_getpost.asp?post1=" + m_post1 + "&post2=" + m_post2 + "&addr=" + m_addr;
	newpanel(str, 250, 420);
}


function popReceipt(tno)
{
		if(tno !="")
			gourl = "http://admin.kcp.co.kr/Modules/Sale/Card/ADSA_CARD_BILL_Receipt.jsp?c_trade_no="+tno;
			window.open(gourl, 'receipt', "width=350,height=630,scrollbars=no,toolbar=no,left=0,top=0")
}

function popCerti(sicode)
{
		if(sicode !="")
			gourl = "/popup/certi.asp?sicode="+sicode;
			window.open(gourl, 'certi', "width=600,height=830,scrollbars=no,toolbar=no,left=0,top=0")
}

			
function popValid(sicode)
{
		if(sicode !="")
			gourl = "/popup/valid.asp?sicode="+sicode;
			window.open(gourl, 'valid', "width=595,height=890,scrollbars=no,toolbar=no,left=0,top=0")
}


//document.oncontextmenu = onContext;   // 임의의 함수 지정
//document.ondragstart=ondrag;              // 임의의 함수 지정
//document.onselectstart=onselect;         // 임의의 함수 지정

 

//if (document.layers) 
//document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT) 

//document.onmouseover=hidestatus 
//document.onmouseout=hidestatus 


//function hidestatus(){ 
// window.status='' 
// return true; 
//} 
     
//function onContext(){

// event.cancelBubble = true;
// event.returnValue = false;

// document.body.style.pixelLeft = event.x;
// document.body.style.pixelTop = event.y;
// document.body.style.display = "";
//}

 

//function ondrag(){

 //event.cancelBubble = true;
 //event.returnValue = false;

 //document.body.style.pixelLeft = event.x;
 //document.body.style.pixelTop = event.y;
 //document.body.style.display = "";
//}

 

//function onselect(){
 //event.cancelBubble = true;
// event.returnValue = false;

 //document.body.style.pixelLeft = event.x;
// document.body.style.pixelTop = event.y;
// document.body.style.display = "";
//}

