var Tell  = function () {};

Server.prototype.ERROR_NOT_LOADED_LIBRARY = (Tell.ERROR_NOT_LOADED_LIBRARY = -10);
Server.prototype.ERROR_NOT_LOADED_LIBRARY_MESSAGE = (Tell.ERROR_NOT_LOADED_LIBRARY_MESSAGE = "Not loaded library...");

Tell.prototype.account;
Tell.prototype.accountURL = "/cgi-bin/account/account20060727.cgi";
Tell.prototype.completionStatus = 0;
Tell.prototype.getCompletionStatus = function () {return this.completionStatus;};
Tell.prototype.setCompletionStatus = function (completionStatus) {this.completionStatus = completionStatus;};
Tell.prototype.debugging = false;
Tell.prototype.getDebugging = function () {return this.debugging;};
Tell.prototype.setDebugging = function (debugging) {this.debugging = debugging; return 1;};
Tell.prototype.dom;
Tell.prototype.expireDateForCookies = 14;
Tell.prototype.pageURL;
Tell.prototype.proxyURL = "/proxy/";
Tell.prototype.proxyPost = "/";
Tell.prototype.referrer = ""; 
Tell.prototype.remoteHTML; 
Tell.prototype.postmasterURL = "/cgi-bin/postmaster/postmaster.cgi";
Tell.prototype.sid = "";
Tell.prototype.getSID = function() {return this.sid;};
Tell.prototype.removeSID = function() {
 if(this.debugging && this.tellLog) {this.tellLog.println("Tell.removeSID...");};
 this.setSID("");
 if(this.account) {this.account.sid="";};
 if(this.dom) {this.dom.eraseCookie("sid");};
 return 1;
};
Tell.prototype.setSID = function(sid) {this.sid = sid; return 1;};
Tell.prototype.getSid = function() {return this.getSID();};
Tell.prototype.removeSid = function() {return this.removeSID();};
Tell.prototype.setSid = function(sid) {return this.setSID(sid);};
Tell.prototype.tellLog; 
Tell.prototype.getLog = function () {return this.tellLog;};
Tell.prototype.setLog = function (tellLog) {this.tellLog = tellLog;return 1;};
Tell.prototype.friendsChecked = false;
Tell.prototype.messageChecked = false;
Tell.prototype.server = new Server();
Tell.prototype.urlChecked = false;
Tell.prototype.getURLChecked = function () {return this.urlChecked;};
Tell.prototype.setURLChecked = function (urlChecked) {
 this.urlChecked = urlChecked; 
 if(!urlChecked) {
  this.dom.doHidden("strintgURLTitle");
  this.dom.doHidden("stringURLError");
  this.dom.removeChilds("urlTitleValue");
 }
 return 1;
};
Tell.prototype.yourChecked = false;
Tell.prototype.getYourChecked = function () {return this.yourChecked;};
Tell.prototype.setYourChecked = function (yourChecked) {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.setYourChecked...");};
 this.yourChecked = yourChecked; 
 if(yourChecked) {
  this.dom.doHidden("spanMyNameDescription");
  this.dom.doHidden("spanMyName");
  this.dom.doHidden("spanMyEmailDescription");
  this.dom.doHidden("spanMyEmail");
  this.dom.doHidden("spanMyPasswordDescription");
  this.dom.doHidden("spanMyPassword");
  this.dom.doHidden("spanRememberMe");
  this.dom.doHidden("spanLoginMessageDescription");
 } else {
  this.dom.doVisible("spanMyNameDescription");
  this.dom.doVisible("spanMyName");
  this.dom.doVisible("spanMyEmailDescription");
  this.dom.doVisible("spanMyEmail");
  this.dom.doVisible("spanMyPasswordDescription");
  this.dom.doVisible("spanMyPassword");
  this.dom.doVisible("spanRememberMe");
  this.dom.doVisible("spanLoginMessageDescription");
  this.removeSID();
 }
 return 1;
};

Tell.prototype.addFriend = function(event_) {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.addFriend is running...");}; 
 var tableTell = document.getElementById("tableTell");
 var trFriendsManager = document.getElementById("trFriendsManager");
 var parentTRFriendsManager = trFriendsManager.parentNode;
 var friendsCount = this.getFriendsCount(); 
 var textFriendName = this.dom.getTextContent("textFriendName");
 var labelFriendName = document.createTextNode(textFriendName+" ("+friendsCount+"):");
 var tdLabelFriendName = document.createElement("td");
 tdLabelFriendName.className = "tdDescription";
 tdLabelFriendName.appendChild(labelFriendName);
 var inputFriendName = document.createElement("input");
 inputFriendName.type = "text";
 inputFriendName.id = "friend"+friendsCount+"Name";
 inputFriendName.name = "friend"+friendsCount+"Name";
 inputFriendName.size = 35;
 inputFriendName.maxLength = 255;
 var tdInputFriendName = document.createElement("td");
 tdInputFriendName.className = "tdInput";
 tdInputFriendName.appendChild(inputFriendName);
 var trFriendName = document.createElement("tr");
 trFriendName.id= "trFriend"+friendsCount+"Name"
 trFriendName.appendChild(tdLabelFriendName);
 trFriendName.appendChild(tdInputFriendName);
 parentTRFriendsManager.insertBefore(trFriendName, trFriendsManager); 
 var textFriendEmail = this.dom.getTextContent("textFriendEmail");
 var labelFriendEmail = document.createTextNode(textFriendEmail+" ("+friendsCount+"):");
 var tdLabelFriendEmail = document.createElement("td");
 tdLabelFriendEmail.className = "tdDescription";
 tdLabelFriendEmail.appendChild(labelFriendEmail);
 var inputFriendEmail = document.createElement("input");
 inputFriendEmail.type = "text";
 inputFriendEmail.id = "friend"+friendsCount+"Email";
 inputFriendEmail.name = "friend"+friendsCount+"Email";
 inputFriendEmail.size = 35;
 inputFriendEmail.maxLength = 255;
 var tdInputFriendEmail = document.createElement("td");
 tdInputFriendEmail.className = "tdInput";
 tdInputFriendEmail.appendChild(inputFriendEmail);
 var divFriendStatusSuccess =  document.createElement("div");
 divFriendStatusSuccess.className = "divFriendStatus";
 divFriendStatusSuccess.id = "divFriend"+friendsCount+"StatusSuccess";
 divFriendStatusSuccess.appendChild(document.createTextNode(this.dom.getTextContent("divFriend0StatusSuccess")));
 divFriendStatusSuccess.style.color = "green";
 divFriendStatusSuccess.style.fontWeight = "bold";
 this.dom.doHidden(divFriendStatusSuccess);
 tdInputFriendEmail.appendChild(divFriendStatusSuccess);
 var divFriendStatusError =  document.createElement("div");
 divFriendStatusError.className = "divFriendStatus";
 divFriendStatusError.id = "divFriend"+friendsCount+"StatusError";
 divFriendStatusError.appendChild(document.createTextNode(this.dom.getTextContent("divFriend0StatusError")));
 divFriendStatusError.style.color = "red";
 divFriendStatusError.style.fontWeight = "bold";
 this.dom.doHidden(divFriendStatusError);
 tdInputFriendEmail.appendChild(divFriendStatusError);
 var trFriendEmail = document.createElement("tr");
 trFriendEmail.id= "trFriend"+friendsCount+"Email";
 trFriendEmail.appendChild(tdLabelFriendEmail);
 trFriendEmail.appendChild(tdInputFriendEmail);
 parentTRFriendsManager.insertBefore(trFriendEmail, trFriendsManager); 
 var removeFriend = document.getElementById("removeFriend");
 removeFriend.style.visibility = "visible";
}

Tell.prototype.check = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.check is running...");}; 
 if(!this.urlChecked) {this.checkURL();};
 if(!this.yourChecked) {this.checkYour();}; 
 this.showSendButton(); 
 return this.completionStatus;
}

Tell.prototype.checkFriends = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkFriends is running...");}; 
 if(this.friendsChecked) {this.completionStatus = 40; return this.completionStatus;}; 
 this.completionStatus = -40; 
 return this.completionStatus;
}

Tell.prototype.checkMessage = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkMessage is running...");}; 
 if(this.messageChecked) {this.completionStatus = 30; return this.completionStatus;}; 
 this.completionStatus = -30; 
 return this.completionStatus;
}

Tell.prototype.checkReferral = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkReferral is running...");}; 
 this.referrer = document.referrer;
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkReferral: "+"this.referrer="+this.referrer+";");};
 if(this.referrer) {
  var urlElement = document.getElementById("url");
  urlElement.setAttribute("value", this.referrer);
 }
}

Tell.prototype.checkURL = function() {	
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURL is running...");}; 
 this.setURLChecked(false); 
 this.remoteHTML = new RemoteHTML();
 this.remoteHTML.setDebugging(this.debugging); 
 this.remoteHTML.setLog(this.getLog()); 
 this.remoteHTML.setProxyURL(this.proxyURL);
 this.remoteHTML.setProxyPost(this.proxyPost); 
 this.pageURL = document.getElementById("url").value; 
 if(!this.pageURL) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURL: "+"this.pageURL is Empty...");};
  return -1;
 } else {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURL: "+"this.pageURL="+this.pageURL);};
 }; 
 if(this.remoteHTML) {
  this.remoteHTML.setPageURL(this.pageURL);
  this.remoteHTML.doForObject = this;
  this.remoteHTML.doIfComplete = this.checkURLDoCompleteFromEvent;
  this.remoteHTML.doIfError = this.checkURLDoErrorFromEvent;
  this.remoteHTML.init();
 } else {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURL: "+"this.remoteHTML is NOT...");}
  return -1;
 };
 return 1;
}

Tell.prototype.checkURLDoCompleteFromEvent = function(obj, status) {obj.checkURLDoComplete(status);}
Tell.prototype.checkURLDoComplete = function(status) { 
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete is running...");};
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete: GET HTTPHEADERS PROBLEM");};
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete: "+"this.remoteHTML="+this.remoteHTML);};
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete: "+"this.remoteHTML.getHTTPHeaders()="+this.remoteHTML.getHTTPHeaders());};
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete: "+"this.remoteHTML.getHTTPHeaders().getHeader(\"Title\")="+this.remoteHTML.getHTTPHeaders().getHeader("Title"));};
 if(this.remoteHTML && this.remoteHTML.getHTTPHeaders && this.remoteHTML.getHTTPHeaders().getHeader) {
  var urlTitle = this.remoteHTML.getHTTPHeaders().getHeader("Title");
 }; 
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete: "+"urlTitle="+urlTitle);}; 
 if(!urlTitle) {
  if(this.remoteHTML.reallyPageURL) {
   this.remoteHTML.getHTTPHeaders().setHeader("Title", this.remoteHTML.reallyPageURL);
   urlTitle = this.remoteHTML.reallyPageURL;
  } else {
   this.remoteHTML.getHTTPHeaders().setHeader("Title", "your url");
   urlTitle = "your url";
  }
 } else if(urlTitle.length > 55) {
  urlTitle = urlTitle.substr(0, 55)+"...";
 }; 
 if(this.remoteHTML.reallyPageURL) {
  this.dom.changeChilds("urlTitleValue", this.dom.createLinkElement("urlTitleValueLink", this.remoteHTML.reallyPageURL, urlTitle));
 } else {
  this.dom.changeTextContent("urlTitleValue", urlTitle);
 };
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoComplete: "+"Content chenged...");};
 this.dom.doVisible("strintgURLTitle"); 
 this.setURLChecked(true); 
 this.showSendButton();
}

Tell.prototype.checkURLDoErrorFromEvent = function(obj, status) {obj.checkURLDoError(status);}
Tell.prototype.checkURLDoError = function(status) {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoError is running...");}; 
 this.dom.doHidden("strintgURLTitle"); 
 this.dom.doHidden("errorBadURL");
 this.dom.doHidden("errorCanNotParse");
 if(status == RemoteHTML.ERROR_BAD_PAGE_URL) {
  this.dom.doVisible("errorBadURL");
 } else if(status == RemoteHTML.ERROR_CAN_NOT_PARSE) {
  this.dom.doVisible("errorCanNotParse");
  if(this.remoteHTML && !(this.remoteHTML.getHTTPHeaders())) {this.remoteHTML.setHTTPHeaders(new HTTPHeaders());};
  if(this.remoteHTML && this.remoteHTML.getHTTPHeaders && !this.remoteHTML.reallyPageURL) {
   if(this.pageURL.indexOf("tp://") < 1) {
    if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkURLDoError: "+"Not http://");};
    this.pageURL = "http://"+this.pageURL;
   };
   this.remoteHTML.reallyPageURL = this.pageURL;
  };
  this.remoteHTML.getHTTPHeaders().setHeader("Title", this.pageURL);
  this.checkURLDoComplete(status);
 } else {};
 
 this.dom.doVisible("stringURLError");
 this.showSendButton();
}

Tell.prototype.checkYour = function() {
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYour is running...");};
 this.hideAccountConfirmation(); 
 this.setYourChecked(false); 
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYour prepared success...");};
 this.account.email = document.getElementById("myEmail").value;
 this.account.name = document.getElementById("myName").value;
 this.account.password = document.getElementById("myPassword").value;
 this.account.languageOfInterface = document.getElementById("interfaceLanguage").value;
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYour: "+"Tell.this.getSID()="+this.getSID());};
 this.account.action = ""; 
 this.account.sid = this.getSID(); 
 this.account.update(); 
 return 1;
}

Tell.prototype.checkYourSid = function() {
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourSid...");};
 this.hideAccountConfirmation(); 
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourSid: "+"Tell.this.getSID()="+this.getSID());};
 this.account.action = ""; 
 this.account.sid = this.getSID(); 
 this.account.update(); 
 return 1;
}

Tell.prototype.changePair = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.changePair is running...");}; 
 this.account.action = "changePair"; 
 this.dom.doHidden("changePairSuccess");
 this.dom.doHidden("changePairError"); 
 this.account.email = document.getElementById("email").value;
 this.account.name = document.getElementById("oldName").value;
 this.account.password = document.getElementById("oldPassword").value;
 this.account.newName = document.getElementById("newName").value;
 this.account.newPassword = document.getElementById("newPassword").value; 
 this.account.update(); 
 return 1;
}

Tell.prototype.clearLoginInfo = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.clearLoginInfo is running...");};
 document.getElementById("myName").value = ""; 
 document.getElementById("myEmail").value = "";
 document.getElementById("myPassword").value = "";
 return 1;
}

Tell.prototype.doIfErrorAccountEvent = function(obj, account) {obj.doIfErrorAccount();};
Tell.prototype.doIfErrorAccount = function() {
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.doIfErrorAccount is running...");}; 
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.doIfErrorAccount this.account.actionResponse="+this.account.actionResponse);};
 if(this.account.actionResponse == "login" || this.account.actionResponse == "sid") {
  this.dom.doVisible("accountStatusLoginError");
  this.dom.changeTextContent("nameEmail", this.account.name+" ("+this.account.email+")");
  document.getElementById("nameEmail").style.color = "red";
  this.dom.doVisible("nameEmail");
  this.dom.doVisible("trAccountStatus"); 
  this.setYourChecked(false);
  this.showSendButton();
  return 1;
 } else if(this.account.actionResponse == "changePair") {
  this.dom.doVisible("changePairError"); 
  return 1;
 } else if(this.account.actionResponse == "register") {
  this.dom.doVisible("accountStatusRegistrationError");
  this.dom.changeTextContent("nameEmail", this.account.name+" ("+this.account.email+")");
  document.getElementById("nameEmail").style.color = "red";
  this.dom.doVisible("nameEmail");
  this.dom.doVisible("trAccountStatus"); 
  this.setYourChecked(false);
  this.dom.doVisible("spanAccountStatus");
  return 1;
 } else if(this.account.actionResponse == "remind") {  
  this.dom.doVisible("accountStatusRemindError");
  this.dom.changeTextContent("nameEmail", this.account.name+" ("+this.account.email+")");
  document.getElementById("nameEmail").style.color = "red";
  this.dom.doVisible("nameEmail");
  this.dom.doVisible("trAccountStatus"); 
  this.setYourChecked(false);
  this.dom.doVisible("spanAccountStatus");
  return 1;
 };
 return 0;
}

Tell.prototype.doIfSuccessAccountEvent = function(obj, account) {obj.doIfSuccessAccount();};
Tell.prototype.doIfSuccessAccount = function() {
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.doIfSuccessAccount is running...");}; 
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.doIfErrorAccount this.account.actionResponse="+this.account.actionResponse);};
 var rememberMe = document.getElementById("rememberMe").checked;
 if(this.account.sid && rememberMe) {
  if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccess: "+"this.account.getSID() = "+this.account.sid);};
  if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccess: "+"rememberMe = "+rememberMe);};
  this.dom.createCookie("sid", this.account.sid, this.expireDateForCookies);
 }; 
 this.setSID(this.account.sid);
 if(this.account.actionResponse == "login" || this.account.actionResponse == "sid") {
  var inputedName = document.getElementById("myName").value;
  if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccess: "+"inputedName = "+inputedName);};
  if(inputedName == "") {
   document.getElementById("myName").value = this.account.nameInfo;
   if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccess: "+"document.getElementById(\"myName\").value = "+document.getElementById("myName").value);};
  }
  if(this.debugging && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccess: "+"this.account.getEmailInfo() = "+this.account.emailInfo);};
  this.dom.doVisible("accountStatusLoginSuccess");
  this.dom.changeTextContent("nameEmail", this.account.nameInfo+" ("+this.account.emailInfo+")");
  document.getElementById("nameEmail").style.color = "green";
  this.dom.doVisible("nameEmail");
  this.dom.doVisible("trAccountStatus"); 
  this.setYourChecked(true);
  this.showSendButton();
  return 1;
 } else if(this.account.actionResponse == "changePair") {
  this.dom.doVisible("changePairSuccess"); 
  return 1;
 } else if(this.account.actionResponse == "register") { 
  this.dom.doVisible("accountStatusRegistrationSuccess");
  this.dom.changeTextContent("nameEmail", this.account.nameInfo+" ("+this.account.emailInfo+")");
  document.getElementById("nameEmail").style.color = "green";
  this.dom.doVisible("nameEmail");
  this.dom.doVisible("trAccountStatus"); 
  var rememberMe = document.getElementById("rememberMe").checked;
  if(this.account.sid && rememberMe) {
   if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccessRegistration: "+"this.account.getSID() = "+this.account.sid);};
   if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.checkYourDoIfSuccessRegistration: "+"rememberMe = "+rememberMe);};
   this.dom.createCookie("sid", this.account.sid, this.expireDateForCookies);
  };
  this.setSID(this.account.sid);
  this.setYourChecked(true);
  this.showSendButton();
 } else if(this.account.actionResponse == "remind") {  
  this.dom.doVisible("accountStatusRemindSuccess");
  this.dom.changeTextContent("nameEmail", this.account.name+" ("+this.account.email+")");
  document.getElementById("nameEmail").style.color = "green";
  this.dom.doVisible("nameEmail");
  this.dom.doVisible("trAccountStatus"); 
  this.setYourChecked(false);
  this.dom.doVisible("spanAccountStatus");
  return 1;
 };
 return 0;
}

Tell.prototype.getFriendsCount = function() {	
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.getFriendsCount is running...");};
 var friendsCount = 0;
 var lastFriendNode;
 while(document.getElementById("trFriend"+friendsCount+"Name")) {
  lastFriendNode = document.getElementById("trFriend"+friendsCount+"Name");
  friendsCount++;
 };
 return friendsCount;
}

Tell.prototype.getReferrerFormLocation = function() {	
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.getReferrerFormLocation is running...");};
 var loc = window.location.href;
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.getReferrerFormLocation: "+"loc = "+loc);};
 var newURLPosition = loc.indexOf("?");
 if(newURLPosition > 0) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.getReferrerFormLocation: "+"newURLPosition = "+newURLPosition);};  
  this.referrer = unescape(loc.slice(newURLPosition+1));
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.getReferrerFormLocation: "+"this.referrer="+this.referrer+";");};
  if(this.referrer) {
   var urlElement = document.getElementById("url");
   urlElement.setAttribute("value", this.referrer);
  } 
  return 1;
 } else {
  return 0;
 };
}

Tell.prototype.hideChangePanel = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.hideChangeProfilePanel is running...");}; 
 document.getElementById("changePanel").style.visibility = "hidden"; 
 this.dom.doHidden("changePairSuccess");
 this.dom.doHidden("changePairError"); 
 return 1;
};

Tell.prototype.hidePromotePanel = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.hidePromotePanel is running...");}; 
 document.getElementById("promotePanel").style.visibility = "hidden";  
 return 1;
};

Tell.prototype.hideWhatIsItPanel = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.hideWhatIsItPanel is running...");}; 
 document.getElementById("whatIsItPanel").style.visibility = "hidden";  
 return 1;
};

Tell.prototype.hideFrendsConfirmation = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.hideWhatIsItPanel is running...");}; 
 var friendsCount = this.getFriendsCount(); 
 for(var i = 0; i <friendsCount; i++) {
  document.getElementById("divFriend"+i+"StatusSuccess").style.visibility = "hidden"; 
  document.getElementById("divFriend"+i+"StatusError").style.visibility = "hidden"; 
 }; 
 return 1;
};

Tell.prototype.hideAccountConfirmation = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.hideAccountConfirmation is running...");}; 
 this.dom.doHidden("accountStatusLoginSuccess");
 this.dom.doHidden("accountStatusLoginError");
 this.dom.doHidden("accountStatusRegistrationSuccess");
 this.dom.doHidden("accountStatusRegistrationError");
 this.dom.doHidden("accountStatusRemindSuccess");
 this.dom.doHidden("accountStatusRemindError");
 this.dom.doHidden("nameEmail");
 return 1;
}; 

Tell.prototype.main = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.main is running...");}; 
 if(!this.testLibraries()) {return this.libraryLoaded;}; 
 this.dom = new Dom(); 
 
 this.account = new Account();
 this.account.debugging = this.getDebugging();
 this.account.accountLog = this.getLog();
 this.account.accountURL = this.accountURL; 
 this.account.doForObject = this;
 this.account.doIfSuccess = this.doIfSuccessAccountEvent;
 this.account.doIfError = this.doIfErrorAccountEvent;
 this.account.languageOfInterface = document.getElementById("interfaceLanguage").value;
 
 this.postmaster = new Postmaster();
 this.postmaster.setDebugging(this.getDebugging());
 this.postmaster.setLog(this.getLog());
 server = new Server();
 server.setDebugging(this.getDebugging());
 server.setLog(this.getLog());
 this.postmaster.setServer(server);
 this.postmaster.setPostmasterURL(this.postmasterURL); 
 this.postmaster.setDoForObject(this);
 this.postmaster.setDoIfSuccess(this.sentDoIfSuccessEvent);
 this.postmaster.setDoIfError(this.sentDoIfErrorEvent);
 this.postmaster.setLanguageOfInterface(document.getElementById("interfaceLanguage").value);
 
 this.setSID(this.dom.readCookie("sid"));
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.main: "+"this.getSID="+this.getSID());};
 if(this.getSID()) {this.checkYourSid();};
 
 if(!this.getReferrerFormLocation()) {this.checkReferral();} 
 this.checkURL();
 
 return 1;
} 

Tell.prototype.remindPassword = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.remindPassword is running...");};
 this.account.action = "remind";
 this.account.email = document.getElementById("myEmail").value;
 this.account.update(); 
 return 1;
}

Tell.prototype.removeFriend = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.removeFriend is running...");}; 
 var friendsCount = 0;
 var lastFriendNameNode;
 while(document.getElementById("trFriend"+friendsCount+"Name")) {
  lastFriendNameNode = document.getElementById("trFriend"+friendsCount+"Name");
  friendsCount++;
 };
 friendsCount--;
 var lastFriendEmailNode = document.getElementById("trFriend"+friendsCount+"Email");
 var lastFriendStatusNode = document.getElementById("trFriend"+friendsCount+"Status");
 var parentNode = lastFriendNameNode.parentNode;
 parentNode.removeChild(lastFriendNameNode);
 parentNode.removeChild(lastFriendEmailNode);
 if(friendsCount < 2) {
  var removeFriend = document.getElementById("removeFriend");
  removeFriend.style.visibility = "hidden";
 };
}

Tell.prototype.send = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.send is running...");}; 
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.send: "+"Tell.this.getSID()="+this.getSID());};
 this.postmaster.setSID(this.getSID()); 
 this.postmaster.setPageURL(document.getElementById("url").value);
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"this.postmaster.getPageURL()="+this.postmaster.getPageURL());}; 
 this.postmaster.setFromName(document.getElementById("myName").value);
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"this.postmaster.getFromName()="+this.postmaster.getFromName());}; 
 this.postmaster.setLabels(document.getElementById("labels").value);
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"this.postmaster.getLabels()="+this.postmaster.getLabels());}; 
 this.postmaster.setPageTitle(this.dom.getTextContent("urlTitleValueLink"));
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"this.postmaster.getPageTitle()="+this.postmaster.getPageTitle());}; 
 if(document.getElementById("inputReceiveCopy").checked) {
  this.postmaster.setReceiveCopy(1);
  if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"this.postmaster.setReceiveCopy(1)")};
 }; 
 this.postmaster.setText(document.getElementById("messageToFriends").value);
 if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"this.postmaster.getText()="+this.postmaster.getText());}; 
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.send: "+"Before add friend: this.postmaster.getFriendsCount()="+this.postmaster.getFriendsCount());};
 this.postmaster.clearFriendsList();
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.send: "+"After clear: this.postmaster.getFriendsCount()="+this.postmaster.getFriendsCount());};
 var friendsCount = this.getFriendsCount();
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.send: "+"friendsCount="+friendsCount);};
 for(var i = 0; i < friendsCount; i++) {
  if(this.debugging && this.getLog()) {this.getLog().println("Tell.send: "+"friend"+i+"Name="+document.getElementById("friend"+i+"Name").value+"; friend"+i+"Email="+document.getElementById("friend"+i+"Email").value);};
  this.postmaster.addFriend(document.getElementById("friend"+i+"Name").value, document.getElementById("friend"+i+"Email").value);
 };
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.send: "+"After add friend: this.postmaster.getFriendsCount()="+this.postmaster.getFriendsCount());}; 
 this.postmaster.send(); 
 return 1;
};

Tell.prototype.sentDoIfSuccessEvent = function(obj, account) {obj.sentDoIfSuccess();};
Tell.prototype.sentDoIfSuccess = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.sentDoIfSuccessEvent is running...");}; 
 var friendsCount = this.getFriendsCount();
 var friendStatus; 
 for(var i = 0; i < friendsCount; i++) {
  var friend = this.postmaster.getFriend(i);
  if(friend.status == "success") {
   friendStatus = document.getElementById("divFriend"+i+"StatusSuccess");
   this.dom.doVisible(friendStatus);
   this.dom.doHidden(document.getElementById("divFriend"+i+"StatusError"));
  } else {
   friendStatus = document.getElementById("divFriend"+i+"StatusError");
   this.dom.doVisible(friendStatus);
   this.dom.doHidden(document.getElementById("divFriend"+i+"StatusSuccess"));
  };
 }; 
 return 1;
}

Tell.prototype.sentDoIfErrorEvent = function(obj, account) {obj.sentDoIfError();};
Tell.prototype.sentDoIfError = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.sentDoIfError is running...");}; 
 return 1;
}

Tell.prototype.showChangePanel = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.showChangeProfilePanel is running...");}; 
 if(this.account.login == 1) {
  if(this.account.emailInfo) {document.getElementById("email").value = this.account.emailInfo;}; 
  if(this.account.nameInfo) {document.getElementById("oldName").value = this.account.nameInfo;}; 
 } else {
  document.getElementById("email").value = ""; 
  document.getElementById("oldName").value = ""; 
 };
 document.getElementById("oldPassword").value = "";
 document.getElementById("newName").value = "";
 document.getElementById("newPassword").value = "";
 document.getElementById("changePanel").style.visibility = "visible"; 
 return 1;
};

Tell.prototype.showPromotePanel = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.showPromotePanel is running...");}; 
 document.getElementById("promotePanel").style.visibility = "visible"; 
 return 1;
};

Tell.prototype.showWhatIsItPanel = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.showWhatIsItPanel is running...");}; 
 document.getElementById("whatIsItPanel").style.visibility = "visible"; 
 return 1;
};

Tell.prototype.showSendButton = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.showSendButton is running...");}; 
 if(this.urlChecked && this.yourChecked) {this.dom.doVisible("sendButton");} else {this.dom.doHidden("sendButton");}; 
 return this.completionStatus;
};

Tell.prototype.testLibraries = function() {
 if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary is running...");}; 
 this.libraryLoaded = true; 
 if (!Account) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary: "+"Account is NOT loaded...");}; 
  this.libraryLoaded = false;
 };  
 if (!Dom) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary: "+"Dom is NOT loaded...");};
  this.libraryLoaded = false;
 }; 
 if (!HTML) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary: "+"HTML is NOT loaded...");};
  this.libraryLoaded = false; 
 }; 
 if (!HTTPHeaders) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary: "+"HTTPHeaders is NOT loaded...");};
  this.libraryLoaded = false;
 }; 
 if (!Postmaster) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary: "+"Postmaster is NOT loaded...");};
  this.libraryLoaded = false;
 }; 
 if (!RemoteHTML) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("RemoteHTML is NOT loaded...");};
  this.libraryLoaded = false;
 }; 
 if (!Server) {
  if(this.getDebugging() && this.getLog()) {this.getLog().println("Tell.testLibrary: "+"Server is NOT loaded...");}; 
  this.libraryLoaded = false;
 }; 
 return this.libraryLoaded;
}