// Copyright 2008 Bontrager Connection, LLC
//
// Three places to customize:
//
// Place 1:
// Specify the content of the textarea field as it is 
//    prefilled when the form first loads. (all one line)

var greeting = "Type your response here. Be sure to include contact information if you want a response back. When done typing, click anywhere outside the box. Thank you."

// Place 2:
// Specify the acknowledgment text, to be seen when 
//    feedback has been submitted. (all one line)

var acknowledgment = "Your response has been sent - Thank you. Please say more if you wish. \n\nIf you included contact information and requested a response, we'll get back with you as soon as possible."

// Place 3:
// Specify the URL of the anonymous talk text box processor.

var scriptURL = "http://www.dallaswebdesignandhosting.com/scripts/anontalk.php";

// // // // // // // // // // // // // // // // // // // // // //
//     No other customization required.  //
// // // // // // // // // // // // // // // // // // // // // //

var acknowledged = false;

function AnonTalk_Trim(s) {
var re = /^\s*/g;
s = s.replace(re,'');
re = /\s*$/g;
s = s.replace(re,'');
return s;
} // function AnonTalk_Trim()

function AnonTalk_ClickContent(D) {
var d = AnonTalk_Trim(D.value);
if( (d == greeting) || (d == acknowledgment) ) { D.value = ""; }
} // function AnonTalk_ClickContent()

function AnonTalk_RecordIt(D) {
var d = AnonTalk_Trim(D.value);
if( (d == greeting) || (d == acknowledgment) ) { d = ""; }
if(d.length < 1) {
   D.value = greeting;
   return;
   }
var title = document.title;
if(title.length < 1) { title = 'Untitled'; }
var response = new Image();
response.src = scriptURL+'?U='+escape(document.URL)+'&T='+escape(title)+'&M='+escape(d);
D.value = acknowledgment;
} // function AnonTalk_RecordIt()
