Advertisement
Guest User

Untitled

a guest
Jul 9th, 2011
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.58 KB | None | 0 0
  1. <!-- Begin MailChimp Signup Form -->
  2. <!--[if IE]>
  3. <style type="text/css" media="screen">
  4. #mc_embed_signup fieldset {position: relative;}
  5. #mc_embed_signup legend {position: absolute; top: -1em; left: .2em;}
  6. </style>
  7. <![endif]-->
  8. <!--[if IE 7]>
  9. <style type="text/css" media="screen">
  10. .mc-field-group {overflow:visible;}
  11. </style>
  12. <![endif]-->
  13.  
  14. <div id="mc_embed_signup" style="position: absolute;top: 0;left: 0;width: 100%;height: 100%;background-color: rgba(0,0,0,.8);display: none;z-index: 10000;">
  15. <form action="http://freshem.us2.list-manage.com/subscribe/post?u=1474317e7df9e9ea69c64288f&amp;id=e14af45423" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" style="position: fixed;top: 10%;left: 50%;width: 50%;margin-left: -25%;font: normal 100% Arial, sans-serif;font-size: 10px;">
  16. <fieldset style="-moz-border-radius: 4px;border-radius: 4px;-webkit-border-radius: 4px;border: 1px solid #ccc;padding-top: 1.5em;margin: .5em 0;background-color: #000000;color: #ffffff;text-align: left;">
  17. <legend style="white-space: normal;text-transform: capitalize;font-weight: bold;color: #000;background: #fff;padding: .5em 1em;border: 1px solid #1px solid #ccc_COLOR;-moz-border-radius: 4px;border-radius: 4px;-webkit-border-radius: 4px;font-size: 1.2em;"><span>join my free newsletter</span></legend>
  18. <div class="mc-field-group" style="margin: 0 5% 0 5%;padding: 2px 0;clear: both;overflow: hidden;">
  19. <label for="mce-EMAIL" style="display: block;margin: 15px 0 .3em 0;font-weight: bold;">Email Address </label>
  20. <input type="text" value="" name="EMAIL" class="required email" id="mce-EMAIL" style="margin-right: 1.5em;padding: .2em .3em;width: 90%;float: left;z-index: 999;">
  21. </div>
  22. <div id="mce-responses" style="float: left;top: -1.4em;padding: 0em .5em 0em .5em;overflow: hidden;width: 90%;margin: 0 5%;clear: both;">
  23. <div class="response" id="mce-error-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: FBE3E4;color: #D12F19;"></div>
  24. <div class="response" id="mce-success-response" style="display: none;margin: 1em 0;padding: 1em .5em .5em 0;font-weight: bold;float: left;top: -1.5em;z-index: 1;width: 80%;background: #E3FBE4;color: #529214;"></div>
  25. </div>
  26. <div><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn" style="clear: both;margin: 1em 0 1em 5%;width: auto;display: block;"></div>
  27. </fieldset>
  28. <a href="#" id="mc_embed_close" class="mc_embed_close" style="background: transparent url(http://downloads.mailchimp.com/img/closebox.png) no-repeat;display: none;height: 30px;width: 30px;text-indent: -999em;position: absolute;top: 10px;right: -10px;">Close</a>
  29. </form>
  30. </div>
  31. <script type="text/javascript">
  32. var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';
  33. try {
  34. var jqueryLoaded=jQuery;
  35. jqueryLoaded=true;
  36. } catch(err) {
  37. var jqueryLoaded=false;
  38. }
  39. var head= document.getElementsByTagName('head')[0];
  40. if (!jqueryLoaded) {
  41. var script = document.createElement('script');
  42. script.type = 'text/javascript';
  43. script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
  44. head.appendChild(script);
  45. if (script.readyState && script.onload!==null){
  46. script.onreadystatechange= function () {
  47. if (this.readyState == 'complete') mce_preload_check();
  48. }
  49. }
  50. }
  51. var script = document.createElement('script');
  52. script.type = 'text/javascript';
  53. script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
  54. head.appendChild(script);
  55. var err_style = '';
  56. try{
  57. err_style = mc_custom_error_style;
  58. } catch(e){
  59. err_style = 'margin: 1em 0 0 0; padding: 1em 0.5em 0.5em 0.5em; background: FFEEEE none repeat scroll 0% 0%; font-weight: bold; float: left; z-index: 1; width: 80%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: FF0000;';
  60. }
  61. var head= document.getElementsByTagName('head')[0];
  62. var style= document.createElement('style');
  63. style.type= 'text/css';
  64. if (style.styleSheet) {
  65. style.styleSheet.cssText = '.mce_inline_error {' + err_style + '}';
  66. } else {
  67. style.appendChild(document.createTextNode('.mce_inline_error {' + err_style + '}'));
  68. }
  69. head.appendChild(style);
  70. setTimeout('mce_preload_check();', 250);
  71.  
  72. var mce_preload_checks = 0;
  73. function mce_preload_check(){
  74. if (mce_preload_checks>40) return;
  75. mce_preload_checks++;
  76. try {
  77. var jqueryLoaded=jQuery;
  78. } catch(err) {
  79. setTimeout('mce_preload_check();', 250);
  80. return;
  81. }
  82. try {
  83. var validatorLoaded=jQuery("#fake-form").validate({});
  84. } catch(err) {
  85. setTimeout('mce_preload_check();', 250);
  86. return;
  87. }
  88. mce_init_form();
  89. }
  90. function mce_init_form(){
  91. jQuery(document).ready( function($) {
  92. var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){} };
  93. var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
  94. $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
  95. options = { url: 'http://freshem.us2.list-manage.com/subscribe/post-json?u=1474317e7df9e9ea69c64288f&id=e14af45423&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
  96. beforeSubmit: function(){
  97. $('#mce_tmp_error_msg').remove();
  98. $('.datefield','#mc_embed_signup').each(
  99. function(){
  100. var txt = 'filled';
  101. var fields = new Array();
  102. var i = 0;
  103. $(':text', this).each(
  104. function(){
  105. fields[i] = this;
  106. i++;
  107. });
  108. $(':hidden', this).each(
  109. function(){
  110. if (fields.length == 2) fields[2] = {'value':1970};//trick birthdays into having years
  111. if ( fields[0].value=='MM' && fields[1].value=='DD' && fields[2].value=='YYYY' ){
  112. this.value = '';
  113. } else if ( fields[0].value=='' && fields[1].value=='' && fields[2].value=='' ){
  114. this.value = '';
  115. } else {
  116. this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
  117. }
  118. });
  119. });
  120. return mce_validator.form();
  121. },
  122. success: mce_success_cb
  123. };
  124. $('#mc-embedded-subscribe-form').ajaxForm(options);
  125. $('#mc_embed_signup').hide();
  126. cks = document.cookie.split( ';' );
  127. var show=true;
  128. for(i=0;i<cks.length;i++){
  129. parts = cks[i].split('=');
  130. if( parts[0].indexOf('MCEvilPopupClosed')!= -1 ) show = false;
  131. }
  132. if (show){
  133. $('#mc_embed_signup a.mc_embed_close').show();
  134. setTimeout( function(){ $('#mc_embed_signup').fadeIn();} , 4000);
  135. $('#mc_embed_signup a.mc_embed_close').click(function(){ mcEvilPopupClose();});
  136. }
  137.  
  138. $(document).keydown(function(e){
  139. if (e == null) {
  140. keycode = event.keyCode;
  141. } else {
  142. keycode = e.which;
  143. }
  144. if(keycode == 27){
  145. mcEvilPopupClose();
  146. }
  147. });
  148.  
  149. function mcEvilPopupClose(){
  150. $('#mc_embed_signup').hide();
  151. var now = new Date();
  152. var expires_date = new Date( now.getTime() + 31536000000 );
  153. document.cookie = 'MCEvilPopupClosed=yes;expires=' + expires_date.toGMTString()+';path=/';
  154. }
  155.  
  156. });
  157. }
  158. function mce_success_cb(resp){
  159. $('#mce-success-response').hide();
  160. $('#mce-error-response').hide();
  161. if (resp.result=="success"){
  162. $('#mce-'+resp.result+'-response').show();
  163. $('#mce-'+resp.result+'-response').html(resp.msg);
  164. $('#mc-embedded-subscribe-form').each(function(){
  165. this.reset();
  166. });
  167. } else {
  168. var index = -1;
  169. var msg;
  170. try {
  171. var parts = resp.msg.split(' - ',2);
  172. if (parts[1]==undefined){
  173. msg = resp.msg;
  174. } else {
  175. i = parseInt(parts[0]);
  176. if (i.toString() == parts[0]){
  177. index = parts[0];
  178. msg = parts[1];
  179. } else {
  180. index = -1;
  181. msg = resp.msg;
  182. }
  183. }
  184. } catch(e){
  185. index = -1;
  186. msg = resp.msg;
  187. }
  188. try{
  189. if (index== -1){
  190. $('#mce-'+resp.result+'-response').show();
  191. $('#mce-'+resp.result+'-response').html(msg);
  192. } else {
  193. err_id = 'mce_tmp_error_msg';
  194. html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
  195.  
  196. var input_id = '#mc_embed_signup';
  197. var f = $(input_id);
  198. if (ftypes[index]=='address'){
  199. input_id = '#mce-'+fnames[index]+'-addr1';
  200. f = $(input_id).parent().parent().get(0);
  201. } else if (ftypes[index]=='date'){
  202. input_id = '#mce-'+fnames[index]+'-month';
  203. f = $(input_id).parent().parent().get(0);
  204. } else {
  205. input_id = '#mce-'+fnames[index];
  206. f = $().parent(input_id).get(0);
  207. }
  208. if (f){
  209. $(f).append(html);
  210. $(input_id).focus();
  211. } else {
  212. $('#mce-'+resp.result+'-response').show();
  213. $('#mce-'+resp.result+'-response').html(msg);
  214. }
  215. }
  216. } catch(e){
  217. $('#mce-'+resp.result+'-response').show();
  218. $('#mce-'+resp.result+'-response').html(msg);
  219. }
  220. }
  221. }
  222.  
  223. </script>
  224. <!--End mc_embed_signup-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement