//工商银行
var map1 = new Map();
map1.put("isCredit", true);
map1.put("debitId", "1025");
map1.put("creditId", "1027");
map1.put("alipay_debitId","ICBC-DEBIT");
map1.put("alipay_creditId","ICBCB2C");

//招商银行
var map2 = new Map();
map2.put("isCredit", true);
map2.put("debitId", "3080");
map2.put("creditId", "308");
map2.put("alipay_debitId","CMB-DEBIT");
map2.put("alipay_creditId","CMB");

//建设银行
var map3 = new Map();
map3.put("isCredit", true);
map3.put("debitId", "1051");
map3.put("creditId", "1054");
map3.put("alipay_debitId","CCB-DEBIT");
map3.put("alipay_creditId","CCB");

//农业银行
var map4 = new Map();
map4.put("isCredit", true);
map4.put("debitId", "103");
map4.put("creditId", "1031");
map4.put("alipay_debitId","");
map4.put("alipay_creditId","ABC");

//中国银行
var map5 = new Map();
map5.put("isCredit", true);
map5.put("debitId", "104");
map5.put("creditId", "106");
map5.put("alipay_debitId","BOC-DEBIT");
map5.put("alipay_creditId","BOCB2C");

//浦发银行
var map6 = new Map();
map6.put("isCredit", true);
map6.put("debitId", "314");
map6.put("creditId", "3141");
map6.put("alipay_debitId","SPDB-DEBIT");
map6.put("alipay_creditId","SPDB");

//深发展银行
var map7 = new Map();

//兴业银行
var map8 = new Map();
map8.put("isCredit", true);
map8.put("debitId", "309");
map8.put("creditId", "3091");
map8.put("alipay_debitId","");
map8.put("alipay_creditId","CIB");

//北京银行
var map9 = new Map();
map9.put("isCredit", false);
map9.put("debitId", "310");
map9.put("alipay_debitId","BJBANK");
map9.put("alipay_creditId","");

//光大银行
var map10 = new Map();
map10.put("isCredit", true);
map10.put("debitId", "312");
map10.put("creditId", "3121");
map10.put("alipay_debitId","CEB-DEBIT");
map10.put("alipay_creditId","");

//交通银行
var map11 = new Map();
map11.put("isCredit", true);
map11.put("debitId", "3407");
map11.put("creditId", "301");
map11.put("alipay_debitId","COMM");
map11.put("alipay_creditId","");

//民生银行
var map12 = new Map();
map12.put("isCredit", true);
map12.put("debitId", "305");
map12.put("creditId", "3051");
map12.put("alipay_debitId","CMBC");
map12.put("alipay_creditId","");

//中信银行
var map13 = new Map();
map13.put("isCredit", true);
map13.put("debitId", "313");
map13.put("creditId", "3131");
map13.put("alipay_debitId","CITIC-DEBIT");
map13.put("alipay_creditId","");

//广发银行
var map14 = new Map();
map14.put("isCredit", true);
map14.put("debitId", "3061");
map14.put("creditId", "3131");
map14.put("alipay_debitId","GDB-DEBIT");
map14.put("alipay_creditId","GDB");

//平安银行
var map15 = new Map();
map15.put("isCredit", true);
map15.put("debitId", "307");
map15.put("creditId", "3071");
map15.put("alipay_debitId","SPA-DEBIT");
map15.put("alipay_creditId","SPABANK");

//邮政银行
var map16 = new Map();
map16.put("isCredit", true);
map16.put("debitId", "3230");
map16.put("creditId", "3231");
map16.put("alipay_debitId","PSBC-DEBIT");
map16.put("alipay_creditId","POSTGC");

//江苏银行
var map17 = new Map();

//上海农商银行
var map18 = new Map();
map18.put("isCredit", false);
map18.put("debitId", "343");

//上海银行
var map19 = new Map();
map19.put("isCredit", true);
map19.put("debitId", "326");
map19.put("creditId", "3261");
map19.put("alipay_debitId","");
map19.put("alipay_creditId","SHBANK");

//华夏银行
var map20 = new Map();
map20.put("isCredit", true);
map20.put("debitId", "311");
map20.put("creditId", "3112");

//东亚银行
var map21 = new Map();

//鄂尔多斯银行
var map22 = new Map();

//南京银行
var map23 = new Map();
map23.put("isCredit", false);
map23.put("debitId", "316");

//宁波银行
var map24 = new Map();
map24.put("isCredit", true);
map24.put("debitId", "302");
map24.put("creditId", "303");
map19.put("alipay_debitId","");
map19.put("alipay_creditId","NBBANK");

//渤海银行
var map25 = new Map();

//晋中市商业银行
var map26 = new Map();

//广东农村信用社
var map27 = new Map();

//南昌银行
var map28 = new Map();

//桂林银行
var map29 = new Map();

//包商银行
var map30 = new Map();

//云南农村信用社
var map31 = new Map();

//广州银行
var map32 = new Map();

//广东南粤银行
var map33 = new Map();


function banksClick(bankId){
	var isCredit = false;
	var debitId = "";
	var creditId = "";
	
	if(bankId=='1'){
		isCredit=map1.get("isCredit");
		debitId=map1.get("debitId");
		if(isCredit){
			creditId=map1.get("creditId");
		}
	}else if(bankId=='2'){
		isCredit=map2.get("isCredit");
		debitId=map2.get("debitId");
		if(isCredit){
			creditId=map2.get("creditId");
		}
	}else if(bankId=='3'){
		isCredit=map3.get("isCredit");
		debitId=map3.get("debitId");
		if(isCredit){
			creditId=map3.get("creditId");
		}
	}else if(bankId=='4'){
		isCredit=map4.get("isCredit");
		debitId=map4.get("debitId");
		if(isCredit){
			creditId=map4.get("creditId");
		}
	}else if(bankId=='5'){
		isCredit=map5.get("isCredit");
		debitId=map5.get("debitId");
		if(isCredit){
			creditId=map5.get("creditId");
		}
	}else if(bankId=='6'){
		isCredit=map6.get("isCredit");
		debitId=map6.get("debitId");
		if(isCredit){
			creditId=map6.get("creditId");
		}
	}else if(bankId=='7'){
		isCredit=map7.get("isCredit");
		debitId=map7.get("debitId");
		if(isCredit){
			creditId=map7.get("creditId");
		}
	}else if(bankId=='8'){
		isCredit=map8.get("isCredit");
		debitId=map8.get("debitId");
		if(isCredit){
			creditId=map8.get("creditId");
		}
	}else if(bankId=='9'){
		isCredit=map9.get("isCredit");
		debitId=map9.get("debitId");
		if(isCredit){
			creditId=map9.get("creditId");
		}
	}else if(bankId=='10'){
		isCredit=map10.get("isCredit");
		debitId=map10.get("debitId");
		if(isCredit){
			creditId=map10.get("creditId");
		}
	}else if(bankId=='11'){
		isCredit=map11.get("isCredit");
		debitId=map11.get("debitId");
		if(isCredit){
			creditId=map11.get("creditId");
		}
	}else if(bankId=='12'){
		isCredit=map12.get("isCredit");
		debitId=map12.get("debitId");
		if(isCredit){
			creditId=map12.get("creditId");
		}
	}else if(bankId=='13'){
		isCredit=map13.get("isCredit");
		debitId=map13.get("debitId");
		if(isCredit){
			creditId=map13.get("creditId");
		}
	}else if(bankId=='14'){
		isCredit=map14.get("isCredit");
		debitId=map14.get("debitId");
		if(isCredit){
			creditId=map14.get("creditId");
		}
	}else if(bankId=='15'){
		isCredit=map15.get("isCredit");
		debitId=map15.get("debitId");
		if(isCredit){
			creditId=map15.get("creditId");
		}
	}else if(bankId=='16'){
		isCredit=map16.get("isCredit");
		debitId=map16.get("debitId");
		if(isCredit){
			creditId=map16.get("creditId");
		}
	}else if(bankId=='17'){
		isCredit=map17.get("isCredit");
		debitId=map17.get("debitId");
		if(isCredit){
			creditId=map17.get("creditId");
		}
	}else if(bankId=='18'){
		isCredit=map18.get("isCredit");
		debitId=map18.get("debitId");
		if(isCredit){
			creditId=map18.get("creditId");
		}
	}else if(bankId=='19'){
		isCredit=map19.get("isCredit");
		debitId=map19.get("debitId");
		if(isCredit){
			creditId=map19.get("creditId");
		}
	}else if(bankId=='20'){
		isCredit=map20.get("isCredit");
		debitId=map20.get("debitId");
		if(isCredit){
			creditId=map20.get("creditId");
		}
	}else if(bankId=='21'){
		isCredit=map21.get("isCredit");
		debitId=map21.get("debitId");
		if(isCredit){
			creditId=map21.get("creditId");
		}
	}else if(bankId=='22'){
		isCredit=map22.get("isCredit");
		debitId=map22.get("debitId");
		if(isCredit){
			creditId=map22.get("creditId");
		}
	}else if(bankId=='23'){
		isCredit=map23.get("isCredit");
		debitId=map23.get("debitId");
		if(isCredit){
			creditId=map23.get("creditId");
		}
	}else if(bankId=='24'){
		isCredit=map24.get("isCredit");
		debitId=map24.get("debitId");
		if(isCredit){
			creditId=map24.get("creditId");
		}
	}else if(bankId=='25'){
		isCredit=map25.get("isCredit");
		debitId=map25.get("debitId");
		if(isCredit){
			creditId=map25.get("creditId");
		}
	}else if(bankId=='26'){
		isCredit=map26.get("isCredit");
		debitId=map26.get("debitId");
		if(isCredit){
			creditId=map26.get("creditId");
		}
	}else if(bankId=='27'){
		isCredit=map27.get("isCredit");
		debitId=map27.get("debitId");
		if(isCredit){
			creditId=map27.get("creditId");
		}
	}else if(bankId=='28'){
		isCredit=map28.get("isCredit");
		debitId=map28.get("debitId");
		if(isCredit){
			creditId=map28.get("creditId");
		}
	}else if(bankId=='29'){
		isCredit=map29.get("isCredit");
		debitId=map29.get("debitId");
		if(isCredit){
			creditId=map21.get("creditId");
		}
	}else if(bankId=='30'){
		isCredit=map30.get("isCredit");
		debitId=map30.get("debitId");
		if(isCredit){
			creditId=map30.get("creditId");
		}
	}else if(bankId=='31'){
		isCredit=map31.get("isCredit");
		debitId=map31.get("debitId");
		if(isCredit){
			creditId=map31.get("creditId");
		}
	}else if(bankId=='32'){
		isCredit=map32.get("isCredit");
		debitId=map32.get("debitId");
		if(isCredit){
			creditId=map32.get("creditId");
		}
	}else if(bankId=='33'){
		isCredit=map33.get("isCredit");
		debitId=map33.get("debitId");
		if(isCredit){
			creditId=map33.get("creditId");
		}
	}else{
		
	}	
	$("#debitShowId").removeClass();
	$("#debitShowId").addClass("icon icon-checked-green");
	$("#creditShowId").removeClass();
	$("#creditShowId").addClass("icon icon-no-check-green");
	removeCreditHtml();
	if(isCredit){
		$("#debitId").val(debitId);
		$("#creditId").val(creditId);
		$("#submitBankId").val(debitId);
		showCreditHtml();
	}else{
		$("#debitId").val(debitId);
		$("#creditId").val("");
		$("#submitBankId").val(debitId);
	}
	
	$(".simple-check i").click(function() {
		var clickId = $(this).attr("id");
		
		$("#debitShowId").removeClass();
		$("#creditShowId").removeClass();
		if(clickId=='debitShowId'){
			$("#debitShowId").addClass("icon icon-checked-green");
			$("#creditShowId").addClass("icon icon-no-check-green");
			
			var debitId = $("#debitId").val();
			$("#submitBankId").val(debitId);
		}else{
			$("#creditShowId").addClass("icon icon-checked-green");
			$("#debitShowId").addClass("icon icon-no-check-green");
			var creditId = $("#creditId").val();
			$("#submitBankId").val(creditId);
		}

	})
}


function alipayBanksClick(bankId){
	var alipay_debitId = "";
	var alipay_creditId = "";
	
	if(bankId=='1'){
		alipay_debitId=map1.get("alipay_debitId");
		alipay_creditId=map1.get("alipay_creditId");
	}else if(bankId=='2'){
		alipay_debitId=map2.get("alipay_debitId");
		alipay_creditId=map2.get("alipay_creditId");
	}else if(bankId=='3'){
		alipay_debitId=map3.get("alipay_debitId");
		alipay_creditId=map3.get("alipay_creditId");
	}else if(bankId=='4'){
		alipay_debitId=map4.get("alipay_debitId");
		alipay_creditId=map4.get("alipay_creditId");
	}else if(bankId=='5'){
		alipay_debitId=map5.get("alipay_debitId");
		alipay_creditId=map5.get("alipay_creditId");
	}else if(bankId=='6'){
		alipay_debitId=map6.get("alipay_debitId");
		alipay_creditId=map6.get("alipay_creditId");
	}else if(bankId=='7'){
		alipay_debitId=map7.get("alipay_debitId");
		alipay_creditId=map7.get("alipay_creditId");
	}else if(bankId=='8'){
		alipay_debitId=map8.get("alipay_debitId");
		alipay_creditId=map8.get("alipay_creditId");
	}else if(bankId=='9'){
		alipay_debitId=map9.get("alipay_debitId");
		alipay_creditId=map9.get("alipay_creditId");
	}else if(bankId=='10'){
		alipay_debitId=map10.get("alipay_debitId");
		alipay_creditId=map10.get("alipay_creditId");
	}else if(bankId=='11'){
		alipay_debitId=map11.get("alipay_debitId");
		alipay_creditId=map11.get("alipay_creditId");
	}else if(bankId=='12'){
		alipay_debitId=map12.get("alipay_debitId");
		alipay_creditId=map12.get("alipay_creditId");
	}else if(bankId=='13'){
		alipay_debitId=map13.get("alipay_debitId");
		alipay_creditId=map13.get("alipay_creditId");
	}else if(bankId=='14'){
		alipay_debitId=map14.get("alipay_debitId");
		alipay_creditId=map14.get("alipay_creditId");
	}else if(bankId=='15'){
		alipay_debitId=map15.get("alipay_debitId");
		alipay_creditId=map15.get("alipay_creditId");
	}else if(bankId=='16'){
		alipay_debitId=map16.get("alipay_debitId");
		alipay_creditId=map16.get("alipay_creditId");
	}else if(bankId=='17'){
		alipay_debitId=map17.get("alipay_debitId");
		alipay_creditId=map17.get("alipay_creditId");
	}else if(bankId=='18'){
		alipay_debitId=map18.get("alipay_debitId");
		alipay_creditId=map18.get("alipay_creditId");
	}else if(bankId=='19'){
		alipay_debitId=map19.get("alipay_debitId");
		alipay_creditId=map19.get("alipay_creditId");
	}else if(bankId=='20'){
		alipay_debitId=map20.get("alipay_debitId");
		alipay_creditId=map20.get("alipay_creditId");
	}else if(bankId=='21'){
		alipay_debitId=map21.get("alipay_debitId");
		alipay_creditId=map21.get("alipay_creditId");
	}else if(bankId=='22'){
		alipay_debitId=map22.get("alipay_debitId");
		alipay_creditId=map22.get("alipay_creditId");
	}else if(bankId=='23'){
		alipay_debitId=map23.get("alipay_debitId");
		alipay_creditId=map23.get("alipay_creditId");
	}else if(bankId=='24'){
		alipay_debitId=map24.get("alipay_debitId");
		alipay_creditId=map24.get("alipay_creditId");
	}else if(bankId=='25'){
		alipay_debitId=map25.get("alipay_debitId");
		alipay_creditId=map25.get("alipay_creditId");
	}else if(bankId=='26'){
		alipay_debitId=map26.get("alipay_debitId");
		alipay_creditId=map26.get("alipay_creditId");
	}else if(bankId=='27'){
		alipay_debitId=map27.get("alipay_debitId");
		alipay_creditId=map27.get("alipay_creditId");
	}else if(bankId=='28'){
		alipay_debitId=map28.get("alipay_debitId");
		alipay_creditId=map28.get("alipay_creditId");
	}else if(bankId=='29'){
		alipay_debitId=map29.get("alipay_debitId");
		alipay_creditId=map29.get("alipay_creditId");
	}else if(bankId=='30'){
		alipay_debitId=map30.get("alipay_debitId");
		alipay_creditId=map30.get("alipay_creditId");
	}else if(bankId=='31'){
		alipay_debitId=map31.get("alipay_debitId");
		alipay_creditId=map31.get("alipay_creditId");
	}else if(bankId=='32'){
		alipay_debitId=map32.get("alipay_debitId");
		alipay_creditId=map32.get("alipay_creditId");
	}else if(bankId=='33'){
		alipay_debitId=map33.get("alipay_debitId");
		alipay_creditId=map33.get("alipay_creditId");
	}else{
		
	}	 
	
	$("#alipay_debitId").val(alipay_debitId);
	$("#alipay_creditId").val(alipay_creditId);
	
	$("#alipay_debitShowId").removeClass();
	$("#alipay_debitShowId").addClass("icon icon-checked-green");
	$("#alipay_creditShowId").removeClass();
	$("#alipay_creditShowId").addClass("icon icon-no-check-green");
	$("#alipay_simple-check").html("");
	var html = "";
	var num = 0;
	if(alipay_debitId!='' && alipay_debitId.length>0){
		num++;
		html += "<i id='alipay_debitShowId' class='icon icon-checked-green'></i>";
		html += "借记卡&nbsp;&nbsp;";
		$("#alipay_submitBankId").val(alipay_debitId);
	}
	if(alipay_creditId!='' && alipay_creditId.length>0){
		if(num!=0){
			html += "<i id='alipay_creditShowId' class='icon icon-no-check-green'></i>";
		}else{
			html += "<i id='alipay_creditShowId' class='icon icon-checked-green'></i>";
			$("#alipay_submitBankId").val(alipay_creditId);
		}
		html += "信用卡";
	}
	$("#alipay_simple-check").append(html);
	
	$("#alipay_simple-check i").click(function() {
		var clickId = $(this).attr("id");
		
		$("#alipay_debitShowId").removeClass();
		$("#alipay_creditShowId").removeClass();
		if(clickId=='alipay_debitShowId'){
			$("#alipay_debitShowId").addClass("icon icon-checked-green");
			$("#alipay_creditShowId").addClass("icon icon-no-check-green");
			
			var alipay_debitId = $("#alipay_debitId").val();
			$("#alipay_submitBankId").val(alipay_debitId);
		}else{
			$("#alipay_creditShowId").addClass("icon icon-checked-green");
			$("#alipay_debitShowId").addClass("icon icon-no-check-green");
			var alipay_creditId = $("#alipay_creditId").val();
			$("#alipay_submitBankId").val(alipay_creditId);
		}

	})
}

function showCreditHtml(){
	var html = "<i id='creditShowId' class='icon icon-no-check-green'></i>";
	html +=" 信用卡";
	$("#simple-check").append(html);
}

function removeCreditHtml(){
	$("#simple-check").html("");
	var html = "<i id='debitShowId' class='icon icon-checked-green'></i>";
	html +=" 储蓄卡";
	html +=" ";
	$("#simple-check").append(html);
}

