好库网
function gopay(){	
	if($("#txtMoneyAmount").val()!=""){
		$.openPopupLayer({
			name: "paypop",
			width: 400,
			target: "paypop",
			model:true
		});
		return true;
	}else{
		alert("请输入充值金额");
		$("#txtMoneyAmount").focus();
		return false;
	}
}

function gorecharge(){	
	if($("#txtMoneyAmount").val()==""){
		alert("请输入充值金额");
		$("#txtMoneyAmount").focus();
		return false;
	}
	var txt = $("#txtMoneyAmount").val();
	try{
		var money = parseFloat(txt);
		if(money >0){
			return true;
		}else{
			alert("请输入正确的数字");
			$("#txtMoneyAmount").focus();
			return false;
		}
	}catch(e){
		alert("请输入正确的数字");
		$("#txtMoneyAmount").focus();
		return false;
	}
}

$(function(){
	$("#txtMoneyAmount").keyup(function(key){
		window.setTimeout(function(){
			if(!((key.keyCode>48&&key.keyCode<=57)||
				(key.keyCode>=96&&key.keyCode<=105)||
				key.keyCode==8)){
				var value = $(this).val().toUpperCase();
				var input = String.fromCharCode(key.keyCode);
				if(key.keyCode!=48)
					value = value.replace(input,"");
				//var money = parseInt(value);
				if(isNaN(value) || value==0){
					$(this).val(1);
				}else{
					$(this).val(value);
				}
			}
		},300);
	}).blur(function(){
		var count = parseInt($(this).val());
	});	
	
	$("#otherbank").change(function() {
		if (this.value != '') {
			$("input[type=radio]").attr("checked", false);
			$("#bankCode").val(this.value);
			$("#channelId").val(30);
		}
	});
	
	$("input[name='paytype']").each(function(i,n){
		$(n).next().click(function(){
			var bank = $(n).val();
			$("#bankCode").val(bank);
			if($("#otherbank").size()>0){
				$("#otherbank")[0].options[0].selected = true;
			}
			if(bank=="ALIPAY"){
				$("#channelId").val(33);
				$("form").attr({"action":"../../../链接已屏蔽;});	
			}else if(bank=="CAIFUTONG"){
				$("#channelId").val(34);
				$("#banktype").val(0);
				$("form").attr({"action":"../../../链接已屏蔽;});	
			}else if(bank=="CAIFUTONG_CCB"){
				$("#channelId").val(34);
				$("#banktype").val(1003);
				$("form").attr({"action":"../../../链接已屏蔽;});	
			}else{
				$("#channelId").val(30);
				$("form").attr({"action":"../../../链接已屏蔽;});
			}
		});
		$(n).click(function(){
			var bank = $(n).val();
			$("#bankCode").val(bank);
			if($("#otherbank").size()>0){
				$("#otherbank")[0].options[0].selected = true;
			}
			if(bank=="ALIPAY"){
				$("#channelId").val(33);
				$("form").attr({"action":"../../../链接已屏蔽;});
			}else if(bank=="CAIFUTONG"){
				$("#channelId").val(34);
				$("#banktype").val(0);
				$("form").attr({"action":"../../../链接已屏蔽;});	
			}else if(bank=="CAIFUTONG_CCB"){
				$("#channelId").val(34);
				$("#banktype").val(1003);
				$("form").attr({"action":"../../../链接已屏蔽;});	
			}else{
				$("#channelId").val(30);
				$("form").attr({"action":"../../../链接已屏蔽;});
			}
		});
	});
})