function isLogin() {
	if( loginMemberId == "" ) {
		document.location = "http://www.ec21.com/global/login/Login.jsp?nextUrl=" + document.location;
		return false;
	} 
	else {
		return true;
	}
}

function sendHomeInquiry(inquiry, isInquiry){
	var URL;
		URL = "http://www.ec21.com/global/basic/SendInquiry.jsp?inq_data=" + inquiry;
	/*
	if ( isInquiry )
		URL = "/global/basic/SendInquiry.jsp?inq_data=" + inquiry;
	else
		URL = "/global/basic/offerDetailLoginAlert.jsp?nextUrl="+document.location; 
*/
	open_win ( URL, 400, 250 );
}

function alertMessage(){
	var isAlert = confirm("This service is available only to members.\nPlease log in first.");

	if ( isAlert )
	{

		var uri = location.href+"";

		var reg = /%25([A-F0-9]{2})/gi;
		var uri = uri.replace(reg, "_");
		var reg2 = /([_]+)/gi;
		var uri = uri.replace(reg2, "_");

		//alert(uri);
		location.href = "http://www.ec21.com/global/login/Login.jsp?nextUrl="+ uri;
		//alert(  uri.replace("%252F","_") );

		
	}
	return;
}

//Messager script
function msg_stx(){
	var msguser = getCookie("user");
	if(msguser == null)
		msguser = "";

	EzAutoLogin.PG_Name   = 'EC21';
	EzAutoLogin.ClassName = 'TFrmMain';
	EzAutoLogin.CapName   = 'EC21 Messenger';
	EzAutoLogin.DownUrl = 'http://203.233.205.66:8080/help/Alert/popup_mesg.html';
	EzAutoLogin.UserID    = msguser;
}

function checkBrower(){
	var name = navigator.appName;
	if (name == "Microsoft Internet Explorer") {
		return true;
	}
	else {
		return false;
	}
}

function msg_run2(idx, mem, name, ins,inq){
	var tmp;
	var url = location.href;

	var isBrower = checkBrower();
	if(isBrower)
	{
		if(EzAutoLogin.object == null)
		{
			window.open('http://203.233.205.66:8080/help/Alert/popup_mesg.html?url=' + url, 'detailWin', 'toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=no, resizable=1, width=545, height=420, top=100, left=100');
			return;
		}
		else
		{
			msg_stx();
			tmp = name+"("+mem+")";
			EzAutoLogin.Msg_Run(idx, tmp,ins, inq);
		}
	}
	else
	{
		alert("EC21 Messenger is supported only by Internet Explorer.");
	}
}

function goACP(vCo_member_id){
	var URL = "http://www.ec21.com/global/acp/SelectReport.jsp?co_member_id=" + vCo_member_id;
	window.open( URL, 'acpWin', 'toolbar=1, location=1, directories=1, status=1, menubar=1, scrollbars=1, resizable=1, width=710, height=790, top=100, left=100');
}

function EnterCheck(e) {
	if(e.keyCode == 13) { 
		check_Logins();
	}
}

function check_Logins() {
	if(document.dataForm.user_id.value.length == 0) {
		document.dataForm.user_id.focus(); 
		alert("Please Enter Member ID."); 
		return false;
	} else if(document.dataForm.user_pw.value.length == 0) {
		document.dataForm.user_pw.focus(); 
		alert("Please Enter Password."); 
		return false;
	} 
}