function emailbox_subscribe() {
	jQuery.ajax({
		url: "/privat/emailbox_subscribe",
		data: {email: jQuery("#email")[0].value, phone: jQuery("#phone")[0].value, name: jQuery("#name")[0].value},
		error: function(xhr, textStatus, errorThrown) {
			var eberr = jQuery("#eberror")
			eberr.html("<strong>"+xhr.responseText+"</strong>").fadeOut(0, function() {eberr.fadeIn("slow")})
		},
		success: function(data, textStatus) {
			jQuery("#emailbox-inner").text(data)
			setTimeout(function() {
				jQuery("#emailbox").fadeOut(2000)
			}, 5000)
		}
	})
}

jQuery(document).ready(function() {
	jQuery(".ebinfo").focus(function() {
		jQuery(this).css("color", "black")
		if(this.id == "email" && this.value == "Epost") {
			this.value = ""
		}
		if(this.id == "phone" && this.value == "Mobil") {
			this.value = ""
		}
		if(this.id == "name" && this.value == "Namn") {
			this.value = ""
		}
	})
	jQuery(".ebinfo").blur(function() {
		if(this.id == "email" && this.value == "") {
			jQuery(this).css("color", "#797979")
			this.value = "Epost"
		}
		if(this.id == "phone" && this.value == "") {
			jQuery(this).css("color", "#797979")
			this.value = "Mobil"
		}
		if(this.id == "name" && this.value == "") {
			jQuery(this).css("color", "#797979")
			this.value = "Namn"
		}
	})
})