var ratingObjects=new Array();var userLoggedIn=false;var signinupflow=false;function EntityRating(l,j,d,g,f,b,c,m,h,a,e,k){userLoggedIn=c;this.parentId=j;this.originalRating=d;this.rating=d;this.entityId=g;this.entityType=f;this.uniqueId=l;this.callbackFunction=b;this.ratingId=m;this.pid=h;this.blogId=e;this.imageSize=k;this.loadPageForNLI=(a==""?null:a);ratingObjects[l]=this;this.changeDisplay=function(n){if(n==1){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-voted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1-pressed.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3.gif?v=r0_56_0_128"}else{if(n==2){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-voted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2-pressed.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3.gif?v=r0_56_0_128"}else{if(n==3){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-voted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3-pressed.gif?v=r0_56_0_128"}else{var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1.gif?v=r0_56_0_128";var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2.gif?v=r0_56_0_128";var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3.gif?v=r0_56_0_128"}}}};this.changeDisplayOnMouseOver=function(n){if(n==1){var q=document.getElementById("item"+this.uniqueId+"_rateImg1");q.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/like-hover.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-1-pressed.gif?v=r0_56_0_128"}else{if(n==2){var p=document.getElementById("item"+this.uniqueId+"_rateImg2");p.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/love-hover.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-2-pressed.gif?v=r0_56_0_128"}else{if(n==3){var o=document.getElementById("item"+this.uniqueId+"_rateImg3");o.src=this.imageSize=="large"?"http://cn3.kaboodle.com/ht/img/contest/adore-hover.gif":"http://cn3.kaboodle.com/ht/img/entityRater/hcount-sm-3-pressed.gif?v=r0_56_0_128"}}}};this.setRateIndex=function(n){this.rating=n;this.changeDisplay(this.rating)};this.submitRating=function(){var o=new Object();o.entityId=this.entityId;o.entityType=this.entityType;o.userRating=this.rating;o.ratingId=this.ratingId;o.pid=this.pid;o.blogId=this.blogId;o.oldRating=this.originalRating;var n=new Object();n.uniqueId=this.uniqueId;n.callbackFn=this.callbackFn;n.rating=this.rating;n.entityId=o.entityId;formSubmitAJAX("/za/entityRating",o,"entityRatingCB",n)};this.reinitialize=function(n){this.originalRating=n;this.rating=n;this.changeDisplay(this.rating)}}function ratingsObj_onmouseover(c,b){var a=ratingObjects[c];if(a){a.changeDisplayOnMouseOver(b)}}function ratingsObj_onmouseout(c,b){var a=ratingObjects[c];a.changeDisplay(a.rating)}function ratingsObj_onclick(c,b){var a=ratingObjects[c];if(userLoggedIn){a.setRateIndex(b);a.submitRating()}else{if(a.loadPageForNLI!=null){location.href=a.loadPageForNLI}}}function entityRatingCB(results,callbackParams){if(signinupflow){location.reload()}var loginStatus=results.getElementsByTagName("isUserLoggedIn")[0].firstChild.nodeValue;var rObj=ratingObjects[callbackParams.uniqueId];if(loginStatus=="false"||!loginStatus){userLoggedIn=false;rObj.reinitialize(0);rObj.ratingId="";ratingsObj_onclick(callbackParams.uniqueId,callbackParams.rating)}else{var rating=results.getElementsByTagName("rating")[0].firstChild.nodeValue;var totalRating=results.getElementsByTagName("totalRating")[0].firstChild.nodeValue;var totalAggregate=results.getElementsByTagName("totalAggregate")[0].firstChild;if(totalAggregate){totalAggregate=totalAggregate.nodeValue}else{totalAggregate=null}if(results.getElementsByTagName("ratingId")[0].firstChild){rObj.ratingId=results.getElementsByTagName("ratingId")[0].firstChild.nodeValue}rObj.reinitialize(rating);if(document.getElementById("heart_"+callbackParams.uniqueId)){document.getElementById("heart_"+callbackParams.uniqueId).innerHTML=totalRating}if(document.getElementById("bts_heart_"+callbackParams.uniqueId)){document.getElementById("bts_heart_"+callbackParams.uniqueId).innerHTML=totalRating}var ratingText=document.getElementById("ratingText");if(ratingText){ratingText.innerHTML="Thanks!"}if(rObj.callbackFunction){eval(rObj.callbackFunction)(rating,totalRating,totalAggregate,callbackParams.entityId,callbackParams.uniqueId)}}}function initEntityRater(l,j,d,g,f,b,c,m,h,a,e,k){var n=ratingObjects[l];if(!n){new EntityRating(l,j,d,g,f,b,c,m,h,a,e,k)}}function changeNonAjaxDisplay(a,e){if(a==1){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-voted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif?v=r0_56_0_128"}else{if(a==2){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-voted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif?v=r0_56_0_128"}else{if(a==3){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-voted.gif?v=r0_56_0_128"}else{var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-unvoted.gif?v=r0_56_0_128";var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-unvoted.gif?v=r0_56_0_128";var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-unvoted.gif?v=r0_56_0_128"}}}}function changeNonAjaxDisplayOnMouseOver(a,e){if(a==1){var d=document.getElementById("item"+e+"_rateImg1");d.src="http://cn3.kaboodle.com/ht/img/contest/like-hover.gif?v=r0_56_0_128"}else{if(a==2){var c=document.getElementById("item"+e+"_rateImg2");c.src="http://cn3.kaboodle.com/ht/img/contest/love-hover.gif?v=r0_56_0_128"}else{if(a==3){var b=document.getElementById("item"+e+"_rateImg3");b.src="http://cn3.kaboodle.com/ht/img/contest/adore-hover.gif?v=r0_56_0_128"}}}}function rateItem(b,d){changeNonAjaxDisplay(b,d);for(i=1;i<=3;i++){var a=document.getElementById("item"+d+"_rateImg"+i);a.onmouseout=function(){changeNonAjaxDisplay(b,d)}}var c=document.getElementById("userHearts");c.value=b};