function sendCompliment(recipientId,assocObjId,assocRefType)
{var message=escape(trim(document.getElementById('compliment_message').value));if(message.length>=3)
{var complimentSelections=document.getElementsByName('compliment_type');var complimentType=-1;for(var j=0;j<complimentSelections.length;++j){if(complimentSelections[j].checked){complimentType=complimentSelections[j].value;break;}}
if(complimentType>-1){var url="/SendCompliment.do";var pars="recipientId="+recipientId;pars+="&complimentType="+complimentType+"&assocObjId="+assocObjId+"&assocRefType="+assocRefType+"&message="+message;ajaxUpdateDiv(url,pars,'get','compliment_status');hide('compliment_content');showInline('compliment_status');}}
else{alert('Please enter at least 3 characters in the compliment message.');}}
function showSelectedCompliments(complimentsToShow,complimentsToSelectDefault){var compliments=complimentsToShow.split(',');var complimentSelections=document.getElementsByName('compliment_type');for(var j=0;j<complimentSelections.length;++j){var bFound=false;for(var i=0;i<compliments.length;++i){if(complimentSelections[j].value==compliments[i]){bFound=true;break;}}
if(bFound){showBlock('compliment_selection_'+complimentSelections[j].value);if(complimentSelections[j].value==complimentsToSelectDefault){complimentSelections[j].checked=true;}}
else{document.getElementById('compliment_'+complimentSelections[j].value).disabled=true;hide('compliment_enabled_'+complimentSelections[j].value);showInline('compliment_disabled_'+complimentSelections[j].value);}}}
function showComplimentsPopup(recipientId,recipientNick,complimentsToShow,complimentsToSelectDefault,assocObjId,assocRefType){var win=new Window('compliments_win_'+Math.random(),{className:"askv_cube",title:"Send Compliment",width:430,height:300,minimizable:false,maximizable:false,resizable:true,url:"/SendCompliment.do?recipientId="+recipientId+"&recipientNick="+recipientNick+"&complimentsToShow="+complimentsToShow+"&complimentsToSelectDefault="+complimentsToSelectDefault+"&assocObjId="+assocObjId+"&assocRefType="+assocRefType,hideEffectOptions:{duration:0.5},showEffectOptions:{duration:0.5}});win.setDestroyOnClose();win.toFront();win.showCenter(true);}
function showComplimentSignInMessage(uniqueId){showBlock('compliment_signin_'+uniqueId);}
function showComplimentVerifyMessage(uniqueId){showBlock('compliment_verify_account_'+uniqueId);}