function isEmail(string) {
if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1)
return 1;
else
return 0;
}

function aggiungiRivenditore(email,newsletter){
if(email!=""){
	
if(isEmail(email)){
   $.ajax({
      url: 'aggiungiRivenditore.php?mailReseller='+email+'&newsletterReseller='+newsletter,
      success: function(data) {
	   	$.notify({

			title: "Reseller",

			message: data,

			timeout: 5000

		});


      }
   });
}else{
	$.notify({

		title: "Reseller",

		message: "Please insert correct email address",

		timeout: 5000

	});		
}
}else{
		$.notify({

			title: "Reseller",

			message: "Please insert your email address",

			timeout: 5000

		});	
}
}
