function dumbLog(b){var a=$("#dumb-log");if(a.length===0){a=$('<div id="dumb-log" style="padding: 2px 4px; z-index: 1000; position: fixed; top: 20; left: 0; color: #005; font-size: 9px; background-color: #ddf; width: 500px;"></div>');$("body").append(a);a.prepend('<a href="#" class="clear" style="float:right;"> &nbsp; &nbsp; [X]</a>');a.find("a.clear").click(function(){$(this).parent().remove()})}a.append(b+"<br/>")}if(typeof(console)=="undefined"){try{console={log:function(a){dumbLog(a)}}}catch(e){}}function displayLocationForm(a){$("#Type").val(a);if(a===0){$("#divWebInfo").css("display","none");return}if(a===1){$("#divWebInfo").css("display","none");return}if(a===2){$("#divWebInfo").css("display","none");return}if(a===3){$("#divWebInfo").css("display","block");$("#labelLinkedIn").show();$("#labelWebsite").hide();$("#linkedInDetails").css("display","block");$("#websiteDetails").css("display","none");$("html,body").animate({scrollTop:$("#divWebInfo").offset().top-70},250);return}if(a===4){$("#divWebInfo").css("display","block");$("#labelLinkedIn").hide();$("#labelWebsite").show();$("#linkedInDetails").css("display","none");$("#websiteDetails").css("display","block");$("html,body").animate({scrollTop:$("#divWebInfo").offset().top-70},250);return}}function togglePreviousName(){if($("#NameChanged")[0].checked){$("#previousNameFields").show()}else{$("#previousNameFields").hide()}}function togglePreviousAddress(){if($("#MovedRecently")[0].checked){$("#previousAddressFields").show()}else{$("#previousAddressFields").hide()}}function twitterConnect(a){window.open(a,"twcWindow","width=800,height=400,left=150,top=100,scrollbar=no,resize=no");return false}function ebayConnect(a){window.open(a,"ebcWindow","width=800,height=400,left=150,top=100");return false}function submitAccountCreateForm(a){$("#nextButton").attr("disabled","disabled");setTimeout(function(){$("#frmPaymentCreate").submit()},50);return false}function submitVerificationCreateForm(){$("#buttonNext").attr("disabled","disabled");setTimeout(function(){$("#new-user-verification-form").submit()},50);return false}function submitVerificationCreateAddressForm(){$("#nextButton").attr("disabled","disabled");setTimeout(function(){$("#new-user-verification-form").submit()},50);return false}function submitVerificationCreateSpecialForm(){$("#nextButton").attr("disabled","disabled");setTimeout(function(){$("#new-user-verification-form").submit()},50);return false}function submitIdentityQuestionsAnswerForm(){$("#submitButton").attr("disabled","disabled");setTimeout(function(){$("#answer-questions-form").submit()},50);return false}function togglePaymentMethod(){var a=$("#couponCode");var b=$("#creditCard");if($("#PaymentMethodCoupon").is(":checked")){$("#CouponCode").attr("tabindex",11);$("#CardNo").attr("tabindex",90);$("#ExpYear").attr("tabindex",91);$("#ExpMonth").attr("tabindex",92);$("#VerificationCode").attr("tabindex",93);$("#CardType").attr("tabindex",94);$("#AgreedToTerms").attr("tabindex",12);a.show();b.hide()}else{if($("#PaymentMethodPayPal").is(":checked")){$("#CouponCode").attr("tabindex",95);$("#CardNo").attr("tabindex",90);$("#ExpYear").attr("tabindex",91);$("#ExpMonth").attr("tabindex",92);$("#VerificationCode").attr("tabindex",93);$("#CardType").attr("tabindex",94);$("#AgreedToTerms").attr("tabindex",11);a.hide();b.hide()}else{$("#CouponCode").attr("tabindex",99);$("#CardNo").attr("tabindex",11);$("#ExpMonth").attr("tabindex",12);$("#ExpYear").attr("tabindex",13);$("#VerificationCode").attr("tabindex",15);$("#CardType").attr("tabindex",14);$("#AgreedToTerms").attr("tabindex",16);a.hide();b.show()}}}function toggleMoreInfo(d){var a=$(d);a.blur();var b=a.closest("tr");var c=b.find(".info-box");if(c.length===0){return}if(c.is(":visible")){c.hide();a.text("(more info)")}else{c.show();a.text("(hide info)")}}function hideProfileEditWidgets(){$(".profile-sidebar .edit-widget").hide();$(".profile-sidebar .edit-widget-swap").show();$("a.profile-edit-toggle").text("Edit")}function showProfileEditWidgets(){$(".profile-sidebar .edit-widget").show();$(".profile-sidebar .edit-widget-swap").hide();$("a.profile-edit-toggle").text("View")}function updateProfileEditWidgets(b){var a=$("a.profile-edit-toggle");if(typeof(b)==="undefined"){if(a.length>0){if(a.text()==="Edit"){showProfileEditWidgets()}else{hideProfileEditWidgets()}}}else{if(b){showProfileEditWidgets()}else{hideProfileEditWidgets()}}}function hideWebEditWidgets(){$("a.web-edit-toggle").hide()}function showWebEditWidgets(){$("a.web-edit-toggle").show()}function updateWebEditWidgets(a){if(a){showWebEditWidgets()}else{hideWebEditWidgets()}}function toggleAddForm(){if($("#divAdd").is(":hidden")){$("#divAdd").show();$("#addButton").hide()}else{$("#divAdd").hide();$("#addButton").show()}}function togglePaymentForm(){if($("#divPayment").is(":hidden")){$("#divPayment").show();togglePaymentMethod()}else{$("#divPayment").hide()}}function updateSecurityQuestionForm(){var a=$("#ChangeSecurityQuestion");if(a.is(":checked")){$("#divChangeSecurityQuestion").show()}else{$("#divChangeSecurityQuestion").hide()}}function initWebsiteList(){showTopWebsites()}function showTopWebsites(){var b=$("#hidden-websites");if(b.length===1){var d=$("#visible-websites");var c=d.metadata().initialSiteCount-1;var a=d.find("tr:gt("+c+")");a.appendTo(b.find("tbody"));$("#show-more-prompt").show();$("#show-less-prompt").hide()}cleanupTableStyle()}function showAllWebsites(){var a=$("#hidden-websites");if(a.length===1){var b=$("#visible-websites");a.find("td").show();a.find("tr").appendTo(b.find("tbody"));$("#show-more-prompt").hide();$("#show-less-prompt").show()}cleanupTableStyle()}function cleanupTableStyle(){var a=$(".profile-main table");a.find("td").removeAttr("style");a.find("tr:last td").css("border-bottom","none")}function contentPolicyHelp(b){var a=$(".cpHelpTrigger");if(a.length===0){return}if($("a.cpHelpToggle").eq(0).text().indexOf("Tips")>0){var c="All Tips"}else{var c="All Answers"}if(b=="INIT"){a.each(function(){var f=$(this);var d=$("#"+f.attr("rel"));var h=$("#"+f.attr("rel")+"-hint");var g=d.find(".close");f.unbind("click").click(function(){f.blur();if(d.css("display")=="none"){$(".small-info-panel").find(".close").trigger("click");d.show();h.hide()}else{d.hide();h.show()}return false});g.unbind("click").click(function(){d.hide();d.prev().hide().show();h.show()})});$("a.cpHelpToggle").eq(0).unbind("click").click(function(){contentPolicyHelp("SHOWALL")})}if(b=="SHOWALL"){a.each(function(){var f=$(this);var d=$("#"+f.attr("rel"));d.show()});$("a.cpHelpToggle").eq(0).blur().unbind("click").click(function(){contentPolicyHelp("CLOSEALL")}).text("Hide "+c)}if(b=="CLOSEALL"){a.each(function(){var f=$(this);var d=$("#"+f.attr("rel"));d.hide()});$("a.cpHelpToggle").eq(0).blur().unbind("click").click(function(){contentPolicyHelp("SHOWALL")}).text("Show "+c)}}$(document).ready(function(){contentPolicyHelp("INIT")});function compareFields(b,a){if($(b).val()==$(a).val()){return true}else{return false}}function fieldCompare(f,d){var c=f;var a=d;if($(a).next().is("span.fieldCompare")){return false}$(a).after('<span class="fieldCompare"><div class="match">&nbsp;</div></span>');var b=true;$(a).keyup(function(){if(b){b=false}if($(a).val()===""){$(a).next().html('<div class="nomatch">no match</div>')}else{if(compareFields(c,a)){$(a).next().html('<div class="match">match</div>')}else{$(a).next().html('<div class="nomatch">no match</div>')}}});$(c).keyup(function(){if(b){b=false}if($(a).val()===""){$(a).next().html('<div class="match">&nbsp;</div>')}else{if(compareFields(c,a)){$(a).next().html('<div class="match">match</div>')}else{$(a).next().html('<div class="nomatch">no match</div>')}}})}function formatEmailAddresses(){$(".email").each(function(){var b=$(this);var a=b.text().replace(/\^/g,"@").replace(/\|/g,".");b.text(a);if(b.attr("href")!=undefined){b.attr("href","mailto:"+a)}})}function limitCharCount(h,c,i){var g=$(h);if(g.length==0||g.next().find("#counterLength").length>0){return}var d="font-size:11px; margin-top: -3px;";if(typeof(i)=="string"){d=d+"; "+i}var b=$('<div class="counterLengthParent" style="'+d+'"><span id="counterLength">'+c+"</span> characters remaining.</div>");var a=function(){var k=g.val();var f=g.parent().find(".counterLengthParent");if(k===g.attr("rel")){f.hide();return}else{f.show()}var j=c-k.length;if(k.length>c){k=k.split("",c);k=k.join("");g.animate({scrollTop:g[0].scrollHeight});g.val(k)}if(j<1){j=0}f.find("#counterLength").html(j);f.css("color",(j===0)?"#f00":"")};g.after(b);g.unbind("change").change(a);g.unbind("keyup").keyup(function(){a();g.trigger("autoBuild")});a()}function bindSpinButtons(){$(".spin-button").unbind("click").bind("click",function(){var b=$(this);$("#hidden-spinner").show();var a=b.attr("href");if(typeof(a)=="string"){setTimeout(function(){window.location=a},100);return false}return true})}function toggleCopyright(d){var b=$(d);b.blur();var a=$("#copyright-display");if(a.is(":visible")){a.hide()}else{var c=$("#trademark-display");c.hide();a.show();a.unbind("click").click(toggleCopyright)}}function toggleTrademark(d){var b=$(d);b.blur();var c=$("#trademark-display");if(c.is(":visible")){c.hide()}else{var a=$("#copyright-display");a.hide();c.show();c.unbind("click").click(toggleTrademark)}}function bindStateAndCountryFields(){$("#Country, #PreviousCountry, #CardCountry").unbind("change").change(function(){var b=$(this);var c;var d;var a;switch(b.attr("name")){case"PreviousCountry":c=$("#PreviousState-US-only");d=$("#PreviousState-editable");a="PreviousState";break;case"CardCountry":c=$("#CardState-US-only");d=$("#CardState-editable");a="CardState";break;default:c=$("#State-US-only");d=$("#State-editable");a="State"}if(b.val()==="United States"){d.attr("name","UNUSED_"+a).hide();c.attr("name",a).show()}else{c.attr("name","UNUSED_"+a).hide();d.attr("name",a).show()}}).change()}function initRoundedCorners(){var a={tl:{radius:10},tr:{radius:10},bl:{radius:10},br:{radius:10},antiAlias:true};if(typeof(curvyCorners)==="function"){curvyCorners(a,".rounded")}}function showStatusMessage(c,a){var d=$(".status-message");if(typeof(c)==="string"){d.html(c)}d.slideDown("slow");var b;switch(a){case"sticky":b=10000000;break;case"sticky+close":b=10000;d.prepend('<a href="#" onclick="hideStatusMessage(); return false;" style="float: right; padding-right: 12px; font-size: 13px;">Close</a>');break;default:b=3000;break}setTimeout(hideStatusMessage,b)}function hideStatusMessage(){var a=$(".status-message");a.slideUp("slow")}function showMessageAndJump(a,b){showStatusMessage(a,"sticky");setTimeout(function(){window.location=b},1500)}function fixUpExternalURL(b){var a=$.trim(b);var c=new RegExp("^[a-zA-Z]+://");if(!c.test(a)){a=("http://"+a)}return a}function isNonEmptyString(a){if(typeof a!=="string"){return false}a=$.trim(a);if(a===""){return false}return true}function isValidWebsiteName(a){return isNonEmptyString(a)}function isValidURL(a){a=$.trim(a);switch(a){case"":case"http://":case"https://":return false}return true}function markInvalidField(b){b.addClass("input-validation-error");var a=b.nextAll(".field-validation-error, .field-required-marker");a.removeClass("field-required-marker").addClass("field-validation-error")}function clearInvalidField(b){b.removeClass("input-validation-error");var a=b.nextAll(".field-validation-error, .field-required-marker");a.removeClass("field-validation-error").addClass("field-required-marker")}var tutWindow;function showTutorial(a){tutWindow=window.open("/help/tutorial?tutorialid="+a,"tutorial","resizable=yes,scrollbars=yes,alwaysRaised=yes",true)}function hideTutorial(){titWindow.close()}function toggleChangePayPalInfo(){if($("#ChangePayPal")[0].checked){$(".changePayPalField").show()}else{$(".changePayPalField").hide()}}function blockPasteIntoFields(b){$fields=$(b);function c(d){$field=$(d);$field.attr("oldValue",$field.val())}function a(g){$field=$(g);var d=$field.attr("oldValue");if(typeof(d)=="undefined"){return}var f=$field.val();if((f.length-d.length)>1){$field.val(d)}}$fields.unbind("keydown",c).bind("keydown",c);$fields.unbind("keyup",a).bind("keyup",a);$fields.unbind("mousedown",c).bind("mousedown",c);$fields.unbind("mouseup",a).bind("mouseup",a)};