(function( $ ){

  $.fn.briteVerify = function(options) {
	  
	  this.bind('blur', function() {
		  
		  if($(this).val() != "")
		  {
			  $.ajax(
                  {
                      url: "/includes/ajax_briteverify.php",
                      data: {
                              email: $(this).val(),    //Pass the email value
                              key: options.briteVerify_key
                            },       
                      type: "POST",  // a jQuery ajax POST transmits in querystring format in utf-8
                      dataType: "text",   //return data in json format                                                                                                                                   
                      success: function( data )
                      {
                           if(jQuery.trim(data) == 'invalid')
                           {
                        	   if(typeof options.error_call == 'function')
                        		   options.error_call();
                        	   else
                        		   $("#email_comm_angry").show();
                           }else{
                        	   if(typeof options.success_call == 'function')
                        		   options.success_call();
                        	   else
	                        	   $("#email_comm_angry").hide();
                           }
                      }

                      
                  });
		  } //ajax call IF ends here
	  });
  };
})( jQuery );
