var Validation = function() {
		// private methods		
	function addSubmitEvent() {
		$("#popup-form").submit(function() {

			var text = $("#firstName").attr('value');
			
			if(text == null || text ==  "") {
				alert("Please provide your First Name");
				return false;
			}

			var text = $("#lastName").attr('value');
			
			if(text == null || text ==  "") {
				alert("Please provide your Last Name");
				return false;   
				
			}
			var text = $("#phone").attr('value');
			
			if(text == null || text ==  "") {
				alert("Please provide your Phone Number");
				return false;
			}

			var text = $("#email").attr('value');
			
			if(text == null || text ==  "") {
				alert("Please provide your Email Address");
				return false;
			}
						
			var count = $(this).find("input[@type=checkbox][name=ES]:checked").size();
			
			if(count == 0) {
				alert("Please select from Experience and Skills");
				return false;
			}
				
			var esValid = true;
			$(this).find("input[@type=checkbox][name=ES]:checked").each(function(selection) {
				
				var item = $(this).attr('value'); 
				
				if(item == 'Trading' ||
						item == 'Broking' ||
						item == 'Origination' ||
						item == 'Marketing' ||
						item == 'Sales-senior' ||
						item == 'Sales-fieldbas') {
						
					count = $("#popup-form").find("input[@type=checkbox][name=pro]:checked").size();
										
				   	if(count == 0) {
						esValid = false;
					}
				}

			});
			if(!esValid)  {
				alert("Please select from Products");
				return false;				
			}                                                                       

			count = $(this).find("input[@type=checkbox][name=location]:checked").size();
			
			if(count == 0) {
				alert("Please select from Locations");
				return false;				
			}
			
			return true;			
		});
	}
		
	return {
		// public methods		
		init: function() {
			addSubmitEvent();
		}
	}
}();

$(function() {
	Validation.init();
});
