(function(){function b(i,g,f){var h=MGJS.$(i).innerHTML;var e='<a href="#'+g+'">@'+h.replace(/\t|\n|\r\n/g,"")+" </a> \n";c(e,f)}function a(j,g,i,f){var h=MGJS.$(j).innerHTML;var k=MGJS.$(i).innerHTML;var e='<blockquote cite="#'+i+'">';e+='\n<strong><a href="#'+g+'">'+h.replace(/\t|\n|\r\n/g,"")+"</a> :</strong>";e+=k.replace(/\t/g,"");e+="</blockquote>\n";d(e,f)}function c(e,f){if(MGJS.$(f)&&MGJS.$(f).type=="textarea"){field=MGJS.$(f)}else{alert("The comment box does not exist!");return false}if(field.value.indexOf(e)>-1){alert("You've already appended this reply!");return false}if(field.value.replace(/\s|\t|\n/g,"")==""){field.value=e}else{field.value=field.value.replace(/[\n]*$/g,"")+"\n\n"+e}field.focus()}function d(e,h){if(MGJS.$(h)&&MGJS.$(h).type=="textarea"){field=MGJS.$(h)}else{alert("The comment box does not exist!");return false}if(document.selection){field.focus();sel=document.selection.createRange();sel.text=e;field.focus()}else{if(field.selectionStart||field.selectionStart=="0"){var g=field.selectionStart;var f=field.selectionEnd;var i=g;field.value=field.value.substring(0,g)+e+field.value.substring(f,field.value.length);i+=e.length;field.focus();field.selectionStart=i;field.selectionEnd=i}else{field.value+=e;field.focus()}}}window.MGJS_CMT={};window.MGJS_CMT["reply"]=b;window.MGJS_CMT["quote"]=a})();