/*
	GUESTBOOK.XML 2.0 [SCRIPT ENGINE FOR THE PUBLIC PAGE]
	http://acidmartin.wemakesites.net/#guestbook
*/

// it is illegal to modify the code below this line

var guestbookxml = {};
var globaltimeout = 4000;
var GuestbookPurchaseLink = 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5129392';
var isIE6 = /msie|MSIE 6/.test(navigator.userAgent) && !/msie|MSIE 8/.test(navigator.userAgent);

function renderguestbookxml(){if(document.compatMode == 'BackCompat'){$get('GuestBookXml').innerHTML = '<p>Your webpage seems to be in non-standards compliance mode. Guestbook.XML cannot be run on non-standards compliant pages. Please, check your doctype definition.</p><p>If you are not sure what to do, visit the following <a href="http://en.wikipedia.org/wiki/Document_Type_Declaration" target="_blank" title="Document Type Declaration">webpage</a> that explains what doctype is and how to use it.</p>';return false;}if(isIE6){$get('GuestBookXml').innerHTML = '<p style="color: red;"><strong>You seem to be using Internet Explorer 6 which is not supported by Guestbook.XML.</strong></p>';return false;}var guestbookxmlsettings = 'Guestbook.XML/Guestbook.XML.Settings.xml?nocache=' + createguid();var guestbookxmldoc;synchronizefoldersrequest('Guestbook.XML/Guestbook.XML/ServerPages/approvedfiles.php', 'entries-list');eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2(d){1=5 e();1.f("g",6,h);1.i(7);1.j=k(){2(1.l==4){3 a=1.m.8(\'9\')[0];b(a)}}}n{2(o){3 1=5 p("q.r")}2(s){3 1=t.u.v("","",7)}1.w=x;1.y(6);3 c=1.8(\'9\')[0];b(c)}',35,35,'|guestbookxmldoc|if|var||new|guestbookxmlsettings|null|getElementsByTagName|guestbookxml||loadguestbookxml|guestbookxmlroot|isSafari|XMLHttpRequest|open|GET|true|send|onreadystatechange|function|readyState|responseXML|else|isIE|ActiveXObject|Microsoft|XMLDOM|isFireFoxOrOpera|document|implementation|createDocument|async|false|load'.split('|'),0,{}));}function loadguestbookxml(guestbookxmlroot){eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 7=$k(\'6-1f\');3 F=1g.1h(\'1i\');3 G=4.5(\'G\');3 H=4.5(\'H\');3 N=4.5(\'N\');3 l=4.5(\'l\');3 O=4.5(\'O\');3 12=4.5(\'12\');3 I=4.5(\'I\');3 s=$9(\'c\');s.a=\'I\';s.d=\'6\';7.b(s);s.8=I;3 P=4.5(\'P\');3 m=$9(\'c\');m.a=\'m\';m.d=\'6\';7.b(m);m.8=P;13(O==\'14\'){$k(\'15-1j\').1k.f.Q=\'R\'}3 l=4.5(\'l\');3 t=$9(\'c\');t.a=\'l\';t.d=\'6\';7.b(t);t.8=l;3 J=4.5(\'J\');3 u=$9(\'c\');u.a=\'J\';u.d=\'6\';7.b(u);u.8=J;3 K=4.5(\'K\');3 h=$9(\'c\');h.a=\'K\';h.d=\'6\';7.b(h);h.8=K;h.8=h.8.1l(/, /g,\'|\');3 S=4.5(\'S\');3 v=$9(\'c\');v.a=\'1m\';v.d=\'6\';7.b(v);v.8=S;3 L=4.5(\'L\');3 i=$9(\'c\');i.a=\'i\';i.d=\'6\';7.b(i);i.8=L;3 T=4.5(\'T\');3 w=$9(\'c\');w.a=\'e-1n-16\';w.d=\'6\';7.b(w);w.8=T;3 U=4.5(\'U\');3 x=$9(\'c\');x.a=\'e-1o-16\';x.d=\'6\';7.b(x);x.8=U;3 j=1p 1q();3 17=j.1r()+\'n\'+j.1s()+\'n\'+j.1t()+\'n\'+j.1u()+\'n\'+j.18()+\'n\'+j.18()+\'n\'+1v();3 y=$9(\'c\');y.a=\'e-1w\';y.d=\'6\';7.b(y);y.8=17+\'.1x\';3 V=4.5(\'V\');3 z=$9(\'c\');z.a=\'19-1a\';z.d=\'6\';7.b(z);z.8=V;3 W=4.5(\'W\');3 A=$9(\'c\');A.a=\'19-1y\';A.d=\'6\';7.b(A);A.8=W;3 X=4.5(\'X\');3 B=$9(\'c\');B.a=\'1z\';B.d=\'6\';7.b(B);B.8=X;3 M=4.5(\'M\');3 o=$9(\'c\');o.a=\'o\';o.d=\'6\';7.b(o);o.8=M;3 Y=4.5(\'Y\');3 p=$9(\'c\');p.a=\'p\';p.d=\'6\';7.b(p);p.8=Y;3 Z=4.5(\'Z\');3 q=$9(\'c\');q.a=\'q\';q.d=\'6\';7.b(q);q.8=Z;3 10=4.5(\'10\');3 r=$9(\'c\');r.a=\'r\';r.d=\'6\';7.b(r);r.8=10;3 e=$9(\'1A\');e.a=\'e\';e.f.Q=\'R\';e.1a=\'e\';7.b(e);3 C=$9(\'c\');C.a=\'1B-1C\';C.d=\'1D\';C.f.Q=\'R\';7.b(C);$k(\'15-1E\').1b(\'1F\',N);13(M==\'14\'){F[0].f.11=\'6\';F[1].f.11=\'6\';F[2].f.11=\'6\'}$k(\'i\').8=L;$k(\'1c\').f.G=G+\'1G\';$1d(\'D.E/D.E/1H/D.E.1I.1e\',\'1J\');$k(\'1c\').1b(\'1K\',H);$1d(\'D.E/D.E/1L/\'+H+\'/1M.1e\',\'1N\');',62,112,'|||var|guestbookxmlroot|getAttribute|hidden|hiddeninputs|value|create|id|appendChild|INPUT|type|entry|style||profanityinput|markupfilterinput|date|get|profanityfilter|messagesenttextinput|_|validateinput|defaultcommentinput|defaultnameinput|defaultemailinput|privatecommentsinput|profanityfilterinput|profanityreplacementinput|commentsboxpositioninput|thankyouemailtextinput|notificationemailtextinput|entryfilename|adminnameinput|adminemailinput|moderateinput|clickfixgb|Guestbook|XML|validators|width|skin|privatecomments|profanityreplacement|profanitywords|markupfilter|validate|messagemaxlength|urlbox|messagesenttext|display|none|commentsboxposition|thankyouemailtext|notificationemailtext|adminname|adminemail|moderate|defaultcomment|defaultname|defaultemail|visibility|commentsareprivatetext|if|false|form|email|entryfilenamedata|getMinutes|admin|name|setAttribute|GuestBookXml|stylesheet|css|inputs|document|getElementsByClassName|required|url|parentNode|replace|entriesposition|thankyou|notification|new|Date|getYear|getMonth|getDay|getHours|createguid|filename|html|mail|moderation|TEXTAREA|loading|fix|button|comment|maxlength|px|Scripts|Public|GuestBookXmlBaseStylesheet|rel|Skins|Styles|GuestBookXmlSkin'.split('|'),0,{}));eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('P.Q(5(e){m(R==\'f\'){$3(\'n-h\').d.B=\'C\';$3(\'n-h\').D=S}m(T==\'f\'){i a=g-$3(\'j-4\').o(\'E\')[0].p-$3(\'j-4\').o(\'U\')[0].p-F}V{$3(\'W\').X+=\' Y-Z\';i a=g-$3(\'j-4\').o(\'E\')[0].p-F}$3(\'4-8\').d.g=a+\'k\';$3(\'4-9\').d.g=a+\'k\';$3(\'4-7\').d.g=a+\'k\';$3(\'4-G\').d.g=a+\'k\';$3(\'j-n-10\').d.11=\'12\';$3(\'4-8\').q=13;$3(\'4-9\').q=14;$3(\'4-7\').q=15;$6($3(\'4-H\'),\'16\',5(e){17()});$6($3(\'4-8\'),\'r\',5(e){s($3(\'4-8\'),$3(\'I\'))});$6($3(\'4-9\'),\'r\',5(e){s($3(\'4-9\'),$3(\'J\'))});$6($3(\'4-7\'),\'r\',5(e){s($3(\'4-7\'),$3(\'K\'))});$6($3(\'4-8\'),\'t\',5(e){u($3(\'4-8\'),$3(\'I\'))});$6($3(\'4-9\'),\'t\',5(e){u($3(\'4-9\'),$3(\'J\'))});$6($3(\'4-7\'),\'t\',5(e){u($3(\'4-7\'),$3(\'K\'))});$6($3(\'4-8\'),\'v\',5(e){w(x.y(\'z\')[0],\'A\')});$6($3(\'4-9\'),\'v\',5(e){w(x.y(\'z\')[1],\'A\')});$6($3(\'4-7\'),\'v\',5(e){w(x.y(\'z\')[2],\'A\')});$6($3(\'4-7\'),\'18\',5(e){19($3(\'4-7\'))});1a();1b();1c();1d.1e(\'1f.L/1g.L/1h/1i.1j\');i b=M.N(\'1k\');i c=M.N(\'1l\');m(b==\'1m\'){$3(\'O-h\').D=c;$3(\'O-h\').d.B=\'C\';$3(\'4-8\').l=f;$3(\'4-9\').l=f;$3(\'4-G\').l=f;$3(\'4-7\').l=f;1n(\'4-H\')}},1o);',62,87,'|||get|form|function|attachDomEvent|comment|name|email||||style||true|width|message|var|guestbookxml|px|disabled|if|entries|getElementsByTagName|offsetWidth|value|focus|clearvalue|blur|setdefaultvalue|keydown|removehighlight|document|getElementsByClassName|required|highlighted|display|block|innerHTML|LABEL|20|url|submit|defaultnameinput|defaultemailinput|defaultcommentinput|XML|guestbookxmlroot|getAttribute|guestbook|window|setTimeout|privatecomments|commentsareprivatetext|validate|SPAN|else|GuestBookXml|className|no|validation|list|visibility|visible|defaultname|defaultemail|defaultcomment|click|submitentry|keyup|ismaxlength|loadingpanel|initInputJs|replaceButtons|checkboxxml|demand|Guestbook|CheckBox|CheckBoxLists|SendCopy|xml|commentsenabled|commentsclosedtext|false|disableReplacedButton|globaltimeout'.split('|'),0,{}));window.setTimeout(function(e){eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$l(\'m-n\').o();p q=\'<3 4="r: s t u !1; v: w !1; x: y !1; z: A !1; B: C !1; 5-D: E !1; F: G !1; 6-H: I !1; J: K !1; 7: 8 !1; 6-L: M  !1; 5-N: 0 !1;">O P a Q R 9 b c.d. S e T U V f W X Y 2 g Z b 2 10, e 11 12 2 g 9 h i j k 13 <a 14="\'+15+\'" 16="17" 4="7: 8;" 18="19 c.d j k h i">f 1a.</a></3>\';',62,73,'|important|the|div|style|text|font|color|white|version||of|Guestbook|XML|you|this|full|via|PayPal|for|USD50|get|loading|fix|click|var|tr|border|solid|1px|black|display|block|visibility|visible|position|static|background|red|align|center|padding|8px|size|11px|margin|4px|weight|normal|indent|This|is|limited|trial|If|wish|to|remove|message|and|use|functionality|component|may|purchase|from|href|GuestbookPurchaseLink|target|_blank|title|Purchase|link'.split('|'),0,{}));var _s = false;eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0(!1){$2($3(\'4\'),\'5\',6)}',7,7,'if|_s|insertFirstChild|get|GuestBookXml|DIV|tr'.split('|'),0,{}));}, 5000);}

function removehighlight(validator)
{
	$removeClassName(validator, 'highlighted');
}

function clearvalue(toelement, fromelement)
{
	if(toelement.value == fromelement.value)
	{
		toelement.value = '';
	}
}

function setdefaultvalue(toelement, fromelement)
{
	if(toelement.value == '')
	{
		toelement.value = fromelement.value;
	}
}

function submitentry()
{
	var entry = $get('entry');
	var filename = $get('entry-filename');
	var formname = $get('form-name');
	var formurl = $get('form-url');
	var formcomment = $get('form-comment');
	var formemail = $get('form-email');
	var defaultnameinput = $get('defaultnameinput');
	var defaultemailinput = $get('defaultemailinput');
	var defaultcommentinput = $get('defaultcommentinput');
	var emailsplit = formemail.value.split('@');
	var emailsplitdot = formemail.value.split('.');
	var validators = document.getElementsByClassName('required');
	var validateinput = $get('validateinput');
	
	var profanityfilter = $get('profanityfilter');
	var profanityreplacement = $get('profanityreplacement');
	var profanitywords = $get('profanitywords');
	
	if(profanityfilter.value == 'true')
	{
		var commentbox = $get('form-comment');
		var badwords = '/' + profanitywords.value + '/g';
		commentbox.value = commentbox.value.replace(eval(badwords), profanityreplacement.value);
	}

	if(validateinput.value == 'true')
	{
		if(formname.value == defaultnameinput.value || formname.value == '')
		{
			$appendCssClass(validators[0], 'highlighted');
			formname.focus();
			return false;
		}

		if(formemail.value == defaultemailinput.value || formemail.value == '' || formemail.value.indexOf('@') < 0 || emailsplit[0] == '' || emailsplit[1] == '' || formemail.value.indexOf('.') < 0 || emailsplitdot[0] == '' || emailsplitdot[1] == '' )
		{
			$appendCssClass(validators[1], 'highlighted');
			formemail.focus();
			return false;
		}

		if(formcomment.value == defaultcommentinput.value || formcomment.value == '')
		{
			$appendCssClass(validators[2], 'highlighted');
			formcomment.focus();
			return false;
		}
	}
	
	filterhtml();
	clearsharps();
	ajaxloadingpanel.show();

	entry.value = '';
	eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4.2=[\'<l 0="y-4"><1 0="e-c" m="\'+z.2+\'"><3 5="n o" 0="d-a" 6="7(8, \\\'../i\\\', \\\'../p\\\')"><9 b="../f/g/q.h" /></3><3 5="n o" 0="d-u" 6="7(8, \\\'../j\\\', \\\'../p\\\')"><9 b="../f/g/q.h" /></3><3 0="A" 6="7(8, \\\'../j\\\', \\\'../i\\\')"><9 b="../f/g/r.h" 5="r" /></3><3 0="B" 6="7(8, \\\'../i\\\', \\\'../j\\\')"><9 b="../f/g/s.h" 5="s" /></3></1>\'+\'<1 0="C-4">\'+\'<t><a v="\'+D.2+\'" m="E" 5="\'+w.2+\'">\'+w.2+\'</a></t>\'+\'<1 0="4-F">\'+G.2+\'</1>\'+\'<1 0="4-H"><x>\'+I()+\'</x></1>\'+\'<1 0="4-J"><a v="K:\'+k.2+\'" 5="\'+k.2+\'">\'+k.2+\'</a></1>\'+\'</1></l>\'];',47,47,'class|div|value|button|entry|title|onclick|move|this|img||src||||Admin|Styles|png|ApprovedEntries|UnapprovedEntries|formemail|li|rel|Archive|Entry|DeletedEntries|Cancel|Approve|Unapprove|h4||href|formname|em|single|filename|app|unapp|guestbookxml|formurl|external|text|formcomment|date|Date|email|mailto'.split('|'),0,{}));
	
	$get('entries-list').style.visibility = 'hidden';
	sendentrytoserver();
	disableReplacedButton('form-submit');
}

// submit entry runtime
function createsubmissionobject() 
{
	var ro_submit_entry;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer")
	{
		ro_submit_entry = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		ro_submit_entry = new XMLHttpRequest();
	}
	return ro_submit_entry;
}

var http = createsubmissionobject();

function sendentrytoserver(){var _s = false;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1 5=\'\';6(u){5=\'\'}g{5=\' v h w x y a z A B 7.8 ( 9://C.D.E/#F ).\'}1 n=$0(\'o-G\');1 i=$0(\'j-H\').2+\', \'+$0(\'3-I-k\').2+\'***\'+$0(\'j-J\').2+\'***\'+5;1 3=$0(\'3\').2;1 b=$0(\'3-b\').2;1 l=$0(\'K\').2;1 m=$0(\'3-L-k\').2+5;1 c=$0(\'j-k\').2;1 d=\'\';6(!n.M){c=\'\'}6(l==\'N\'){d=\'O\'}g{d=\'\'}9.P(\'0\',\'7.8/7.8/p/Q\'+d+\'R.q?3=\'+3+\'&b=\'+b+\'&m=\'+m+\'&c=\'+c+\'&i=\'+i);9.S=r(){6(9.T==4){6(l==\'U\'){V(\'7.8/7.8/p/W.q\',\'f-s\')}X.Y(r(e){Z.10();$0(\'f-h\').t.11=\'12\';$0(\'f-h\').13=$0(\'14\').2;$0(\'f-s\').t.15=\'16\'},17)}g{}};9.o(18);',62,71,'get|var|value|entry||tr|if|Guestbook|XML|http||filename|useremail|pageprefix||entries|else|message|thankyoumsg|form|email|moderationenabled|notificationmsg|sendcopychkbox|send|ServerPages|php|function|list|style|_s|This|was|sent|by|trial|version|of|acidmartin|wemakesites|net|guestbook|copy_List_Item_0_input|name|thankyou|comment|moderation|notification|checked|true|un|open|createentry_|approved|onreadystatechange|readyState|false|synchronizefoldersrequest|approvedfiles|window|setTimeout|ajaxloadingpanel|hide|display|block|innerHTML|messagesenttextinput|visibility|visible|globaltimeout|null'.split('|'),0,{}));}

// ajax routine to synchronize the entries
function synchronizefoldersrequest(serverfile, serverfileloader)
{ 
	var AJAX;
	try
	{   
		AJAX = new XMLHttpRequest();  
	}
	catch(e)
	{   
	try
	{     
		AJAX = new ActiveXObject("Msxml2.XMLHTTP");     
	}
	catch(e)
	{     
		try
		{ 
			AJAX = new ActiveXObject("Microsoft.XMLHTTP");       
		}
		catch(e)
		{       
			alert("Your browser does not support AJAX.");
			return false;       
		}     
	}   
}

// ajax routine to synchronize the approved, unapproved and archived entries folders
AJAX.onreadystatechange = function(){if(AJAX.readyState == 4){if(AJAX.status == 200){window.setTimeout(function(e){if($get('privatecomments').value == 'true'){return false;}eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$1(k).l=m.n;o(2 i=0;i<7.8(\'9-a\').p;i++){2 6=7.8(\'9-a\')[i];2 3=$1(\'3\').q;b(3==\'c\'){$r(6,\'d\',\'<4 e="f c"><!-- / --></4>\')}b(3==\'g\'){$s(6,\'d\',\'<4 e="f g"><!-- / --></4>\');2 h=$1(\'j-t\');$1(\'j-u-v\').w(h)}}x.y(\'z\',$A($1(\'B\'),\'C-D\'),5,5,5,5);',40,40,'|get|var|entriesposition|div|true|entryitem|document|getElementsByClassName|single|entry|if|top|DIV|class|callout|bottom|commentsform||guestbookxml|serverfileloader|innerHTML|AJAX|responseText|for|length|value|insertFirstChild|insertLastChild|form|entries|list|appendChild|roundedcornerspaneljsguestbookxml|demand|large|style|dither|background|color'.split('|'),0,{}))}, globaltimeout);}
	else
		{
			
		}
	}
	else
		{
			
		}
	}
	AJAX.open("get", serverfile, true);
	AJAX.send(null);
}

// markup filter
function filterhtml()
{
	var markupfilterinput = $get('markupfilterinput');
	var comment = $get('form-comment');
	
	if(markupfilterinput.value == 'true')
	{
		var htmlregex = /<\S[^><]*>/g;
		comment.value = comment.value.replace(htmlregex, '');
	}
}

// clear all occurences of sharp symbol ("#") before sending the entry
function clearsharps()
{
	var texttocheck = $get('form-comment');
	var strreplace = texttocheck.value.replace(/#/g, '');
	texttocheck.value = strreplace;
}

// check maxlength property and apply it if such
function ismaxlength(obj)
{
	if(obj.value != 'auto')
	{
		var mlength = obj.getAttribute ? parseInt(obj.getAttribute("maxlength")) : "";
		if (obj.getAttribute && obj.value.length > mlength && obj.getAttribute != 'auto')
		{
			obj.value = obj.value.substring(0, mlength);
		}
	}
}

guestbookxml.init = function () {
    if (window.addEventListener) {
        window.addEventListener('load', function (e) {
            renderguestbookxml();
        },
        false);
    }
    if (window.ActiveXObject) {
        window.attachEvent('onload', function (e) {
              renderguestbookxml();
        });
    }
};

guestbookxml.init();