$(document).ready(function(){
     
     $.fn.active_menu=function(info){
         $("#"+info).addClass('active');
         $("#"+info +" a").addClass('active');
     }
    
    /*Exist user check*/
    
    $("#useremail").bind("keyup",function(){               
            var statussearch=null; 
            if( statussearch != null){
                statussearch.abort();
            }
            $(".useremail_exist").hide();
            statussearch=$.ajax({
                type:"POST",
                data:"email="+$(this).val()+"&id="+$("#rid").val()+"&_token="+$('meta[name="csrf-token"]').attr('content'),
                url:"/ajax/checkUserExists",
                success:function(info){
                    if(info > 0){
                        $(".useremail_exist").show();
                    }else{
                        $(".useremail_exist").hide();
                    }
                }
            });
        });  
    
});