new Image().src="http://cn3.kaboodle.com/ht/img/store/thumbsUpGray.gif?v=r0_56_0_128";new Image().src="http://cn3.kaboodle.com/ht/img/store/thumbsDownGray.gif?v=r0_56_0_128";function addDealComment(c,b,e){document.getElementById("addDealCommentBtn_"+c).disabled=true;var d=new Object();d.dealId=c;d.action="addDealComment";d.comment=document.getElementById("dealCommentText_"+c).value;d.commentDeleteCallback=e;var a=new Object();a.callbackMethod=b;a.dealId=c;formSubmitAJAX("/deal/comments",d,"submitAddDealCommentCallback",a)}function submitAddDealCommentCallback(results,callbackParams){var comments=results.getElementsByTagName("comment");if(comments.length>0){var htmlValue="";for(var i=0;i<comments.length;i++){htmlValue=htmlValue+comments[i].firstChild.nodeValue}if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)(htmlValue,callbackParams.dealId)}}document.getElementById("dealCommentText_"+callbackParams.dealId).value="";document.getElementById("addDealCommentBtn_"+callbackParams.dealId).disabled=false}function deleteDealComment(c,d,a,f){var e=new Object();e.action="deleteDealComment";e.dealId=d;e.commentId=c;var b=new Object();b.containerId=a;b.callbackMethod=f;b.commentId=c;b.dealId=d;formSubmitAJAX("/deal/comments",e,"submitDeleteDealCommentCallback",b)}function submitDeleteDealCommentCallback(results,callbackParams){var containerEle=document.getElementById("userComment_"+callbackParams.commentId);containerEle.style.display="none";if(callbackParams.callbackMethod!=""){eval(callbackParams.callbackMethod)(callbackParams.dealId)}}function setCommentsPosix(b,a){if(b>1){document.getElementById("cmntPosix1_"+a).innerHTML="s";document.getElementById("cmntPosix2_"+a).innerHTML="s";document.getElementById("cmntPosix3_"+a).innerHTML="s"}else{document.getElementById("cmntPosix1_"+a).innerHTML="";document.getElementById("cmntPosix2_"+a).innerHTML="";document.getElementById("cmntPosix3_"+a).innerHTML=""}}function setVotesPosix(b,a){if(b>1){document.getElementById(a).innerHTML="s"}else{document.getElementById(a).innerHTML=""}}function ci_commentDeletedCallback(b){var a=parseInt(document.getElementById("commentsCountBox_"+b).innerHTML);document.getElementById("commentsCountBox_"+b).innerHTML=(a-1);document.getElementById("commentCount_"+b).innerHTML=(a-1);setCommentsPosix(a-1,b)}function ci_commentAddedCallback(c,e){var a=parseInt(document.getElementById("commentsCountBox_"+e).innerHTML);document.getElementById("commentsCountBox_"+e).innerHTML=(a+1);document.getElementById("commentCount_"+e).innerHTML=(a+1);setCommentsPosix(a+1,e);var b=document.getElementById("dealCmt_"+e);b.style.display="";var d=b.innerHTML;b.innerHTML=d+c}function voteThumbsUp(b,d){document.getElementById("thumbsDownAnchor_"+b).href="javascript:void(0)";document.getElementById("thumbsUpAnchor_"+b).href="javascript:void(0)";var c=new Object();c.dealId=b;c.action="thumbsUpRating";var a=new Object();a.dealId=b;a.isLoginEvent=d;formSubmitAJAX("/deal/comments",c,"submitVoteThumbsUpCallback",a)}function submitVoteThumbsUpCallback(f,b){if(b.isLoginEvent){window.location.reload();return}var a=document.getElementById("dealVoting_"+b.dealId);a.style.background="#fbfdf8";a.style.border="1px solid #b5d975";document.getElementById("votingStatus_"+b.dealId).innerHTML="<h5>It worked for you.</h5>";var d=parseInt(f.getElementsByTagName("positiveDelta")[0].firstChild.nodeValue);var g=parseInt(f.getElementsByTagName("negativeDelta")[0].firstChild.nodeValue);var c=parseInt(document.getElementById("thumbsDownVotesCount_"+b.dealId).innerHTML);document.getElementById("thumbsDownVotesCount_"+b.dealId).innerHTML=(c+g);setVotesPosix(c+g,"negVotesS_"+b.dealId);var e=parseInt(document.getElementById("thumbsUpVotesCount_"+b.dealId).innerHTML);document.getElementById("thumbsUpVotesCount_"+b.dealId).innerHTML=(e+d);setVotesPosix(e+d,"posVotesS_"+b.dealId);document.getElementById("thumbsUp_"+b.dealId).style.paddingTop="1px";document.getElementById("thumbsUpImg_"+b.dealId).src="http://cn3.kaboodle.com/ht/img/store/thumbsUpGray.gif?v=r0_56_0_128";document.getElementById("thumbsUp_"+b.dealId).innerHTML="<a href=\"javascript:voteThumbsUp('"+b.dealId+'\')" id="thumbsUpAnchor_'+b.dealId+'"><img src="http://cn3.kaboodle.com/ht/img/store/thumbsUpGray.gif?v=r0_56_0_128" id="thumbsUpImg_'+b.dealId+'"></a>';document.getElementById("thumbsDown_"+b.dealId).innerHTML="<a href=\"javascript:voteThumbsDown('"+b.dealId+'\')" id="thumbsDownAnchor_'+b.dealId+'"><img src="http://cn3.kaboodle.com/ht/img/store/thumbsDownGray.gif?v=r0_56_0_128" id="thumbsDownImg_'+b.dealId+'"></a>'}function voteThumbsDown(b,d){document.getElementById("thumbsDownAnchor_"+b).href="javascript:void(0)";document.getElementById("thumbsUpAnchor_"+b).href="javascript:void(0)";var c=new Object();c.dealId=b;c.action="thumbsDownRating";var a=new Object();a.dealId=b;a.isLoginEvent=d;formSubmitAJAX("/deal/comments",c,"submitVoteThumbsDownCallback",a)}function submitVoteThumbsDownCallback(f,b){if(b.isLoginEvent){window.location.reload();return}var a=document.getElementById("dealVoting_"+b.dealId);a.style.background="#fbfdf8";a.style.border="1px solid #b5d975";document.getElementById("votingStatus_"+b.dealId).innerHTML="<h5>It didn't work for you.</h5>";var d=parseInt(f.getElementsByTagName("positiveDelta")[0].firstChild.nodeValue);var g=parseInt(f.getElementsByTagName("negativeDelta")[0].firstChild.nodeValue);var c=parseInt(document.getElementById("thumbsDownVotesCount_"+b.dealId).innerHTML);document.getElementById("thumbsDownVotesCount_"+b.dealId).innerHTML=(c+g);setVotesPosix(c+g,"negVotesS_"+b.dealId);var e=parseInt(document.getElementById("thumbsUpVotesCount_"+b.dealId).innerHTML);document.getElementById("thumbsUpVotesCount_"+b.dealId).innerHTML=(e+d);setVotesPosix(e+d,"posVotesS_"+b.dealId);document.getElementById("thumbsUp_"+b.dealId).innerHTML="<a href=\"javascript:voteThumbsUp('"+b.dealId+'\')" id="thumbsUpAnchor_'+b.dealId+'"><img src="http://cn3.kaboodle.com/ht/img/store/thumbsUpGray.gif?v=r0_56_0_128" id="thumbsUpImg_'+b.dealId+'"></a>';document.getElementById("thumbsDown_"+b.dealId).innerHTML="<a href=\"javascript:voteThumbsDown('"+b.dealId+'\')" id="thumbsDownAnchor_'+b.dealId+'"><img src="http://cn3.kaboodle.com/ht/img/store/thumbsDownGray.gif?v=r0_56_0_128" id="thumbsDownImg_'+b.dealId+'"></a>'}function signinup(a){location.href=a}function fetchandShowComments(b,d){var c=new Object();c.dealId=b;c.p_ret=d;c.action="getComments";var a=new Object();a.dealId=b;formSubmitAJAX("/deal/comments",c,"fetchAndShowCommentsCB",a)}function fetchAndShowCommentsCB(b,a){var c=b.getElementsByTagName("comments");if(c!=null&&c.length>0){document.getElementById("dealComments_"+a.dealId).innerHTML=generateAJAXResponseHTML(c[0].childNodes)}document.getElementById("showComments_"+a.dealId).href="javascript:showElement('dealComments_"+a.dealId+"');"}function deal_ratingCallback(b,g,a,d,h){document.getElementById("dealCommentText_"+d).value="";var f=document.getElementById("addCommentPopupCon_"+d).innerHTML;if(f!=""){var e=document.getElementById("dealVoting_"+d);var c=document.getElementById("addCommentPopupCon_"+d).innerHTML;document.getElementById("addCommentPopupCon_"+d).innerHTML="";showAndReturnPopupAboveRight(e,450,220,c,false,-450,20)}}function resetPopupDiv(a){hideElement("popUpDiv");document.getElementById("addCommentPopupCon_"+a).innerHTML=document.getElementById("popUpContent").innerHTML;document.getElementById("popUpContent").innerHTML=""}function deal_commentAddedCallbackFromPopup(b,c){resetPopupDiv(c);var a=parseInt(document.getElementById("commentCount_"+c).innerHTML);document.getElementById("commentCount_"+c).innerHTML=(a+1);if(a>1){document.getElementById("cmntPosix1_"+c).innerHTML="s"}else{document.getElementById("cmntPosix1_"+c).innerHTML=""}};