var currpage=JQ.getQueryString({ID:"page"});var current_form=null;var useNSLActivities=true;function setUpClickToEditFields(){JQ("p.editable").each(function(){JQ(this).hover(function(){JQ(this).addClass("hovered");JQ(this).append(UPM.clickTextSpan)},function(){JQ(this).removeClass("hovered");JQ(this).find(".clickTextSpan").remove()}).click(function(){JQ(this).removeClass("hovered");JQ(this).find(".clickTextSpan").remove();var div=JQ(this).parent('div[className*="form"]');if(div.is(".form_off")){div.removeClass("form_off").addClass("form_on").next("p.disclaimer").toggle()}JQ("#"+JQ(this).attr("id").replace(/display/,"edit")).focus()})})}function setUpSecurityQuestion(){JQ("div#security_question").bind("click",function(e){UPM.editMode=true;var $target=JQ(e.target);var wrapper=JQ("> div",this);$divs=JQ("div",wrapper).not(".button_container",".clickTextSpanSec");var secQClose=JQ("#default");var secQOpen=JQ("#securityQuestion");if($target.is("input#cancelSecurity")){JQ("input[@name=passwordQuestion]").setValue(UPM.prof.passwordQuestion);JQ("input[@name=passwordAnswer]").setValue(UPM.prof.passwordAnswer);UPM.editMode=false}else{if($target.is("input#submitSecurity")){trySubmit($target)}else{if($target.is("option")){}else{if(!$target.is(":input")){}}}}})}function deactivateAccountModal(){JQ.blockUI({message:JQ("#deactivate_account_modal")});if(typeof(window.tracking!="undefined")){tracking.click({pageName:track_site+">profile>my_profile>my_settings>basic>deactivate"})}}function findReplace(data,findIt,replacement){var replaced=data;var match=new RegExp(findIt,"ig");replaced=replaced.replace(match,replacement);return replaced}function confirmAccountDeactivation(){var url=PROFILE_SERVICE_URL+"?action=deregister";var req={url:url,meth:"POST",data:{},onready:function(data){if(navigator.appName=="Microsoft Internet Explorer"){var newData=findReplace(data,"&","<![CDATA[ & ]]>")}else{var newData=findReplace(data,"&","<![CDATA[&]]>")}var profileService=JQ.xml2json(newData);var status=profileService.status;if(status=="success"){NIKEOS.ME.clearSocialCookies();setTimeout(function(){JQ.blockUI({message:JQ("#del_acct_survey_modal")})},1200)}}};f4a.open(req);data=null}function sendDeactivationSurvey(){var recipient="nikedeactivations%40gmail.com";var url="http://www.nike.com/usa/services/send_email.jsp";var data="recipient="+recipient+"&language=en&country=US&environment="+document.location.hostname;data+="&category="+document.location.pathname.split("/nikeos/p/")[1].split("/")[0];data+="&emailTemplatePathHTML=/nikeos/global/jsp/social/deactivate_email.jsp&emailTemplatePathTEXT=/nikeos/global/jsp/social/deactivate_email.jsp";data+="&sender=deactivations@nike.com&messageSubject=Deactivation+-+"+document.location.hostname;data+="&reasons=";var first=true;JQ("#del_acct_survey_modal ul li.setting.on").each(function(){if(!first){data+=","}data+=JQ(this).attr("id").split("_")[1];first=false});data+="&user_reason=";if(JQ("#del_acct_survey_modal textarea").val()!=deactivate_tell_us){data+=escape(JQ("#del_acct_survey_modal textarea").val())}else{data+="blank"}url=url+"?"+data;var req={url:url,meth:"POST",onready:function(data){var emailService=JQ.xml2json(data);var status=emailService.status;if(status=="success"){window.location.href="profile?page=deregistered&continueURL="+continueURL}}};f4a.open(req);CHECKERS.logout()}function trySubmit(JQsaveButton){JQform=JQsaveButton.parents("form");validate(JQform,function(){formUpdateSuccess(JQform)})}function validate(JQform,callback){JQ(".success",JQform).hide();var validForm=true;clearErrors(JQform);JQ(allFields).each(function(){showLabelError=false;if(this.formId==JQform.attr("id")){if((JQ("#edit-screenName").val()==""||JQ("#edit-email").val()=="")){showError(this,showLabelError,false,true);validForm=false}if((JQ("#edit-"+this.id,JQform).val()==""||JQ("#edit-"+this.id,JQform).val()=="-1")&&this.required!="no"){showError(this,showLabelError,false,true);validForm=false}else{if(this.validationType){if(!validateField(this)){showError(this,showLabelError,false);validForm=false}}if(this.matchField!=undefined){if(!validateMatch(this)){showError(this,showLabelError,false);validForm=false}}}}});if(validForm){postForm(JQform,callback)}else{console.log("no good")}}function validateAddress(JQform,callback){var validForm=true;clearErrors(JQform);JQ(allFields).each(function(){showLabelError=false;if(this.formId==JQform.attr("id")){if((JQ("#edit-"+this.id,JQform).val()==""||JQ("#edit-"+this.id,JQform).val()=="-1")&&this.required!="no"){showError(this,showLabelError,false,true);validForm=false}else{if(this.validationType){if(!validateField(this)){showError(this,showLabelError,false);validForm=false}}if(this.matchField!=undefined){if(!validateMatch(this)){showError(this,showLabelError,false);validForm=false}}}}});if(validForm){postAddressForm(JQform,callback)}else{}}function postForm(JQform,callback){doAction(JQform,PROFILE_SERVICE_URL,JQform.serialize(),"update",function(data){formUpdateHandleProfileService(data,JQform,callback)})}function postAddressForm(JQform,callback){JQform.find(".loading").show().end().find("p.error, p.success").hide();var action=JQform.find("input:hidden[@name=action]").val();var serializedForm=JQform.serialize()+"&cb="+Math.floor(Math.random()*10000000);doAction(JQform,PROFILE_SERVICE_URL,serializedForm,action,function(data){if(data.status=="success"){callback(data)}else{showServerError(JQform,_profileService)}})}function formUpdateSuccess(JQform){JQ("p.error, .loading, .success").hide();JQform.find("p.success").show();if(typeof(window.tracking!="undefined")){switch(JQform.attr("id")){case"basic_info_form":tracking.click({pageName:track_site+">profile>my_profile>my_settings>basic>info>save"});break;case"change_password":tracking.click({pageName:track_site+">profile>my_profile>my_settings>basic>password>save"});break;case"secQuestion":tracking.click({pageName:track_site+">profile>my_profile>my_settings>basic>security>save"});break}}if(typeof(window.ss)!="undefined"){setNavProfile(NIKEOS.ME.getCookie());ss.syncProfile(ss.DPSID);setTimeout(function(){ss.getProfileInfo(ss.DPSID)},4000);if(typeof(window.nikeplus)!="undefined"){loadProfile(initialHandleProfileService)}}else{NIKEOS.log("unable to sync profile to socialsite")}}function addressFormUpdateSuccess(JQform,profileService){var _profile=profileService.profile;JQform.find("p.error, .loading, p.success").hide();if(AddressManager.loadAddresses(_profile)){console.log("BILLING?");console.log(billing);home=AddressManager.getHomeAddress();billing=AddressManager.getBillingAddress();primaryShipping=AddressManager.getPrimaryShippingAddress();if(home!=null){Render.renderAddresses(home);JQ("#delete_home").show();JQform.find("p.success").show()}if(billing!=null){Render.renderAddresses(billing);JQ("#delete_billing").show();JQform.find("p.success").show()}if(primaryShipping!=null){Render.renderAddresses(primaryShipping);JQ("#delete_shipping").show();JQform.find("p.success").show();JQ("#cancel_shipping_address").hide()}JQ("#subnavigation a.selected").attr({href:"?page=settings&refpage=address_book"});JQ("a.innerbox_close").attr({href:"?page=settings&refpage=address_book"})}if(typeof(window.tracking!="undefined")){tracking.click({pageName:track_site+">profile>my_profile>my_settings>address_book>save"})}}function secondaryAddressFormUpdateSuccess(JQform,profileService){loadSecondaryAddresses(handleSecondaryAddresses);var form_id=JQ(JQform).attr("id");current_form=JQform}function loadProfile(callback){if(useNSLActivities==true&&window.location.href.indexOf("address_book")==-1){JQ.ajax({url:"/nsl/services/user/get",type:"GET",data:{appId:self.nikeplus_appId,app:self.nikeplus_appId,format:"json"},dataType:"json",success:function(data,status,xhr){var id=data.serviceResponse.body.User.id;var screenName=data.serviceResponse.body.User.screenName;if(id&&id!=""){isLoggedIn=true;if(screenName.length==0){boot("profile?page=update&continueURL="+escape(location.href),"NO SCREEN NAME")}else{addToCookie(data.serviceResponse.body.User);callback(data.serviceResponse.body.User)}}else{if(typeof(window.PUBLIC)=="undefined"){boot("profile?page=login&continueURL="+escape(location.href),"NOT LOGGED IN")}else{callback("public")}}}})}else{var url=PROFILE_SERVICE_URL;var data="action=getprofile&cb="+Math.floor(Math.random()*10000000);var req={url:url,meth:"POST",data:data,onready:function(data){if(navigator.appName=="Microsoft Internet Explorer"){var newData=findReplace(data,"&","<![CDATA[ & ]]>")}else{var newData=findReplace(data,"&","<![CDATA[&]]>")}var profileService=JQ.xml2json(newData);var id=profileService.profile.id;var login=profileService.profile.login;var screenName=profileService.profile.screenName;if(id&&id!=""&&login&&login!=""){isLoggedIn=true;if(screenName.length==0){boot("profile?page=update&continueURL="+escape(location.href),"NO SCREEN NAME")}else{addToCookie(profileService.profile);callback(profileService.profile)}}else{if(typeof(window.PUBLIC)=="undefined"){boot("profile?page=login&continueURL="+escape(location.href),"NOT LOGGED IN")}else{callback("public")}}}};f4a.open(req)}}function boot(URL,comment){window.location.href=URL}function jsonifyAndPrepopulate(){loadProfile(initialHandleProfileService);if(window.handleSecondaryAddresses){setTimeout(function(){loadSecondaryAddresses(handleSecondaryAddresses)},500)}}JQ.aop.before({target:window,method:"postForm"},function(){JQ.blockUI()});JQ.aop.after({target:window,method:"formUpdateSuccess"},function(){JQ.unblockUI()});function loadSecondaryAddresses(callback){var url=PROFILE_SERVICE_URL+"?action=getsecondaryaddresses&cb="+Math.floor(Math.random()*10000000);var req={url:url,meth:"POST",data:{},onready:function(data){if(navigator.appName=="Microsoft Internet Explorer"){var newData=findReplace(data,"&","<![CDATA[ & ]]>")}else{var newData=findReplace(data,"&","<![CDATA[&]]>")}var profileService=JQ.xml2json(newData);if(profileService.secondaryAddresses!=null){var nickname=(profileService.secondaryAddresses.constructor==Array)?profileService.secondaryAddresses[0].nickname:profileService.secondaryAddresses.nickname;if(!nickname||nickname==""){unblockUI=true}else{callback(profileService)}}else{unblockUI=true}}};f4a.open(req)}function updateProfileSummary(element,profile){if(typeof(window.ss!="undefined")){ss.getProfileInfo()}}function activateFormFields(profile,callback){if(JQ("#dob_container").is(".form_on")){toggleForm(JQ("#dob_container"))}JQ.each(UPM.checkFields,function(){var path="input[@name='"+this+"']";if(JQ(path).getValue()==""){var div=JQ(path).parent('div[className*="form"]');if(div.is(".form_off")){div.removeClass("form_off").addClass("form_on").next("p.disclaimer").toggle()}}else{var div=JQ(path).parent("div[className*=form");if(div.is(".form_on")){toggleForm(div);div.next("p.disclaimer").hide()}}});if(callback){callback()}}function toggleForm(container){container.removeClass("form_on").addClass("form_off")}function cancelForm(JQCancelButton){JQform=JQCancelButton.parents("form");formID=JQform.attr("id");JQform.find(".loading").show().end().find("p.error, p.success").hide();clearErrors(JQform);if(formID=="basic_info_form"){JQform.autoFill(UPM.prof);if(JQ("#dob_container").is(".form_on")){toggleForm(JQ("#dob_container"))}JQ.each(UPM.checkFields,function(){var path="input[@name='"+this+"']";if(JQ(path).getValue()!=""){var div=JQ(path).parent("div[css*=form");if(div.is(".form_on")){toggleForm(div);div.next("p.disclaimer").toggle()}}})}else{if(formID=="change_password"){JQform.find(":password").val("")}}JQform.find(".loading").hide()}function loadForm(_profile,JQform,callback){JQ("form").autoFill(_profile);JQ("#edit-password").val("");if(JQform){switch(JQform.attr("id")){case"secQuestion":showSuccessfulSecSave(JQ("#questionWrapper"));break;default:JQform.populateByName(_profile,{fixText:function(id){fixedId=(id).replace(/\./i,"_");fixedId="display-"+fixedId;return fixedId}});break}}else{unblockUI=true;JQ("#basic_info_form").populateByName(_profile,{fixText:function(id){fixedId=(id).replace(/\./i,"_");fixedId="display-"+fixedId;return fixedId}})}activateFormFields(_profile,callback);if(JQ("#label-gender").length!=0&&JQ("span.cust_checkbox.radio").length==0){JQ("input[type='radio']").custCheckBox();JQ("#label-gender, #label-gender + span.group").show()}}function showSuccessfulSecSave(){JQ.each($divs,function(i,n){JQ(n).toggle()})}function initialHandleProfileService(data,JQform){if(data=="public"){console.log("user is not logged in - public view")}else{UPM.prof=data;UPM.initialScreenName=data.screenName;UPM.initialMobileNumber=data.mobileNumber;UPM.initialLastName=data.lastName;loadForm(data,null,null)}}function formUpdateHandleProfileService(_profileService,JQform,callback){if(useNSLActivities==true){console.log("lkjsldkfjlsjdfljlsdjflaksjdflkajhsdljkfhalsdf");console.log(_profileService.indexOf("notUnique :: screenName: Nike Screen Name is already taken"));if(_profileService.indexOf("notUnique :: screenName: Nike Screen Name is already taken")!=-1){JQ(".innerbox_in .success").hide();JQ("#basic_info_form .innerbox_in .error").append("That Screen Name already exists");JQ("#basic_info_form .innerbox_in .error").show();JQ.unblockUI()}else{var profileObject=JSON.parse(_profileService);console.log("profileObject");console.log(profileObject);if(profileObject.serviceResponse.header.success=="true"){_prof={};_prof.screenName=profileObject.serviceResponse.body.User.screenName;_prof.email=profileObject.serviceResponse.body.User.email;_prof.lastName=profileObject.serviceResponse.body.User.lastName;_prof.mobileNumber=profileObject.serviceResponse.body.User.mobileNumber;_prof.gender=profileObject.serviceResponse.body.User.gender;addToCookie(_prof);nikeplus.plus.syncProfileSettings(function(data){});return loadForm(_prof,JQform,callback)}else{showServerError(JQform,_profileService)}}}else{_prof=_profileService.profile;if(_prof!=null){if(_prof.screenName!=""){UPM.currentScreenName=true}if(_prof.mobileNumber!=""){UPM.currentMobileNumber=true}if(_prof.lastName!=""){UPM.currentLastName=true}UPM.initialScreenName=UPM.currentScreenName;addToCookie(_prof);return loadForm(_prof,JQform,callback)}else{showServerError(JQform,_profileService)}}}function doAction(JQform,url,data,action,callback){console.log("doAction");console.log(action);console.log(url);console.log(data);console.log(callback);console.log(data.indexOf("update&homeAddress.address1"));if(data.indexOf("update&shippingAddress")==-1){if(data.indexOf("update&billingAddress.firstName")==-1){if(data.indexOf("update&homeAddress.address1")==-1){if(useNSLActivities==true){doNSLAction(JQform,url,data,action,callback);return false}}}}if(action=="logout"){data={}}ajaxProgress=true;data.action=action;var req={url:url,meth:"POST",data:data,onready:function(data){if(navigator.appName=="Microsoft Internet Explorer"){var newData=findReplace(data,"&","<![CDATA[ & ]]>")}else{var newData=findReplace(data,"&","<![CDATA[&]]>")}var profileService=JQ.xml2json(newData);var status=profileService.status;if(status=="success"){callback(profileService)}else{showServerError(JQform,profileService)}}};f4a.open(req);data=null}doNSLAction=function(JQform,url,data,action,callback){var oldPassword=JQ("#edit-oldpassword").val();var newPassword=JQ("#edit-password").val();var confirmPassword=JQ("#edit-confirmPassword").val();if(data.indexOf("gender=female")>=0){var gender="female"}else{var gender="male"}var params={};var url=site_data.settings.profile_secure_url+"nsl/services/user/update?format=json&app="+ss.nikeplus_appId;params.url=url;params.method="POST";if(oldPassword!=undefined&&newPassword!=undefined&&confirmPassword!=undefined&&oldPassword!=""&&newPassword!=""&&confirmPassword!=""){params.post_data='object={ "User": { "email": "'+JQ("#edit-email").val()+'","screenName": "'+JQ("#edit-screenName").val()+'","firstName": "'+JQ("#edit-firstName").val()+'","lastName": "'+JQ("#edit-lastName").val()+'","gender": "'+gender+'","mobileNumber": "'+JQ("#edit-mobileNumber").val()+'","oldPassword": "'+oldPassword+'","password": "'+newPassword+'","passwordConfirm": "'+confirmPassword+'"}}'}else{params.post_data='object={ "User": { "email": "'+JQ("#edit-email").val()+'","screenName": "'+JQ("#edit-screenName").val()+'","firstName": "'+JQ("#edit-firstName").val()+'","lastName": "'+JQ("#edit-lastName").val()+'","gender": "'+gender+'","mobileNumber": "'+JQ("#edit-mobileNumber").val()+'"}}'}var _f4aRequest=function(data,callback){this.url=data.url||"";this.method=data.method||"POST";this.data=data.post_data||{};this.contenttype=data.contenttype||null;this.callback=callback||function(){return};this.req={url:this.url,meth:this.method,contenttype:this.contenttype,data:this.data,onready:function(data){callback(data)}};f4a.open(this.req)};_f4aRequest(params,callback)};function showServerError(JQform,profileService){if(JQ("#delete_address_confirmation:visible").length>0){JQ("#delete_address_confirmation p").text(errorMessage);setTimeout(function(){JQ.unblockUI();JQ("#delete_address_confirmation p").text(originalRemovalText);CallbackManager.callbacks={};CallbackManager.callbackIndexes={}},5000)}else{JQ.unblockUI();var error=profileService.exceptions.error.constructor==Array?profileService.exceptions.error[0]:profileService.exceptions.error;var errorMessage=error.message;var offendingField=error.property;JQform.find(".loading").hide().end().find("p.error").html(errorMessage).show();JQform.find("[@name="+offendingField+"], label[@for="+offendingField+"]").addClass("error")}}function validateProtocol(){if(location.hostname.indexOf(".nike.com")>=1&&(location.hostname.indexOf("env")==0)&&(location.hostname.indexOf("ecn")==0)){if(location.protocol=="http:"){window.location.href=location.href.replace(/http:/,"https:")}}}function loadStateList(element,country,callback){var url=PROFILE_SERVICE_URL+"?action=getstatelist";if(country=="US"){country="USNT"}var data="country="+UPM.country;var req2={url:url,meth:"POST",data:data,onready:function(data){if(navigator.appName=="Microsoft Internet Explorer"){var newData=findReplace(data,"&","<![CDATA[ & ]]>")}else{var newData=findReplace(data,"&","<![CDATA[&]]>")}var stateJson=JQ.xml2json(newData);element.append("<option value=' '></option>");JQ(stateJson.states.state).each(function(){element.append("<option value='"+this.code+"'>"+this.text[0]+"</option>")});if(callback!=null){callback()}}};f4a.open(req2)}function loadCountryList(element,locale,country,callback){var url=PROFILE_SERVICE_URL+"?action=getcountrylist";var data="lang_locale="+UPM.locale;var req={url:url,meth:"POST",data:data,onready:function(data){if(navigator.appName=="Microsoft Internet Explorer"){var newData=findReplace(data,"&","<![CDATA[ & ]]>")}else{var newData=findReplace(data,"&","<![CDATA[&]]>")}var countryJson=JQ.xml2json(newData);JQ(countryJson.countries.country).each(function(){var selected="";if(country==this.code){selected=" selected"}element.append("<option value='"+this.code+"' "+selected+">"+this.text[0]+"</option>")});if(callback!=null){callback()}}};f4a.open(req)}function disallowBadCharacters(JQinputFields){JQinputFields.keypress(function(e){if(e.which==32||e.which==38(33<=e.which&&e.which<=44)||e.which==47||(58<=e.which&&e.which<=64)||(91<=e.which&&e.which<=94)||e.which==96||123<=e.which){return false}else{return true}})}function initForm(formID){JQ(fieldData[formID]).each(function(){var f=new Object();f.formId=formID;if(this.id!=undefined){f.id=this.id}else{if(this.name!=undefined){f.id=this.name}}if(this.required!=undefined){f.required=this.required}if(this.labelError!=undefined){f.labelError=this.labelError}if(this.labelServerError!=undefined){f.labelServerError=this.labelServerError}if(this.validationType!=undefined){f.validationType=this.validationType}if(this.group!=undefined){f.group=this.group;f.groupOrder=this.groupOrder;f.label=JQ("#label-"+this.group).html()}else{f.label=JQ("#label-"+f.id).html()}if(this.matchField!=undefined){f.matchField=this.matchField}allFields.push(f);f=null})}function validateEmail(email){var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;showLabelError=true;return(filter.test(email))?true:false}function validateUniqueEmail(email,form){showLabelError=true;var numberLessThan=(JQ(form).find("input[@name=bvdid]").val()=="")?1:2;var foundAddress=AddressManager.findFamilyAddressByEmail(email);return(numberLessThan>foundAddress.length)?true:false}function validateDate(m,d,y){if(m==-1&&d==-1&&y==-1){showLabelError=false;return false}else{if(m==-1||d==-1||y==-1){showLabelError=true;return false}else{showLabelError=true;m=m-1;var testDate=new Date(y,m,d);if((testDate.getFullYear()==y)&&(testDate.getMonth()==m)&&(testDate.getDate()==d)){return true}else{return false}}}}function validateZipcode(zipcode){showLabelError=true;return(zipcode.length<2||zipcode.length>9)?false:true}function validateUSPostalCode(zipcode){showLabelError=true;return(zipcode.length==5)?true:false}function validateEMEAPostalCode(zipcode){showLabelError=true;return(zipcode.length<2||zipcode.length>9)?false:true}function validateRadioButtons(f){showLabelError=true;return(JQ("input[@name='"+f.id+"']:checked").val()!=undefined)?true:false}function validateName(name){var filter=/^(([a-zA-Z]+)(\s|\-){0,1})+[a-zA-Z]+$/;showLabelError=true;return(filter.test(name))?true:false}function validatePhone(f){var filter=/^((\([0-9]{1,3}\))|([0-9]+)|(\+[0-9]{1}))((\s|\-|\.|\,){0,1}[0-9])+$/;showLabelError=true;var phone=JQ("#"+f.formId+" #edit-"+f.id).val();if(phone.length>0){if(phone.length<8){return false}else{return(filter.test(phone))?true:false}}return true}function validateState(f){if(JQ("#"+f.formId+" #edit-"+f.id).val()==" "){return(JQ("#"+f.formId+" .country_select").val()=="US")?false:true}return true}function validatePassword(f){var password=JQ("#"+f.formId+" #edit-"+f.id).val();return(password.length>5)?true:false}function validateMatch(f){showLabelError=true;return(JQ("#edit-"+f.id).val()==JQ("#edit-"+f.matchField).val())?true:false}function validateField(f,form){if(f.group==undefined){if(f.validationType=="email"){return validateEmail(JQ("#"+f.formId+" #edit-"+f.id).val())}if(f.validationType=="uniqueemail"){return validateUniqueEmail(JQ("#"+f.formId+" #edit-"+f.id).val(),form)}if(f.validationType=="zipcode"){return validateZipcode(JQ("#"+f.formId+" #edit-"+f.id).val())}if(f.validationType=="USPostalCode"){return validateUSPostalCode(JQ("#"+f.formId+" #edit-"+f.id).val())}if(f.validationType=="EMEAPostalCode"){return validateEMEAPostalCode(JQ("#"+f.formId+" #edit-"+f.id).val())}if(f.validationType=="radio"){return validateRadioButtons(f)}if(f.validationType=="name"){return validateName(JQ("#"+f.formId+" #edit-"+f.id).val())}if(f.validationType=="phone"){return validatePhone(f)}if(f.validationType=="state"){return validateState(f)}if(f.validationType=="password"){return validatePassword(f)}}else{if(f.validationType=="date"){var group=f.groupOrder.split(",");return validateDate(JQ("#edit-"+group[0]).val(),JQ("#edit-"+group[1]).val(),JQ("#edit-"+group[2]).val())}}}function showError(f,label,server,empty){if(empty==undefined){empty=false}if(f.formId){formId="#"+f.formId+" "}else{formId=""}if(label&&server&&f.labelServerError!=undefined){var labelError=f.labelServerError}else{var labelError=f.labelError}if(label){if(f.group!=undefined){if(labelError){JQ(formId+"#label-"+f.group).html(labelError.toUpperCase())}JQ(formId+"#label-"+f.group).addClass("error")}else{if(labelError){JQ(formId+"#label-"+f.id).html(labelError.toUpperCase())}JQ(formId+"#label-"+f.id).addClass("error")}}if(empty){if(f.group!=undefined){JQ(formId+"#label-"+f.group).addClass("error")}else{JQ(formId+"#label-"+f.id).addClass("error")}}if(f.group!=undefined){var group=f.groupOrder.split(",");JQ(group).each(function(){JQ(formId+"#edit-"+this).addClass("error")})}else{JQ(formId+" #edit-"+f.id).addClass("error");if(f.matchField!=undefined){JQ(formId+"#edit-"+f.matchField).addClass("error");if(f.formId=="change_password"&&((JQ(formId+" #edit-password").val().length<=5)||(JQ(formId+" #edit-confirmPassword").val().length<=5))){JQ(formId+"#label-password").html(_("errorPasswordLength").toUpperCase());JQ(formId+"#label-password").addClass("error")}}}JQ("select.error").parent("div").parent("div").find("label").addClass("error")}function clearErrors(JQform){JQform.find(".loading").hide().end().find("p.error").html("").hide();JQ(allFields).each(function(){if(this.group!=undefined){JQ("#label-"+this.group,JQform).html(this.label);JQ("#label-"+this.group,JQform).removeClass("error")}else{JQ("#label-"+this.id,JQform).html(this.label);JQ("#label-"+this.id,JQform).removeClass("error")}JQ("#edit-"+this.id,JQform).removeClass("error")})}function blockNonAlphaNumericChars(e){if(e.which==32||(33<=e.which&&e.which<=44)||e.which==47||(58<=e.which&&e.which<=64)||(91<=e.which&&e.which<=94)||e.which==96||123<=e.which){return false}else{return true}}function blockNonAlphaNumericCharsAllowSpaces(e){if((33<=e.which&&e.which<=44)||e.which==47||(58<=e.which&&e.which<=64)||(91<=e.which&&e.which<=94)||e.which==96||123<=e.which){return false}else{return true}}function blockNonNumericChars(e){if(e.which==32||(33<=e.which&&e.which<=44)||e.which==47||(58<=e.which&&e.which<=95)||96<=e.which){return false}else{return true}}function addToCookie(data){var filter=["email","screenName","id"];var filteredData={};for(var i in data){for(var j=0;j<filter.length;j++){if(i==filter[j]){filteredData[i]=data[i]}}}NIKEOS.ME.addToCookie(filteredData)}self.minifield=function(id,color,width,height,bold){var font="Victory-Neue Light";if(bold){font="Victory-Neue Bold"}placeText(id,"nada",width,height,font,height,color,null,"left","center",null,null,true,null,"/nikeos/global/swf/fonts/fontlibrary.swf")};JQ(document).ready(function(){JQ("div.sec_block").hover(function(){JQ(this).addClass("sec_block_on")},function(){JQ(this).removeClass("sec_block_on")});JQ("div.dark").hover(function(){JQ(this).addClass("but_dark_on")},function(){JQ(this).removeClass("but_dark_on")});if(JQ("#guts").hasClass("landing")){self.minifield("guts_title","#000000",250,68,false)}JQ.preloadImages=function(){for(var i=0;i<arguments.length;i++){JQ("<img>").attr("src",arguments[i])}};JQ.preloadImages("/nikeos/site/profile_v3.2/global/images/subnav_tab_hover_bg_right.png","/nikeos/site/profile_v3.2/global/images/subnav_tab_hover_bg_left_first.png","/nikeos/site/profile_v3.2/global/images/subnav_tab_hover_bg_right.png","/nikeos/site/profile_v3.2/global/images/subnav_tab_hover_bg_left.png","/nikeos/site/profile_v3.2/global/images/subnav_tab_hover_bg_right_last.png","/nikeos/site/profile_v3.2/global/images/subnav_tab_hover_bg_left.png","/nikeos/site/profile_v3.2/global/images/secblock_bot_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_top_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_sides_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_icon_basic_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_icon_shipping_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_icon_privacy_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_icon_broadc_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_icon_email_on.gif","/nikeos/site/profile_v3.2/global/images/secblock_icon_sitepref_on.gif","/nikeos/site/profile_v3.2/global/images/subtab_first_l.png","/nikeos/site/profile_v3.2/global/images/subtab_first_l_on.png","/nikeos/site/profile_v3.2/global/images/subtab_first_r.png","/nikeos/site/profile_v3.2/global/images/subtab_first_r_on.png","/nikeos/site/profile_v3.2/global/images/subtab_last_l.png","/nikeos/site/profile_v3.2/global/images/subtab_last_l_on.png","/nikeos/site/profile_v3.2/global/images/subtab_last_r.png","/nikeos/site/profile_v3.2/global/images/subtab_last_r_on.png","/nikeos/site/profile_v3.2/global/images/subtab_mid_l.png","/nikeos/site/profile_v3.2/global/images/subtab_mid_l_on.png","/nikeos/site/profile_v3.2/global/images/subtab_mid_r.png","/nikeos/site/profile_v3.2/global/images/subtab_mid_r_on.png")});
