function deleteComment(commentID){var cell=document.getElementById('c-'+commentID);var previousBackGroundColor=cell.style.backgroundColor;cell.style.backgroundColor='#ffffcc';if(confirm('Are you sure you want to delete?')){document.getElementById("_c-action").value="deleteComment";document.getElementById("_c-k").value=commentID;var params=buildParamsFromForm(document.getElementById('_CommentControlForm'));comment_deleting(commentID);loadXMLDoc("POST","/ws/AjaxManager.smile?action=DeleteComment",params,comment_delete_done);return false}else{cell.style.backgroundColor=previousBackGroundColor;return false}}function comment_deleting(commentID){window.status="Deleting Comment...";setElementDisplay('c-tr-'+commentID,'none');setElementDisplay('commentCount','none');}function comment_delete_done(){if(req.readyState==4){if(req.status==200&&req.responseText=="OK"){window.status="Comment Deleted - "+(new Date());}else{window.status="";alert('We\'re sorry, an unknown error has occurred while processing your request.');}}}function postComment(){var params=buildParamsFromForm(document.getElementById('FormComment'));comment_posting();loadXMLDoc("POST","/ws/CommentAjaxManager.smile?action=PostComment",params,comment_done);return false}function comment_posting(){window.status="Posting Comment...";setElementDisplay('spanCommentEntry','none');setElementDisplay('spanCommentEntryResponse','block');document.getElementById('spanCommentEntryResponse').innerHTML="<br><br /><div align=''><span class='pending'>Posting comment...</span></div><br />"}var commentCount=0;var commentAnother="<br /><a href='#comment' onclick=\"setElementDisplay('spanCommentEntry', 'block'); setElementDisplay('spanCommentEntryResponse', 'none'); renderTextComment(); return false;\">enter another comment</a>";function comment_done(){if(req.readyState==4){if(req.status==200&&req.responseText.indexOf('FAILED')!=0){document.getElementById('_Comments').innerHTML=req.responseText;if(++commentCount>2)commentAnother="";window.status="Comment Posted - "+(new Date());setElementDisplay('spanCommentEntry','none');setElementDisplay('spanCommentEntryResponse','block');document.getElementById('spanCommentEntryResponse').innerHTML="<br><br /><div align=''><span class='confirm'>Thank you, your comment has been posted.</span>"+commentAnother+"</div><br />";if(typeof(comment_done_callback)=="function")comment_done_callback();}else{window.status="";setElementDisplay('spanCommentEntry','block');setElementDisplay('spanCommentEntryResponse','none');alert('We\'re sorry, an unknown error has occurred while processing your request.');}}}function pageComment(pageNumber){var params=buildParamsFromForm(document.getElementById('FormComment'));comment_paging();loadXMLDoc("POST","/ws/CommentAjaxManager.smile?action=PageComment&commentpg="+pageNumber,params,comment_paging_done);return false}function comment_paging(){scrollToElement(document.getElementById('comment'));window.status="Downloading Page...";setElementDisplay('spanCommentEntry','none');setElementDisplay('spanCommentEntryResponse','block');document.getElementById('spanCommentEntryResponse').innerHTML="<br /><div align=''><span class='pending'>Downloading page...</span></div><br />";if(typeof(comment_paging_callback)=="function")comment_paging_callback();}function comment_paging_done(){if(req.readyState==4){if(req.status==200&&req.responseText.indexOf('FAILED')!=0){document.getElementById('_Comments').innerHTML=req.responseText;window.status="Comment Page Downloaded - "+(new Date());setElementDisplay('spanCommentEntry','block');setElementDisplay('spanCommentEntryResponse','none');renderTextComment();if(typeof(comment_paging_done_callback)=="function")comment_paging_done_callback();}else{window.status="";setElementDisplay('spanCommentEntry','block');setElementDisplay('spanCommentEntryResponse','none');alert('We\'re sorry, an unknown error has occurred while processing your request.');}}}function validateTextComment(){if(typeof(updateRTE)=="function"){updateRTE('TextComment');}if(document.getElementById('hdnTextComment'))return validateTextSubmission('hdnTextComment','comment',true);else return validateTextSubmission('TextComment','comment');}function renderTextComment(){if(document.getElementById('spanRTETextComment')){setSpanRTE(document.getElementById('spanRTETextComment'));writeRichText('TextComment',commentTip,'98%',140,true,false);if(frames['TextComment']){if(frames['TextComment'].attachEvent){frames['TextComment'].attachEvent("onfocus",textcomment_onfocus);frames['TextComment'].attachEvent("onblur",textcomment_onblur);}else{if(document.getElementById('TextComment').contentDocument&&document.getElementById('TextComment').contentDocument.addEventListener){document.getElementById('TextComment').contentDocument.addEventListener("focus",textcomment_onfocus,false);document.getElementById('TextComment').contentDocument.addEventListener("blur",textcomment_onblur,false);}}}}}function textcomment_onblur(){}function textcomment_onfocus(){if(frames['TextComment'].attachEvent){if(stripHTML(frames['TextComment'].document.body.innerHTML)==commentTip)frames['TextComment'].document.body.innerHTML=''}else{if(document.getElementById('TextComment').contentDocument&&document.getElementById('TextComment').contentDocument.addEventListener){if(stripHTML(document.getElementById('TextComment').contentDocument.body.innerHTML)==commentTip)document.getElementById('TextComment').contentDocument.body.innerHTML='<br />'}}}function replyComment(){try{if(frames['TextComment']){writeComment();return true}else{if(typeof(writeReview)=="function"){writeReview();return true}else{if(typeof(writePublicComment)=="function"){writePublicComment();return true}}}}catch(e){}return false}function writeComment(url){if(arguments.length<1)url=window.location.href;try{frames['TextComment'].focus();scrollToElement(document.getElementById('FormComment'));}catch(e){}}