// The cookie name to use for storing the blog-side comment session cookie.
var mtCookieName = "mt_blog9_user";
var mtCookieDomain = ".liquiddive.com";
var mtCookiePath = "/reviews/";
var mtCookieTimeout = 14400;
function mtHide(id) {
var el = (typeof id == "string") ? document.getElementById(id) : id;
if (el) el.style.display = 'none';
}
function mtShow(id) {
var el = (typeof id == "string") ? document.getElementById(id) : id;
if (el) el.style.display = 'block';
}
function mtAttachEvent(eventName,func) {
var onEventName = 'on' + eventName;
var old = window[onEventName];
if( typeof old != 'function' )
window[onEventName] = func;
else {
window[onEventName] = function( evt ) {
old( evt );
return func( evt );
};
}
}
function mtFireEvent(eventName,param) {
var fn = window['on' + eventName];
if (typeof fn == 'function') return fn(param);
return;
}
function mtRelativeDate(ts, fds) {
var now = new Date();
var ref = ts;
var delta = Math.floor((now.getTime() - ref.getTime()) / 1000);
var str;
if (delta < 60) {
str = '直前';
} else if (delta <= 86400) {
// less than 1 day
var hours = Math.floor(delta / 3600);
var min = Math.floor((delta % 3600) / 60);
if (hours == 1)
str = '1 時間前';
else if (hours > 1)
str = '2 時間前'.replace(/2/, hours);
else if (min == 1)
str = '1 分前';
else
str = '2 分前'.replace(/2/, min);
} else if (delta <= 604800) {
// less than 1 week
var days = Math.floor(delta / 86400);
var hours = Math.floor((delta % 86400) / 3600);
if (days == 1)
str = '1 日前';
else if (days > 1)
str = '2 日前'.replace(/2/, days);
else if (hours == 1)
str = '1 時間前';
else
str = '2 時間前'.replace(/2/, hours);
}
return str ? str : fds;
}
function mtEditLink(entry_id, author_id) {
var u = mtGetUser();
if (! u) return;
if (! entry_id) return;
if (! author_id) return;
if (u.id != author_id) return;
var link = '編集';
document.write(link);
}
function mtCommentFormOnFocus() {
// if CAPTCHA is enabled, this causes the captcha image to be
// displayed if it hasn't been already.
mtShowCaptcha();
}
var mtCaptchaVisible = false;
function mtShowCaptcha() {
var u = mtGetUser();
if ( u && u.is_authenticated ) return;
if (mtCaptchaVisible) return;
var div = document.getElementById('comments-open-captcha');
if (div) {
div.innerHTML = '
Fatal error: Uncaught exception 'MTException' with message 'Undefined captcha provider. (none)' in /virtual/frostbite/public_html/mt5/php/lib/captcha_lib.php:59
Stack trace:
#0 /virtual/frostbite/public_html/mt5/php/lib/function.mtcaptchafields.php(18): CaptchaFactory::get_provider('none')
#1 /virtual/frostbite/public_html/reviews/templates_c/%%3E^3E4^3E4B8048%%mt%3A1191.php(120): smarty_function_mtcaptchafields(Array, Object(MTViewer))
#2 /virtual/frostbite/public_html/mt5/php/extlib/smarty/libs/Smarty.class.php(1265): include('/virtual/frostb...')
#3 /virtual/frostbite/public_html/mt5/php/mt.php(593): Smarty->fetch('mt:1191', '9;/reviews/mt.j...')
#4 /virtual/frostbite/public_html/reviews/mtview.php(5): MT->view()
#5 {main}
thrown in /virtual/frostbite/public_html/mt5/php/lib/captcha_lib.php on line 59