$(document).ready(function() {
	
	$(".close-message").click( function(e) {
		$(this).parent().fadeOut();
		return false;
	});
	
	$("li.contact").click(function() {
		$("#select-all").attr("checked",false);
		if($(this).attr("class")=="contact") {
			$(this).addClass("contact-selected");
			$(this).children("input:checkbox").attr("checked",true);
		} else {
			$(this).removeClass("contact-selected");
			$(this).children("input:checkbox").attr("checked",false);
		}
	});
	
	$("ul.email-icons li a").click(function() {
		$("ul.email-icons li").removeClass("active");
		$(this).parent().addClass("active");
		domain = $(this).attr('id');
		$("#provider_box").val(domain);
		$('.emailDomain').html(domain.substr(0, 1).toUpperCase() + domain.substr(1));
		$('#invite_email').val('@'+domain+'.com');
		
		return false;
	});
	
	$("#browse_img").change( function(e) {
		if($("#browse_img").val() != '') {
			$("#upload_profile").submit();
			showAlert("Loading...");
		} else {
			displayAlert('Please enter an image to ulpoad',e.pageY);
		}
	});
	
});
