
Lycos.use("webon/modules/guestbook");Lycos.use("util/captcha");Lycos.use("ui");Lycos.webon.modules.formcreator=function(instId,subInstId){this.type="formcreator";this.lyModule=Lycos.webon.module;this.lyModule(instId,subInstId);this.jsObj="(Lycos.webon.getInstance('"+this.type+"', "+this.instId+", "+this.subInstId+"))";Lycos.webon.modules.guestbook.call(this,this.instId,this.subInstId);this.type="formcreator";this.getEntries=function(){return false;}
this.setEntriesHTML=function(){}
this.updateEntriesCount=function(data){}
this.setEntriesHTML=function(data){}
this.onComment=function(evt){var data=evt.lyResponse;if(data.verifier!=null){var captchaId=(data.captchaId!=0?data.captchaId:this.instId+"."+this.subInstId);document.getElementById("m_RI_"+captchaId).value=data.verifier[0];clearCaptcha(captchaId);refreshCaptchaImage(captchaId);}
if(typeof(data.error)!="undefined"){if(data.lightbox&&data.lightbox=="cancel")
Lycos.ui.lightbox.hide();alert(data.error);}
if(data.id==0){var cont=document.getElementById("commentList"+this.instId+"_"+this.subInstId);cont.innerHTML=cont.innerHTML+"<p> Your form has been submitted</p>";}
this.clearForm();this.toggleForm('none');if(data&&data.newId){var aName="comment"+this.instId+"_"+data.newId;window.location.hash="#"+aName;Lycos.ui.dragdrop.scrollToAnchor(aName);}
else
window.location.hash="#";}
this.clearForm=function(form){var btn=document.getElementById("commentsSubmit"+this.instId+"_"+this.subInstId);if(btn){btn.value=this.commentSubmitted;btn.disabled=false;}
var f=document.getElementById("formcreator_form_"+this.instId);var e=f.elements;for(id in e){if(e[id]==null||e[id].type==null)
continue;if(e[id].type=="text"||e[id].type=="textarea"||e[id].type=="password")
e[id].value="";else if(e[id].type=="checkbox"||e[id].type=="radio")
e[id].checked=false;else if(e[id].type=="select-one"||e[id].type=="select-multiple"){e[id].selectedIndex=-1;}}}}
