onChange=\"javascript:COMMENTOR.insertTag('<span style=font-family:'+COMMENTOR.$('testimonial_form').fnt_face.options[fnt_face.selectedIndex].value+'>', '</span>'); COMMENTOR.$('testimonial_form').fnt_face.options[0].selected=true\">"+
"<option value=\"\">Font"+
"<option value=\"serif\" style=\"font-family:serif\">Serif"+
"<option value=\"monospace\" style=\"font-family:monospace\">Monospace"+
"<option value=\"Century\" style=\"font-family:Century\">Century"+
"<option value=\"Courier\" style=\"font-family:Courier\">Courier"+
"</select>"+
"</div>"+
"<table class=\"formtable\"><tr><td class=\"value\">"+
"<textarea id=\"komen\" rows=\"7\" style=\"width:"+COMMENTOR.$width+"\" name=\"body\" onKeyDown=\"textCounter(COMMENTOR.$('komen'),COMMENTOR.$('minputcount'),"+COMMENTOR.$max+");\" onKeyUp=\"textCounter(COMMENTOR.$('komen'),COMMENTOR.$('minputcount'),"+COMMENTOR.$max+");\"></textarea>"+
"<div style=\"width:"+COMMENTOR.$width+"\">"+
"<a href=\"javascript:void(0);\" onClick=\"COMMENTOR.rstxtbox('komen', 0, 10);\"><img alt=\"\" src=\"http://h1.badwaresite.www/feruzz/friendster/photo/rs_vb.gif\" style=\"margin: 2px\" /></a>"+
"<a href=\"javascript:void(0);\" onClick=\"COMMENTOR.rstxtbox('komen', 0, -10);\"><img alt=\"\" src=\"http://h1.badwaresite.www/feruzz/friendster/photo/rs_vs.gif\" style=\"margin: 2px\" /></a>"+
"</div>"+
"</td></tr><tr><td class=\"value\">"+
"<input style=\""+COMMENTOR.$insty+"\" type=\"button\" name=\"Submit\" href=\"#quickcomment\" onMouseOver=\"window.status='Send';return true;\" onClick=\"javascript:void(COMMENTOR.insertSM());COMMENTOR.$('testimonial_form').action='http://www.friendster.com/testimonials.php?uid="+pageOwnerID+""+COMMENTOR.$amp+"action=add';COMMENTOR.$('testimonial_form').submit();javascript:void(COMMENTOR.sendForm());\" value=\"Submit\"> "+
"<input style=\""+COMMENTOR.$insty+"\" type=\"button\" value=\"Preview\" onclick=\"javascript:void(COMMENTOR.insertSM());javascript:void(COMMENTOR.togglecomprev(0));\"> "+
"<input style=\""+COMMENTOR.$insty+"\" class=\"clearButtons\" type=\"reset\" name=\"cancel\" value=\"Clear\" maxlength=\"25\"> "+
"<input style=\""+COMMENTOR.$insty+"\" class=\"closeButtons\" type=\"reset\" name=\"cancel\" onClick=\"javascript:void(COMMENTOR.cancelForm());\" value=\"Close\"> "+
"<input id=\"show\" style=\""+COMMENTOR.$insty+"\" class=\"Smilies\" type=\"button\" name=\"Smilies\" onClick=\"javascript:void(COMMENTOR.showForm());\" value=\"Open Smilies\">"+
"<input id=\"close\" style=\"display:none;"+COMMENTOR.$insty+"\" class=\"Smilies\" type=\"button\" name=\"Smilies\" onClick=\"javascript:void(COMMENTOR.hideForm());\" value=\"Close Smilies\">"+
"<div class=\"dc\"><span class=\"q\">Characters remaining </span><input id=\"minputcount\" readonly maxlength=\"4\" size=\"4\" value=\""+COMMENTOR.$max+"\" name=\"inputcount\"></div>"+
"<div id=\"hide\" style=\"display:none;width:"+COMMENTOR.$width+"\" align=\"center\">"+smdiv.innerHTML+"</div>"+
"</td></tr></table></form></div>";
COMMENTOR.commentBox("Quick Comment",commform,"quickcomment",/publiccomments/i,"above");
document.location.href="#quickcomment";
COMMENTOR.createcomprev();
},
togglecomprev: function(prevflag) {
var el = COMMENTOR.$("prevComment");
if (prevflag === 0) {
commCode1 = COMMENTOR.$("quickcomment").getElementsByTagName("textarea")[0].value.replace(/</g, "<").replace(/>/g, ">");
commCode2 = COMMENTOR.$("quickcomment").getElementsByTagName("textarea")[0].innerHTML.replace(/</g, "<").replace(/>/g, ">");
if (commCode1 !== "") {
el = COMMENTOR.replaceHtml(el,commCode1);
}else {
el = COMMENTOR.replaceHtml(el,commCode2);
}
COMMENTOR.$("commentprevbox").style.display = "";
}else {
COMMENTOR.changeText(el,"");
COMMENTOR.$("commentprevbox").style.display = "none";
}
},
createcomprev: function() {
try {
var prevBox = document.createElement("div");
prevBox.id = "commentprevbox";
prevBox.style.display = "none";
prevBox.style.padding = "15px";
prevBox.appendChild(document.createElement("div"));
prevBox.getElementsByTagName("div")[0].id = "prevComment";
prevBox.getElementsByTagName("div")[0].style.padding = "5px";
prevBox.getElementsByTagName("div")[0].style.border = "thin";
prevBox.getElementsByTagName("div")[0].style.borderStyle = "solid";
prevBox.appendChild(document.createElement("div"));
prevBox.getElementsByTagName("div")[1].align = "center";
prevBox.getElementsByTagName("div")[1].style.padding = "5px";
var cbutton = document.createElement("input");
cbutton.style.padding = "4px 0";
cbutton.style.margin = "10px 0 6px 0";
cbutton.style.fontFamily = "Arial";
cbutton.style.fontWeight = "bold";
cbutton.style.color = "#17728f";
cbutton.style.border = "1px solid #196B91";
cbutton.style.backgroundColor = "#ffffff";
cbutton.type = "button";
cbutton.value = "Hide Preview";
cbutton.onclick = function() {
COMMENTOR.togglecomprev(1);
};
prevBox.getElementsByTagName("div")[1].appendChild(cbutton);
COMMENTOR.$("quickcomment").appendChild(prevBox);
}catch(e) {
COMMENTOR.createcomprev();
}
},
hideStatus: function() {
try {
sty = document.createElement("style");
sty.type = "text/css";
COMMENTOR.changeText(sty,".statusmessagebox{display:none;}.postimage{cursor:hand;}.postimage:hover{background-color:#C2CFE5;cursor:hand;}");
document.getElementsByTagName("head")[0].appendChild(sty);
}catch(e){}
try {
document.styleSheets[document.styleSheets.length - 1].addRule(".statusmessagebox", "display:none;");
document.styleSheets[document.styleSheets.length - 1].addRule(".postimage", "cursor:pointer;cursor:hand;");
document.styleSheets[document.styleSheets.length - 1].addRule(".postimage:hover", "background-color:#C2CFE5;cursor:pointer;cursor:hand;");
}catch(e){}
},
sendForm: function() {
COMMENTOR.changeText(COMMENTOR.$("quickcomment").getElementsByTagName("h2")[0],"Posting comment...Please wait...");
var postComment = document.createElement("div");
postComment.className = "boxcontent";
postComment.align = "center";
postComment.appendChild(document.createElement("img"));
postComment.getElementsByTagName("img")[0].src = "http://www.photo-host.org/img/239795loading.gif";
if (COMMENTOR.$("content_quickcomment") !== null) {
COMMENTOR.$("content_quickcomment").parentNode.replaceChild(postComment,COMMENTOR.$("content_quickcomment"));
}
COMMENTOR.$("commentprevbox").parentNode.removeChild(COMMENTOR.$("commentprevbox"));
document.location.href="#quickcomment";
},
cancelForm: function() {
setTimeout("COMMENTOR.$('quickcomment').parentNode.removeChild(COMMENTOR.$('quickcomment'));document.location.href='#18'",2000);
COMMENTOR.init();
},
showForm: function() {
if (COMMENTOR.$("hide").style.display != "none") {
COMMENTOR.hideForm();
}else {
COMMENTOR.$("hide").style.display = "";
COMMENTOR.$("show").style.display = "none";
COMMENTOR.$("close").style.display = "";
}
},
hideForm: function() {
COMMENTOR.$("hide").style.display = "none";
COMMENTOR.$("show").style.display = "";
COMMENTOR.$("close").style.display = "none";
},
insertSM: function() {
var allsmileys = COMMENTOR.$("komen").value.match(/:
\w+)?::/gim);
if (allsmileys !== null) {
for(sm=0;sm<allsmileys.length;sm++) {
if (smileys[allsmileys[sm].match(/\w+/)[0]] !== "undefined") {
COMMENTOR.$("komen").value = COMMENTOR.$("komen").value.replace(/:
\w+)?::/gim, "<img src=\""+smileys[allsmileys[sm].match(/\w+/)[0]]+"\" border=\"0\">");
}
}
}
},
//faster than innerHTML
replaceHtml: function(el, html) {
var oldEl = typeof el === "string" ? COMMENTOR.$(el) : el;
/*@cc_on
oldEl.innerHTML = html;
return oldEl;
@*/
var newEl = oldEl.cloneNode(false);
newEl.innerHTML = html;
oldEl.parentNode.replaceChild(newEl, oldEl);
return newEl;
},
innerTextFeature: function() {
var obj = (document.getElementsByTagName("body")[0].innerText !== undefined) ? true : false;
return obj;
},
changeText: function(elem,changeVal) {
if(!COMMENTOR.innerTextFeature()) {
elem.textContent = changeVal;
}else {
elem.innerText = changeVal;
}
},
rtxt: function(text,textarea) {
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange) {
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length-1) == " "? text+" ": text;
caretPos.select();
}else if(typeof(textarea.selectionStart) != "undefined") {
var begin = textarea.value.substr(0,textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;textarea.value = begin+text+end;
if (textarea.setSelectionRange) {
textarea.focus();
textarea.setSelectionRange(begin.length+text.length,begin.length+text.length);
}
textarea.scrollTop = scrollPos;
}else {
textarea.value += text;
textarea.focus(textarea.value.length-1);
}
},
insertTag: function(open, close) {
msgfield = (document.all) ? document.all.body : COMMENTOR.$('testimonial_form').body;
if (document.selection && document.selection.createRange) {
msgfield.focus();
sel = document.selection.createRange();
sel.text = open + sel.text + close;
msgfield.focus();
}else if (msgfield.selectionStart || msgfield.selectionStart == '0') {
var startPos = msgfield.selectionStart;
var endPos = msgfield.selectionEnd;
msgfield.value = msgfield.value.substring(0, startPos) + open + msgfield.value.substring(startPos, endPos) + close + msgfield.value.substring(endPos, msgfield.value.length);
msgfield.selectionStart = msgfield.selectionEnd = endPos + open.length + close.length;
msgfield.focus();
}else {
msgfield.value += open + close;
msgfield.focus();
}
return;
},
//Expand the textarea
rstxtbox: function(name, colInc, rowInc) {
try {
var objek;
if (COMMENTOR.$IE4) {
objek = document.all[name];
}else {
objek = COMMENTOR.$(name);
}
objek.rows += rowInc;
objek.cols += colInc;
}catch(e) {}
},
$: function(id) {
if (COMMENTOR.$DOM) return document.getElementById(id);
return (COMMENTOR.$NS4) ? document.layers[id] : (COMMENTOR.$IE4) ? document.all[id] : (COMMENTOR.$IE5||COMMENTOR.$NS5) ? document.getElementById(id) : null;
},
commentBox: function(head,code,id,sibling,x) {
var sbdiv = document.createElement("div");
sbdiv.className="commonbox "+id;
sbdiv.id = id;
if (!head) head = "";
else head = "<h2>"+head+"</h2>";
sbdiv.innerHTML = head;
sbdiv.appendChild(document.createElement("div"));
sbdiv.getElementsByTagName("div")[0].id = "content_"+id;
sbdiv.getElementsByTagName("div")[0].innerHTML = code;
var sbli = document.createElement("li");
sbli.appendChild(sbdiv);
if (!x) this.getModuleByClassName(sibling)[0].parentNode.parentNode.appendChild(sbli);
else if (x == "below") this.getModuleByClassName(sibling)[0].parentNode.appendChild(sbli);
else if (x == "above") {
var ul = this.getModuleByClassName(sibling)[0];
ul.parentNode.parentNode.insertBefore(sbli,ul.parentNode);
}
},
getModuleByClassName: function(sClass) {
var elm = [];
var els = document.getElementsByTagName("*") || document.all;
for (var j=0,k=els.length;j<k;j++) {
if (new RegExp(sClass).test(els[j].className))elm.push(els[j]);
}
return elm;
}
};