$(document).ready(function(){

	$('#submitcomment').click( function() {
		if ($('#textcomment').val().length > 0){
			$('#textcomment').removeClass("errorText");

			usr = $('input[name=email]').val();
			pass = $('input[name=passwd]').val();
			url = window.location;

			pat = /projects/;
            isProject = 0

			if (pat.test(url))
				isProject = 1
			
           
			 var response = $.ajax({
			  type: "POST",
			  url: siteUrlAdmin + "myaccount/checkuser/"+ isProject,
			  data: "email="+usr+"&password="+pass,
			  async: false
			 }).responseText;

			

			 if (response != "true") {
				 $('#errorLogin').show();
				return false;
			 }
			
		} else {
			$('#textcomment').addClass("errorText");
			return false;
		}
	});

	$('#textcomment').click( function() {
		$('#textcomment').removeClass("errorText");
	});
});
