
function sendToFriend(data)
{TCI.serviceForm.deploy('#send_uri_to_friend_form_container',Scion.globals.contextPath+'/templates/forms/send_uri_to_friend.html',data.form);new TCI.FormElementManager().setCheckBox('#send_uri_to_friend_form_container').setTextArea().setTextArea();$('textarea').elastic();$('#cr_sf_email_address').val(TCI.serviceForm.removeBrandPrefix(TCI.Globals.loginId||''));$('#cr_sf_email_address_confirmation').val(TCI.serviceForm.removeBrandPrefix(TCI.Globals.loginId||''));jQuery('#'+data.form.submitButtonId).click(function()
{$('#cr_sf_tci_user_id').val(TCI.Utils.getTCIUserId());var isValid=TCI.serviceForm.validate(data.form);if(isValid){TCI.serviceForm.lockForm();var postData=JSON.stringify(data.get_request_JSON(document.forms[data.form.id]));var postUrl=TCI.Utils.getGetConsumerRequestURL();TCI.Log.debug(postData);TCI.ajax.postJSON(postUrl,postData,function(){$('#send_uri_to_friend_form_container').prepend('<div class="success-notice-from-server"><span></span>'+TCI.localize.getLabel('msg_share_with_friend_thanks')+'</div>');$('#send_uri_to_friend_form_container form').hide();Scion.Analytics.trackEvent({category:'social media',action:'share',label:'share_email',value:false});TCI.serviceForm.unlockForm();},function(){$('#send_uri_to_friend_form_container .form_error_panel').html('<div class="error-notice-from-server"><span></span>'+TCI.localize.getLabel('general_error_message')+'</div>');TCI.serviceForm.unlockForm();});}
return false;});}
