dn_url = "http://www.dnlodge.com";
dn_forums = "http://www.dnlodge.com/forums";
dn_session = "";
is_down = "";
var $j = jQuery.noConflict();
function rp(element, text, append)
{
if(append == "true") {
document.getElementById(element).innerHTML += text;
}
else {
document.getElementById(element).innerHTML = text;
}
}
function is_blank(element) {
if(document.getElementById(element).value == "") {
return true;
} else {
return false;
}
}
function append_error(text) {
errors += "
"+text+"";
}
function g(element) {
return document.getElementById(element).value;
}
function save() {
if(is_blank("thecomment")) {
if(is_down == "") {
Effect.toggle('error', 'blind', {duration: .3});
is_down = "true";
}
} else {
document.getElementById('submitbutton').disabled='true';
$j.post(dn_url+"/ajax/"+dn_session+"/save_comment",
{ comment: g('thecomment'), name: g('name'), content_id: '256 ' },
function(result){
//alert(result);
data = result.split("|");
if(data[0] == "OK") {
if(data[1] == "LIVE") {
rp('newcomment', g('thecomment'));
rp('newcommenttitle', data[2]+" says:");
Effect.BlindDown('newcommentcontainer', {duration: .6});
rp('commentcounter', parseInt(document.getElementById('commentcounter').innerHTML) + 1);3
} else {
Effect.BlindDown('pending', {duration: .5});
}
Effect.BlindUp('post', {duration: .8});
Effect.BlindUp('yousay', {duration: .5});
} else {
if(is_down == "") {
Effect.toggle('error', 'blind', {duration: .3});
is_down = "true";
}
}
}
);
//Effect.BlindUp("post", {duration: 1.2});
//setTimeout("Effect.BlindDown('message-container')", 1);
}
}