function commentsEmailNotifications(cn_sendtoemail,cn_fromname,cn_fromemail,cn_subject,cn_title,cn_path) {

FB.Event.subscribe('comments.add', function(response) {

// Email message subject text
if(cn_subject == 'false') {
cn_subject = 'A new comment posted on your site.';}

// Email message title text
if(cn_title == 'false') {
cn_title = 'A new comment posted on your site.';}

// Comment Date and Time
var commentdate = new Date();
var curr_date = commentdate.getDate();
var curr_month = commentdate.getMonth();
curr_month++;
var curr_year = commentdate.getFullYear();
var a_p = "";
var curr_hour = commentdate.getHours();
if (curr_hour < 12){a_p = "AM";}else{a_p = "PM";}if (curr_hour == 0){curr_hour = 12;}if (curr_hour > 12){curr_hour = curr_hour - 12;}
var curr_min = commentdate.getMinutes();
commentdate = curr_date + "." + curr_month + "." + curr_year + " at " + curr_hour + ":" + curr_min + " " + a_p;

// Comment Page Title
pagetitle = $('[notify="true"]').attr('title');

// Comment Page URL
pageurl = $('[notify="true"]').attr('url');

email_message =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
'<html xmlns="http://www.w3.org/1999/xhtml">'+
'<head>'+
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'+
'</head>'+
'<body>'+
'<div style="font-size:11px; font-family:\'lucida grande\',tahoma,verdana,arial,sans-serif;">'+
''+ cn_title +
'<br /><br /></div>'+
'<div style="color:#333333; direction:ltr; font-family:\'lucida grande\',tahoma,verdana,arial,sans-serif; font-size:11px; text-align:left; border-bottom:1px solid #D8DFEA; margin:10px 10px 5px 0; padding-bottom:5px;">'+
'<div><img src="http://static.ak.fbcdn.net/rsrc.php/z5HB7/hash/ecyu2wwn.gif" style="display:block; float:left; border:none;"></div>'+
'<div style="margin-left:50px; padding-left:10px;">'+
'<span style="color:#808080; font-size:9px; padding-top:2px;">'+ commentdate +'</span>'+
'<div style="padding:3px 0;">Posted on page:'+
'<br /><span style="font-weight:bold;">'+pagetitle+'</span></div>'+
'<div style="padding:3px 0; font-size:9px;">'+
'<a href="'+pageurl+'" target="_blank" style="color:#3B5998; cursor:pointer; text-decoration:underline;">Click here to view it in the page!</a>'+
'</div>'+
'</div>'+
'</div>'+
'</body>'+
'</html>';

$(document).ready(function(){
$.post(cn_path,{ to: cn_sendtoemail, fromname: cn_fromname, fromemail: cn_fromemail, subject: cn_subject, message: email_message }, "html");
});

});

}

// Facebook Comments-Box email notifications code by Gil Goldshlager
// http://facebook.com/gil.goldshlager
