try {document.domain = "eved.com"; } catch (er) { }

function doLogin(){
	
	$("#e-log-err").html('');
		
	$.ajax({
		type: "POST",
		url: "/protected/ajax/login.php",
		data:{
			'e-uname': $("#e-uname").val(),
			'e-pass': $("#e-pass").val()
		},
		success: function(res){			
			var j = jQuery.JSON.decode(res);
			if(j.success){
				window.location = j.url;
			}else{
				$("#e-log-err").html(j.errMsg);
			}
		}
	});

}


showForgot = function (){
    document.getElementById('e-email-ct').style.display = '';
}

function getForgot(){
		
	$.ajax({
		type: "POST",
		url: "/protected/ajax/forgotPass.php",
		data:{
			'e-email': $("#e-email").val()
		},
		success: function(res){			
			var j = jQuery.JSON.decode(res);
			$("#e-email-ct .info").hide();
			if(j.success){
				$("#forgot-log-msg").html(j.msg);
				$("#e-email-ct *").hide();
				$("#e-email-ct #forgot-log-msg").show();
				$("#e-email-ct .close").show();
			}else{
				$("#forgot-log-msg").html(j.errMsg);
			}
		}
	});

}


searchValidation = function (){
	var val = $("#searchbox_text").val();
	
	if(jQuery.trim(val) == "" || val == "Enter a City, State or Zip Code" ) {
		document.getElementById("directory-search-link").click();
		return false;
	}
    document.getElementById('search').submit();
}


/**
 * Let us to inspect an object in firefox console
 * @param {object} obj The object what you want to inspect
 */
log = function (obj){
    try { if (console) console.log(obj); } catch (er) { }
}



