define(function(require){
	var $ = require('jquery');
	var IFA = require('util');
	require('uriTemplate')($);
	require('validation')($);
	require('dialog')($);
	require("../../../styles/cim/jquery-ui-1.8.14.custom.css");
	require('../../../styles/cim/cim-grid.css');  
	require('../../../styles/cim/validation.css');  
	$(function(){
		$("#openMobileCode").bind("click",function(){editMobileCodeAuth(1);});
		$("#closeMobileCode").bind("click",function(){editMobileCodeAuth(0);});
		function editMobileCodeAuth(flag){
			var title=i18n['User.LoginMessage.Identify.Tips6'];
			if(flag=="1"){
				title=i18n['User.LoginMessage.Identify.Tips7'];
			}
				$.msg.confirm(title,function(result){
					if(result){
						$.ajax({
							type:"post",
							url:$("#updateMoileCodeAuth").val()+".json",
							data:{authCodeFlag:flag},
							success:function(response){
								if(response.status){
									if(flag=="0"){
										$("#openMobileCode").css('display','');
										$("#closeMobileCode").css('display','none');
										$.msg.alert(i18n['User.LoginMessage.Identify.Tips3']);
									}else if(flag=="1"){
										$("#openMobileCode").css('display','none');
										$("#closeMobileCode").css('display','');
										$.msg.alert(i18n['User.LoginMessage.Identify.Tips4']);
									}
							}
							}
						});
				   }
				});
			}
		
	});
		
		
		
});

