.section_heading {position:relative;height:39px;background-color:#000;border:1px solid #888;margin: 1px;} .section_heading > h1 {position:absolute;top:0px;left:0px;font-weight:300; font-style:normal; font-size:25px; line-height:25px;font-family:'Yanone Kaffeesatz','Arial Narrow', Impact,Arial,Helvetica,sans-serif;letter-spacing:1px;width:auto;color:#fff;background-color:#000;padding:7px 12px 0px; max-width: 628px; overflow: hidden; margin:0px;text-transform:uppercase; white-space:nowrap; text-overflow: ellipsis} .section_heading .heading {position:absolute;top:0px;left:0px;font-weight:300; font-style:normal; font-size:25px; line-height:25px;font-family:'Yanone Kaffeesatz','Arial Narrow', Impact,Arial,Helvetica,sans-serif;letter-spacing:1px;width:auto;color:#fff;background-color:#000;padding:7px 12px 0px; max-width: 628px; overflow: hidden; margin:0px;text-transform:uppercase; white-space:nowrap; text-overflow: ellipsis} .section_heading > img { position:absolute;top:29px;left:14px;height:1px;} .section_heading div.facebook-like-cont {background-color: #000000;display: inline-block;position: absolute;right: 0;top: 10px;} .section_heading div.google-plus-cont {display: inline-block;position: absolute;right: 96px;top: 9px;} .section_heading div.user-info{text-align:right;padding-right: 5px;width: 135px;float: right;} .section_heading p {margin: 0 0 0 0;} #email_popup{height:440px;width:410px;text-align:left;} #email_popup .email_container{padding: 10px 22px;} #email_popup p{ font-size: 12px; margin-bottom: 4px; margin-top: 15px;} #email_popup .sample{color: #666;margin-top: 5px;} #email_popup input{border: 1px solid #888888;color: #666;font-size: 12px;font-style: italic;height: 20px;padding-left: 2px;width: 100%;} #email_popup textarea{height: 90px;width: 100%;border: 1px solid #888888; color: #666;} #email_popup .default_button{position:absolute;left:170px;top:400px;} #email_popup .email_container div.email_container_field {position:relative;} TZ.EmailPopup = { setup:function(){ TZ.profile.getAccount(TZ.PUBLIC,function(profile){ var fullName = ''; if (profile.firstName) fullName = profile.firstName; if (profile.lastName) fullName = fullName + ' ' + profile.lastName $('#senderName').tzVal(fullName); }); TZ.profile.getAccount(TZ.PRIVATE,function(profile){ if (profile.email) $('#senderEmail').tzVal(profile.email); }); $('#send_email').click(function(){ if (TZ.EmailPopup.isEmailFormValid() && $(this).buttonEnable()) { //Analytics $('#send_email').data('analytics',{"share":"1","button":"1","s3":"ShareEmailSend"}); Analytics.pageFunction($('#send_email')); $(this).buttonEnable(false); var senderEmail=$('#senderEmail').tzVal(); var receiversMails = new Array(); receiversMails=TZ.email.getRecipients($('#receiversMails').tzVal()); var senderName=$('#senderName').tzVal(); var emailText=$('#emailText').tzVal(); var templateArguments ={"topicId":"set"}; templateArguments.senderName=senderName; templateArguments.senderEmail=senderEmail; templateArguments.emailText=emailText; var subject="USERNAME shared a TAAZ Makeover with you"; subject = subject.replace("USERNAME",senderName); templateArguments.shareUrl=""; var htmlTemplateName="%generated/email/send-makeover-html.erb"; var textTemplateName="%generated/email/send-makeover-text.erb"; var category = "SharedMakeover"; TZ.email.createEmail(senderEmail,receiversMails,subject,templateArguments,htmlTemplateName,textTemplateName, function(a,b,c,d){ //Analytics sent $('#send_email').data('analytics',{"share":"1","button":"1","s3":"ShareEmailComplete"}); Analytics.pageFunction($('#send_email')); DynamicContentLoader.removePopup($("#email_popup")); $('#send_email').buttonEnable(true); TZ.notification.show('EMAIL SENT!','',3000,500); }, function(error){ DynamicContentLoader.removePopup($("#email_popup")); $('#send_email').buttonEnable(true); //JC says: I don't know how to get an email error to happen. so this popup won't be centered until we replace 0,0 with actual width and height DynamicContentLoader.createPopup("errorPopup","error_popup.html",true,0,0); }, category ); } }); TZ.EmailPopup.addGlueData(); }, isEmailFormValid:function(){ return TZ.formValidation.validate($('#email_popup')); }, addGlueData:function(){ $('#senderName input').data("tooltip","Please enter your name"); $('#senderEmail input').data("tooltip",'Please enter your email'); $('#receiversMails input').data("tooltip", "Please enter your friends' emails"); $('#emailText textarea').data("title", "message"); } }; $(function(){ TZ.EmailPopup.setup(); });

EMAIL THIS TO A FRIEND

$(function(){ $('#senderName input').data('title', 'sender name'); $('#senderName input').data('tooltip', ''); //The order of the following code is VERY important, The Hint text need to be set BEFORE to check the Length. TZ.textFields.noHintText( $('#senderName input')); for(i=0; i < 3; i++){ setTimeout(function(){TZ.formValidation.setupValidateLength(50, $('#senderName input'), 'sender name',true)}, i*1500); } }); $(function(){ $('#senderEmail input').data('title', 'sender email'); $('#senderEmail input').data('tooltip', ''); //The order of the following code is VERY important, The Hint text need to be set BEFORE to check the Length. TZ.textFields.noHintText( $('#senderEmail input')); for(i=0; i < 3; i++){ setTimeout(function(){TZ.formValidation.setupValidateLength(50, $('#senderEmail input'), 'sender email',true)}, i*1500); } }); $(function(){ $('#receiversMails input').data('title', 'receivers mails'); $('#receiversMails input').data('tooltip', ''); //The order of the following code is VERY important, The Hint text need to be set BEFORE to check the Length. TZ.textFields.noHintText( $('#receiversMails input')); for(i=0; i < 3; i++){ setTimeout(function(){TZ.formValidation.setupValidateLength(250, $('#receiversMails input'), 'receivers mails',true)}, i*1500); } }); $(function(){ $('#emailText textarea').data('title', ''); TZ.textFields.noHintText( $('#emailText textarea')); for(i=0; i < 3; i++){ setTimeout(function(){TZ.formValidation.setupValidateLength(450, $('#emailText textarea'), '',true)}, i*1500); } }); $(function(){ $('#email_popuppopup_close_button, #modalPopupMask').live('click',function(){ TZ.popupHandler.showOverlapStuff(); DynamicContentLoader.removePopup($("#email_popup")); }); var undefined; var firstInput = $('.basePopUp').find('input:visible')[0]; if (firstInput) { firstInput.focus(); firstInput.select(); // does nothing if field is empty (the usual case) } });