var jsfilename;



jsfilename = "ajax.js";

function noEnter(a){if(a.keyCode==13){addMessage(a,commID);return false}}function addMessage(h,b){if(!h){var h=window.event}if(checkFormText(h)){var a="widget=Channels";var c=document.comment.elements;for(elm=0;elm<c.length;elm++){if(c[elm].name=="text"){a+="&"+c[elm].name+"="+encodeURIComponent(c[elm].value)}else{a+="&"+c[elm].name+"="+escape(c[elm].value)}}document.getElementById("commentText").value="";var f=document.comment.ti;var d=new Date();if(f.value!=""){var g=d.getTime()-f.value;if(g<5000){h.cancelBubble=true;BIA.dipdive.showNotification("","Hey slow down! To prevent spamming, you can post only one comment each 5 seconds.");return false}}f.value=d.getTime();btnLoading(true);connectionWrapper("/actions/comment.add/"+b+"?"+a,"channelcomments")}}function btnLoading(a){document.getElementById("ldrBtn").style.display=(a)?"none":"inline";document.getElementById("ldr").style.display=(a)?"inline":"none"}function checkFormText(a){if(document.getElementById("commentText").value==""||document.getElementById("commentText").value.length>100){a.cancelBubble=true;BIA.dipdive.showNotification("","Comment should be minimum of 1 charcter and maximum of 100 characters.");return false}else{return true}}function commentWidgetData(a,b){if(typeof(a)=="string"&&typeof(b)=="object"){b.innerHTML=a}}function connectionWrapper(b,e){var c=document.getElementById(e);var a={handleSuccess:function(h){var g=new YAHOO.util.Anim(e,{opacity:{to:0}},0.5);var f=function(k,j){commentWidgetData(h.responseText,c);var i=new YAHOO.util.Anim(e,{opacity:{to:1}},0.5);i.animate()};g.onComplete.subscribe(f);g.animate();btnLoading(false)},handleFailure:function(f){alert("Unable to load requested page : "+f.status+" "+f.statusText);btnLoading(false)}};var d={success:a.handleSuccess,failure:a.handleFailure,scope:a};YAHOO.util.Connect.asyncRequest("GET",b,d,null)};
