function GetAjaxObject(){
var _1=false;
if(window.XMLHttpRequest){
try{
_1=new XMLHttpRequest();
}
catch(e){
_1=false;
}
}else{
if(window.ActiveXObject){
try{
_1=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e){
_1=false;
}
}
}
return _1;
}
var tagbAjax=false;
function tagbPostTagEntry(_2){
var _3=_2.ss_name.value.replace(/^\s+|\s+$/,"");
var _4=_2.ss_content.value.replace(/^\s+|\s+$/,"");
if(!_3){
alert("Please put a name on your shout.");
return false;
}
if(!_4){
alert("Please put a message on your shout.");
return false;
}
if(_2.securitycode){
if(!_2.securitycode.value){
alert("Error: please enter the anti-spam word.");
return false;
}
}
tagbAjax=GetAjaxObject();
if(!tagbAjax){
return true;
}
tagbAjax.open("POST",_2.action,true);
tagbAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
tagbAjax.onreadystatechange=tagbOnComplete;
tagbAjax.send(tagbGetQueryString(_2));
return false;
}
function tagbGetQueryString(_5){
var _6="";
var _7=new Array("ss_name","ss_email","ss_url","ss_content","securitycode","matchthis","doshout","ct");
_6=Form.serialize(_5);
if(_6){
_6+="&";
}
_6+="ss_ajax=1";
return _6;
}
function tagbOnComplete(){
if(tagbAjax.readyState==4){
if(tagbAjax.status==200){
var _8=tagbAjax.responseText;
var _9;
try{
_9=eval("("+_8+")");
}
catch(e){
_9={"status":"1","content":_8,"extra":""};
}
if(_9.extra){
var _a=_9.extra;
var _b=_a.match(/img\s+src\s*=\s*"([^"]+)"/i);
var _c=(_b?_b[1]:false);
var _d=_a.match(/name\s*=\s*"matchthis"\s+value\s*=\s*"([^"]+)"/i);
var _e=(_d?_d[1]:false);
var _f=document.shoutbox.cas_securityimg;
var _10=document.shoutbox.matchthis;
var _11=document.shoutbox.securitycode;
if(_f){
_f.src=_c;
}
if(_10){
_10.value=_e;
}
if(_11){
_11.value="";
}
}
if(_9.status==0){
var _12=document.getElementById("ss_content");
if(_12){
_12.value="";
}
document.getElementById('shoutbox').innerHTML=_9.content;
}else{
alert(""+_9.content);
}
}else{
alert("Unable to post to the tagboard:\nHTTP error "+tagbAjax.status+" - "+tagbAjax.responseText);
}
}
}
function tagbURLEncode(s){
if(encodeURIComponent){
return encodeURIComponent(s);
}else{
return escape(s);
}
}
