require(['config'], function() {
	require([
	], function($) {
		mobPageObj.init();
	});
});

/*API URL*/
const API_MOBILE_GRID_LIST 			= '/api/dspt/mng/detail-grid-list';	// 목록
const API_MOBILE_INFO 				= '/api/dspt/mng/info-dspt';		// 상세
const API_MOBILE_DSPT_REQ			= '/api/dspt/mng/request-dspt';		// 신규/승인
const API_MOBILE_DSPT_REJ			= '/api/dspt/mng/remove-dspt';		// 삭제/반려
const API_MOBILE_APPROVE			= '/api/dspt/mng/approve-dspt';		// 승인
const API_MOBILE_REJECT				= '/api/dspt/mng/reject-dspt';		// 반려
const API_POP_SEARCH_LIST			= '/api/store/pop-grid-list';

// 이지페이 결제 생성
let EASYPAY_PAYMENT_CREATE 			= '/api/easypay/payment/create';

const PAGE_MODE_LIST				= "LIST";
const PAGE_MODE_VIEW				= "VIEW";

let mobPageObj = {
	viewMode: PAGE_MODE_LIST,
	init: function () {
		this.ui.init();
		this.event.init();
		this.ready();
	},
	ui: {
		init: function () {
			this.view();
			this.info();
		},
		view: function() {
			// 공통코드 표시
			$('select').each(function() {
				if($(this).data('select-code')) {
					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
				}
			});

			// 조회일자 지정
			$('#ITP_MOBILE_MLOANMNG02010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
			$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_FROM_DT').datepicker('setDate', itp_fn_date_add('M', -1));
			$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_TO_DT').datepicker('setDate', itp_fn_date_add('M', 0));
			$('#ITP_FORM_MLOANMNG02010_POP_DPST_DT').datepicker('setDate', itp_fn_date_add('M', 0));

			fn_make_user_info.get('apprYn') === 'Y' ? $('#ITP_BTN_MLOANMNG02010_LIST_PAY').show() : $('#ITP_BTN_MLOANMNG02010_LIST_PAY').hide();

			if(fn_make_user_info.get('authTpCd') === '50') {
				$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val(fn_make_user_info.get('storeNm'));
				$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_BTN_MLOANMNG02010_LIST_SEARCH_RTN_PLACE').hide();
				$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_BTN_MLOANMNG02010_LIST_DELETE_RTN_PLACE').hide();
			}
			itp_fn_form_event.onKeyup('#ITP_FORM_MLOANMNG02010_PAY');
		},
		info: function() {
			$('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
			$('input:hidden[id$="_STORE_ID"]').val(fn_make_user_info.get('storeId'));
		}
	},
	event: {
		init: function() {
			this.action();
		},
		action: function() {
			$('button[id^="ITP_BTN_MLOANMNG02010_LIST"]').on('click', function() {
				var id = $(this).attr('id');
				switch (id) {
					case 'ITP_BTN_MLOANMNG02010_LIST_SEARCH_RTN_PLACE'	: mobPopObj.popStoreNm.init(); 			break;
					case 'ITP_BTN_MLOANMNG02010_LIST_DELETE_RTN_PLACE'	: mobPopObj.popStoreNm.delete(); 		break;
					case 'ITP_BTN_MLOANMNG02010_LIST_PAY'				: mobContObj.list.payment.view();		break;
					case 'ITP_BTN_MLOANMNG02010_LIST_ADD'				: mobContObj.list.add();				break;
					case 'ITP_BTN_MLOANMNG02010_LIST_SEARCH'			: mobContObj.list.search();				break;
				}
				return false;
			});

			$('button[id^="ITP_BTN_MLOANMNG02010_PAY"]').on('click', function() {
				var id = $(this).attr('id');
				switch (id) {
					case 'ITP_BTN_MLOANMNG02010_PAY_REQ'				: mobContObj.list.payment.view();	break;
					case 'ITP_BTN_MLOANMNG02010_PAY_CANCEL'				: mobContObj.list.payment.cancel();	break;
				}
				return false;
			});

			$('select[id^="ITP_FORM_MLOANMNG02010_VIEW_EMAIL_CD"]').on('change', function() {
				var val = $(this).val();
				var emailId = '#ITP_FORM_MLOANMNG02010_VIEW_PAY_EMAIL_NM';
				if(val === '') {
					$(emailId).val('');
					$(emailId).attr('readonly', false);
				} else {
					$(emailId).val($(this).val());
					$(emailId).attr('readonly', true);
				}
			});

			$(document).on('click', '#ITP_LIST_MLOANMNG02010_LIST_ITEM_ROWS li', function(e) {
				var index = $(this).index();
				if($(e.target).hasClass('AGR')) {
					mobContObj.list.agree(index);
				} else if($(e.target).hasClass('RJT')) {
					mobContObj.list.reject(index);
				} else {
				}
			});

			$(document).on('click', '#ITP_LIST_MLOANMNG02010_POP_STORE_ROWS li button', function() {
				mobPopObj.popWhsNm.choice($(this));
			});
		}
	},
	switchScreen: function(mode) {
		this.viewMode = mode;
		$('#ITP_MOBILE_MLOANMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
			$(this).hide();
		});
		if(mode === PAGE_MODE_LIST) {
			$('#ITP_AJAX_MLOANMNG02010_LIST_CONTAINER').show();
		} else if(mode === PAGE_MODE_VIEW) {
			$('#ITP_AJAX_MLOANMNG02010_VIEW_CONTAINER').show();
			CommonObj.moreView('#ITP_LIST_MLOANMNG02010_ITEM_AREA', false);
		}
	},
	ready: function() {
		mobContObj.list.init();
	}
};

let mobContObj = {
	list: {
		listPage: 1,
		rows: [],
		init: function() {
			mobPageObj.switchScreen(PAGE_MODE_LIST);
			this.search();
		},
		search: function() {
			this.listPage = 1;
			this.rows.length = 0;
			$('#ITP_LIST_MLOANMNG02010_LIST_ITEM_ROWS').empty();
			setTimeout(function() {
				mobContObj.list.load();
			}, 100);
		},
		pager: function(totPage) {
			(this.listPage < totPage) ?
				CommonObj.moreView('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA', true, mobContObj.list.load) :
				CommonObj.moreView('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA', false);
			this.listPage += 1;
		},
		load: function() {
			var _this = this;
			var callbackFn = function(result) {
				console.log(result);
				mobContObj.list.pager(result.gridTotal);
				$.each(result.gridRows, function (i, item) {
					$('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MLOANMNG02010_LIST_ITEM_ROWCOPY').html());
					var $li = $('#ITP_LIST_MLOANMNG02010_LIST_ITEM_AREA .panel-group > .item-row:last');
					$li.find('.fnStoreNm').text(item.storeNm);
					$li.find('.fnLoanDvsnNm').text(item.loanDvsnNm);
					$li.find('.fnReqDt').text(item.reqDt);
					$li.find('.fnDpstDt').text(item.dpstDt);
					$li.find('.fnDpstAmt').text(CommonObj.currency.add(item.dpstAmt));
					$li.find('.fnDpstNm').text(CommonObj.nullToString(item.dpstNm));
					$li.find('.fnDpstAuthDt').text(CommonObj.nullToString(item.dpstAuthDt));
					$li.find('.fnDpstRjctDt').text(CommonObj.nullToString(item.dsptRjctDt));
					$li.find('.fnRcvAcctNo').text(CommonObj.nullToString(item.rcvAcctNo));
					$li.find('.fnDpstBnkNm').text(CommonObj.nullToString(item.dpstBnkNm));
					$li.find('.fnDpstStNm').text(CommonObj.nullToString(item.dpstStNm));
					(fn_make_user_info.get('authTpCd') === '50') ? $li.find('.btn-dpst').hide() : (item.dpstStCd === 'DP01') ? $li.find('.btn-dpst').show() : $li.find('.btn-dpst').hide();
					mobContObj.list.rows.push(item);
				});
			};
			const param = $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH').serializeObject();
			param.gridPage = mobContObj.list.listPage;
			param.gridSize = mobile_list_size;
			// console.log(JSON.stringify(param));
			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST');
		},
		payment: {
			view: function() {
				var storeId = $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val();
				if(storeId.length < 1) {
					itp_fn_modal_alert('신규입금 처리를 위한 매장을 선택하세요.');
					return;
				}
				this.popup();
			},
			popup: function() {
				// 결제 팝업 결과
				var popFn = function(rowDataPop) {
					console.log(JSON.stringify(rowDataPop));
					mobContObj.grid.search();
				};
				// 결제 팝업
				// 결제타입코드 : 10(선불(충전)), 20(후불(결제)), 30(후불(선결제)), 30(후불(선결제))
				var loanDvsn = $('#ITP_FORM_LOANMNG02010_SEARCH_STORE_LOAN_DVSN').val();
				var args = {
					'payTpCd': loanDvsn === 'LD01' ? '10' : '30',
					'brandId': $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_BRAND_ID').val(),
					'storeId': $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val()
				};
				fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', popFn, args, 'M');
			},
		},
		add: function() {
			var storeId = $('#ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val();
			if(storeId.length < 1) {
				itp_fn_modal_alert('신규입금 처리를 위한 매장을 선택하세요.');
				return;
			}
			mobPopObj.popDpstReq.init();
		},
		agree: function(index) {
			var item = this.rows[index];
			if(item.dpstStCd !== 'DP01') {
				itp_fn_modal_alert('입금요청 건만 승인처리를 할 수 있습니다.');
				return;
			}
			if(confirm(ITP_MSG_LOCALE.message.form.procData)) {
				var param = {"dsptMgntNoList": [item.dsptMgntNo]};
				fn_ajax_call(API_MOBILE_APPROVE, JSON.stringify(param), function() { mobContObj.list.search(); }, 'POST');
			}
		},
		reject: function(index) {
			var item = this.rows[index];
			if(item.dpstStCd !== 'DP01') {
				itp_fn_modal_alert('입금요청 건만 반려처리를 할 수 있습니다.');
				return;
			}
			mobPopObj.popDpstRjct.init(item);
		}
	},
	view: {
		init: function(item) {
			mobPageObj.switchScreen(PAGE_MODE_VIEW);
			this.search(item);
		},
		search: function(item) {
			var _this = this;
			var callbackFn = function(result) {
				console.log(result);
				_this.view(result);
			};
			const param = {
				'brandId': fn_make_user_info.get('brandId'),
				'spplyId': fn_make_user_info.get('spplyId'),
				'loanMgntUnqNo': item.loanMgntUnqNo
			};
			fn_ajax_call(API_MOBILE_INFO, param, callbackFn, 'GET');
		},
		view: function(result) {
			var _this = this;
			var id = '#ITP_AJAX_MLOANMNG02010_VIEW_CONTAINER';
			$(id).find('.fnStoreNm').text(result.storeNm);
			$(id).find('.fnLoanDvsnNm').text(result.loanDvsnNm);
			var limitAmt;
			if(result.loanDvsn == 'LD01') { // 선불(충전)
				limitAmt = result.chrgeLimitAmt;
			} else if(result.loanDvsn == 'LD02') { // 후불(신용)
				limitAmt = result.credtLimitAmt;
			}
			$(id).find('.fnLimitAmt').text(CommonObj.currency.add(limitAmt));
			$(id).find('.fnUseYnNm').text(result.useYnNm);
			$(id).find('.fnPosbLimitAmt').text(CommonObj.currency.add(limitAmt - result.useAmtTotal));
			$(id).find('.fnTmpRcvAcctTotal').text(CommonObj.currency.add(result.tmpRcvAcctTotal));
			$(id).find('.fnUseAmtTotal').text(CommonObj.currency.add(result.useAmtTotal));
			_this.history.init(result.loanMgntUnqNo);
		},
		payment:function() {
			location.replace('app:payment');
		},
		cancel: function () {
			var id = '#ITP_AJAX_MLOANMNG02010_VIEW_CONTAINER';
			$(id).find('.fnItemid').text('');
			$(id).find('.fnItemNm').text('');
			$(id).find('.fnUPodrQty').text('');
			$(id).find('#ITP_FORM_MLOANMNG02010_VIEW_TRSC_AMT').val('');
			$(id).find('#ITP_FORM_MLOANMNG02010_VIEW_MBL_NO').val('');
			$(id).find('#ITP_FORM_MLOANMNG02010_VIEW_PAY_EMAIL_ID').val('');
			$(id).find('#ITP_FORM_MLOANMNG02010_VIEW_PAY_EMAIL_NM').val('');
			$(id).find('#ITP_FORM_MLOANMNG02010_VIEW_EMAIL_CD').val('');
			mobPageObj.switchScreen(PAGE_MODE_LIST);
		}
	}
};

let mobPopObj = {
	popStoreNm: {
		popId: 'ITP_POP_MLOANMNG02010_STORE_AREA',
		rows: [],
		init: function () {
			this.rows.length = 0;
			mobPopObj.show(this.popId);
			this.search();
			this.action();
		},
		search: function () {
			var _this = this;
			$('#ITP_LIST_MLOANMNG02010_POP_STORE_AREA .panel-group').empty();
			var callbackFn = function(result) {
				console.log(result);
				_this.view(result.gridRows);
			};
			const param = $('#ITP_FORM_MLOANMNG02010_POP_STORE').serializeObject();
			fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
		},
		view: function(gridRows) {
			this.rows = gridRows;
			$.each(gridRows, function (i, item) {
				$('#ITP_LIST_MLOANMNG02010_POP_STORE_AREA .panel-group').append($('#ITP_LIST_MLOANMNG02010_POP_STORE_ROWCOPY').html());
				var $li = $('#ITP_LIST_MLOANMNG02010_POP_STORE_AREA .panel-group > .row_2:last');
				$li.find('.fnStoreNm').text(item.storeNm);
				$li.find('.fnStoreStNm').text(item.storeStNm);
				$li.find('.fnStoreId').data('store-id', item.storeId);
			});
		},
		choice: function(elem) {
			var _this = this;
			var storeId = $(elem).data('store-id');
			$.each(this.rows, function (i, item) {
				if(storeId === item.storeId) {
					$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val(item.storeId);
					$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val(item.storeNm);
					$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_LOANMNG02010_SEARCH_STORE_LOAN_DVSN').val(item.loanDvsn);
					_this.close();
					return false;
				}
			});
		},
		action: function() {
			var _this = this;
			$('button[id^="ITP_BTN_MLOANMNG02010_POP_STORE"]').off('click').on('click', function() {
				var id = $(this).attr('id');
				switch (id) {
					case 'ITP_BTN_MLOANMNG02010_POP_STORE_SEARCH'	: _this.search();			break;
					case 'ITP_BTN_MLOANMNG02010_POP_STORE_CHOICE'	: _this.choice($(this)); 	break;
					case 'ITP_BTN_MLOANMNG02010_POP_STORE_CLOSE'	: _this.close(); 			break;
				}
				return false;
			});
		},
		delete: function() {
			$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val('');
			$('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val('');
		},
		close: function() {
			this.rows.length = 0;
			$('#ITP_POP_MLOANMNG02010_LIST_WHS_AREA .panel-group').empty();
			$('#ITP_FORM_MLOANMNG02010_POP_STORE #ITP_FORM_MLOANMNG02010_POP_STORE_KEYWORD').val('');
			mobPopObj.hide(this.popId);
		}
	},
	popDpstReq: {
		popId: 'ITP_POP_MLOANMNG02010_DPST_REQ_AREA',
		init: function() {
			this.reset();
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_BRAND_NM').val(fn_make_user_info.get('brandNm'));
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_POP_FORM_MLOANMNG02010_DPST_REQ_STORE_ID').val($('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_ID').val());
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_STORE_NM').val($('#ITP_FORM_MLOANMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_STORE_NM').val());
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_DT').val(itp_fn_date_add('M', 0));
			mobPopObj.show(this.popId);
			this.action();
		},
		action: function() {
			var _this = this;
			$('button[id="ITP_BTN_MLOANMNG02010_POP_DPST_ADD"]').off('click').on('click', function() {
				_this.save();
			});
			$('button[id="ITP_BTN_MLOANMNG02010_POP_DPST_CANCEL"]').off('click').on('click', function() {
				_this.cancel();
			});
		},
		save: function() {
			var _this = this;
			const formId = '#ITP_POP_FORM_MLOANMNG02010_DPST_REQ';
			if (itp_fn_form_event.isValid(formId)) {
				if(confirm(ITP_MSG_LOCALE.message.form.procData)) {
					var saveFn = function() {
						_this.cancel();
						mobContObj.list.search();
					};
					var param = $(formId).serializeObject();
					param.dpstDt = param.dpstDt.replace(/-/g, ".");
					console.log(JSON.stringify(param));
					fn_ajax_call(API_MOBILE_DSPT_REQ, JSON.stringify(param), saveFn, 'POST');
				}
			}
		},
		reset: function() {
			itp_fn_form_clear_validate(null,  '#ITP_POP_FORM_MLOANMNG02010_DPST_REQ');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_STORE_ID').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_BRAND_NM').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_STORE_NM').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_AMT').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_DT').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_NM').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_BNK').val('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_REQ #ITP_FORM_MLOANMNG02010_POP_DPST_ACCT_NO').val('');
		},
		cancel: function() {
			mobPopObj.hide(this.popId);
		}
	},
	popDpstRjct: {
		popId: 'ITP_POP_MLOANMNG02010_DPST_RJCT_AREA',
		init: function(item) {
			this.reset();
			this.view(item);
			this.action();
			this.dsptMgntNo = item.dsptMgntNo;
			mobPopObj.show(this.popId);
		},
		view: function(item) {
			console.log(item);
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnBrandNm').text(item.brandNm);
			$('#ITP_POP_MLOANMNG02010_DPST_RJCT_AREA .fnStoreNm').text(item.storeNm);
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstAmt').text(CommonObj.currency.add(item.dpstAmt));
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstDt').text(item.dpstDt);
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstNm').text(item.dpstNm);
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstBnk').text(item.dpstBnkNm);
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnRcvAcctNo').text(item.rcvAcctNo);
		},
		action: function() {
			var _this = this;
			$('button[id="ITP_BTN_MLOANMNG02010_POP_DPST_RJCT"]').off('click').on('click', function() {
				_this.save();
			});
		},
		save: function() {
			var _this = this;
			var reason = $('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT #ITP_POP_FORM_MLOANMNG02010_DPST_RJCT_REASON').val();
			if(reason.length < 1) {
				itp_fn_modal_alert('반려 사유를 입력해 주세요.');
				return;
			}

			var modalFn = {
				callBack: function(args) {
					var saveFn = function() {
						_this.cancel();
						mobContObj.list.search();
					};
					var param = {'dsptMgntNoList': [_this.dsptMgntNo], 'dsptRjctRsn': reason};
					fn_ajax_call(API_MOBILE_REJECT, JSON.stringify(param), saveFn, 'POST');
				}
			};
			itp_fn_modal_confirm(ITP_MSG_LOCALE.message.form.procData, modalFn);
		},
		reset: function() {
			itp_fn_form_clear_validate(null,  '#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnBrandNm').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnStoreNm').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstAmt').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstDt').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstNm').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstBnk').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT .fnDpstAcctNo').text('');
			$('#ITP_POP_FORM_MLOANMNG02010_DPST_RJCT #ITP_POP_FORM_MLOANMNG02010_DPST_RJCT_REASON').val('');
		},
		cancel: function() {
			mobPopObj.hide(this.popId);
		}
	},
	show: function(popId) {
		$('button[id$="_CLOSE"]').off('click').on('click', function() {
			console.log($(this).attr('id'));
			if($(this).hasClass('btn-pop-close')) {
				mobPopObj.hide(popId);
			}
		});
		$('#' + popId).show();
	},
	hide: function(popId) {
		$('#' + popId).closest('.mobile-pop-close').hide();
	}
};
