$(document).ready(function(){
	var btnOk=$("#ImageButton1");
	var showMsg=$("#showMsg");
	var tbEmail=$("#tbEmail");
	
	///////////////////////////////////////
	tbEmail.keyup(function(){
		var tbEmailVal=tbEmail.val();
		if(tbEmailVal!="")
		{
			tbEmail.removeClass();
			tbEmail.addClass("tskInputBox");	
		}
	});							
	
	tbEmail.blur(function(){
		var tbEmailVal=tbEmail.val();
		tbEmail.data("value",tbEmailVal);
		if(tbEmailVal!="")
		{
			if(tbEmailVal.length>4)
			{
				tbEmail.removeClass();
				tbEmail.addClass("tskInputBox");	
			btnOk.attr("disabled","");			
			}
			else
			{	
				tbEmail.addClass("tskInputError");
				tbEmail.val("支付宝帐号填写有误！");		
				btnOk.attr("disabled","disabled");	
			}
		}
		else
		{
			tbEmail.addClass("tskInputError");
			tbEmail.val("支付宝帐号不能为空！");
			btnOk.attr("disabled","disabled");
		}		
	});
	tbEmail.focus(function(){
		tbEmail.val(tbEmail.data("value"));
	});
	
	//////++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	btnOk.click(function(){		
		var tbEmailVal=tbEmail.val();
		if(tbEmailVal!="")
		{
			if(tbEmailVal.length<4)
			{				
				tbEmail.addClass("tskInputError");
				tbEmail.val("支付宝帐号填写有误！");	
				return false;						
			}
		}
		else
		{
			tbEmail.addClass("tskInputError");
			tbEmail.val("支付宝帐号不能为空！");
			return false;				
		}
	});
});