function show_form_customer_notify(prod_id) {
	//$('#div_message').css("z-index","0");
	$('#div_message').hide();
	$('#form_notify_customer').show();
	$('#div_form').show();
}

/* events */
$(function(){
	
	$('#submit_email_to_notify').click(function() {
		if ($('#email_to_notify').val() != '') {
			var str = "email_to_notify=" + $('#email_to_notify').val() + "&product_id=" + $('#email_product_id').val();
			$.ajax({
			    type: "GET",
			    url: "http://"+window.location.hostname+"/add_email_stock_notification.php",
			    data: str,
			    success: function(response){
			    	if (response == '0') {
			    		//$('#div_message').css("z-index","2");
			    		$('#div_form').hide();
			    		$('#div_message').show();
			    		var txt = "We are not able to insert your email,<br>" +
			    				"please try again and make sure you are registered.<br>" +
			    				"<span onclick=\"javascript:$('#form_notify_customer').hide();\" style=\"cursor:pointer;\">[Close]</span>";
			    		$('#email_to_notify').val('');
			    		$('#div_message').html(txt);
			    	} else if (response == '1') {
			    		//$('#div_message').css("z-index","2");
			    		$('#div_form').hide();
			    		$('#div_message').show();
			    		var txt = "You entry is successfully saved in our Database.<br>" +
			    				"<span onclick=\"javascript:$('#form_notify_customer').hide();\" style=\"cursor:pointer;\">[Close]</span>";
			    		$('#email_to_notify').val('');
			    		$('#div_message').html(txt);
			    	} else if (response == '2') {
			    		//$('#div_message').css("z-index","2");
			    		$('#div_form').hide();
			    		$('#div_message').show();
			    		var txt = "We can't find your email on our database.<br>Please make sure your are registered.<br>" +
			    				"<span onclick=\"javascript:$('#form_notify_customer').hide();\" style=\"cursor:pointer;\">[Close]</span>";
			    		$('#email_to_notify').val('');
			    		$('#div_message').html(txt);
			    	}
			    },
			    error: function(msg){        /* should not happen... */
			        alert("SERVER ERROR!!! " + msg);
			    }
			});
		} else {
			alert('Please, type your email address.');
		}
	});
	
	
});