$(document).ready(function() {
 popup();
 
  var email = $("#email").val();

function popup() {
$("#logindiv").css("display", "block");
}
function closepopup() {
	$("#loginbtn").click(function() {
  $(this).parent().parent().hide();
 window.location.href='addnewcontact.php';
	});
}
$("#login #cancel").click(function() {
$(this).parent().parent().hide();
  window.location.href='addnewcontact.php';
});

function validateEmail(email) {
var filter = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if (filter.test(email)) {
return true;
}else {
return false;
}
}

// Login form popup login-button click event.
$("#loginbtn").click(function() {
var fname = $("#fname").val();
var sname = $("#lname").val();
var contact = $("#cont").val();

var group = $("#group").val();

if (fname == "" || sname == "" || contact == "" || email == "" || group == ""){
 alert("Please Fill All Fields");
}else{
   
}
});
});