Advertisement
Guest User

20141030 Captcha

a guest
Oct 30th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try {
  2.     if(typeof jQuery === 'function') {
  3.         jQuery(function($) {
  4.             function refreshCP() {
  5.                 rndId = Math.floor((Math.random() * 999) + 100);
  6.                 $("#CaptchaImage").attr('src', 'Captcha.ashx?w=200&h=60&id=' + rndId + '&sid=1&t=045642');
  7.                 return false;
  8.             }
  9.             if(typeof jQuery === 'function') {
  10.                 $(function() {
  11.                     $("#pbtnRegisterCS").before('<div style="clear: both; font: normal 12px/1.2em Arial;"><table cellpadding="0" cellspacing="0" style="border-spacing: 2px; border-collapse: initial; margin-top: 10px;"><tr><td colspan="2"><div id="CaptchaPanel"><label for="CaptchaImage" id="CaptchaImageLabel" style="font-weight: bold;">Verification Number:</label><br><img id="CaptchaImage" style="height: 60px; width: 200px; border-width: 0px; margin-right: 3px;"><input type="image" name="ChangeImageLink" id="ChangeImageLink" class="btncptChange" src="images/refresh_icon.gif" style="border-width: 0px;vertical-align: top;"></div></td></tr><tr id="trCaptchaField" style="padding-top: 5px;"><th class="rowHeader" align="left"><label for="CaptchaInput" id="CaptchaInputLabel">Type in the number<br>you see in the image:</label></th><td><input name="CaptchaInput" type="text" id="CaptchaInput" tabindex="4" style="width: 80px; margin-right: 3px;"><span id="CaptchaRequired" title="You must enter the number in the image." style="color: Red; display: none;">*</span><span id="ctl04" style="color: Red;">*</span></td></tr></table></div>');
  12.                     $("#ctl00_ctl00_wpm_gwpPageContent_PageContent_Login_ctl03_RegisterButton").attr('onclick', '').click(function() {
  13.                         var value = $("#CaptchaInput").val() == rndId;
  14.                         if(!value) {
  15.                             $("#CaptchaInput").addClass('ui-state-error');
  16.                         } else {
  17.                             $("#CaptchaInput").removeClass('ui-state-error');
  18.                             if(!ShowError()) {
  19.                                 WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$wpm$gwpPageContent$PageContent$Login$ctl03$RegisterButton", "", true, "Register", "", false, false));
  20.                             }
  21.                         }
  22.                         return value;
  23.                     });
  24.                     $("#ChangeImageLink").click(function(e) {
  25.                         e.preventDefault();
  26.                         return refreshCP();
  27.                     });
  28.                     $("#returnCustomers, #newCustomers").height(340);
  29.                     $("#pbtnRegisterCS").attr('align', 'left');
  30.                     $("#srhBarData").css({"display": "none","visibility": ""});
  31.                     $(".brkVrtLn").css({"display": "none","visibility": ""});
  32.                     $("#searchspringHomeSearch").css({"width": "805px"});
  33.                     $("#srhTxtTop").css({"width": "805px"});
  34.                     $("#ctl00_ctl00_wpm_gwpPageContent_PageContent_Login_ctl02_trRememberMe").insertAfter($('[id*="LoginButton"]')).css('margin-top', '20px');
  35.                     $(".newCustomer > div:eq(3)").insertAfter($('[id*="RegisterButton"]')).css('margin-top', '20px');
  36.                     $("#ctl00_ctl00_wpm_gwpPageContent_PageContent_Login_ctl02_LoginPanel > p").css({"margin-top": "0px"});
  37.                     refreshCP();
  38.                 });
  39.             }
  40.         });
  41.     }
  42. } catch(ex) {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement