function getFormById(idLookup) {var forms=document.forms;for(var i=0;i-1)) return true;else return false;} function toggleLayer(whichLayer) {var style2=null;if(document.getElementById) {style2=document.getElementById(whichLayer).style;} else if(document.all) {style2=document.all[whichLayer].style;} else if(document.layers) {style2=document.layers[whichLayer].style;} if(style2&&style2!=null) style2.display=(style2.display!="none")?"none":"block";} function show(divID) {document.getElementById(divID).style.display='block';} function hide(divID) {document.getElementById(divID).style.display='none';} function setCursor(textAreaElem) {textAreaElem.focus();if(textAreaElem.createTextRange) {var range=textAreaElem.createTextRange();range.moveStart('character',textAreaElem.value.length);range.moveEnd('character',0);range.select();}} function disableSelectFormFields() {for(lv=0;lv"9")) {return false;} digitIndx++;} if(digitIndx<10||digitIndx>23) {return false;} return true;} function phoneCharsOnly(myfield,e) {if(numbersonly(myfield,e)) return true;else {var key;var keychar;if(window.event) key=window.event.keyCode;else if(e) key=e.which;else return true;keychar=String.fromCharCode(key);if((key==null)||(key==0)||(key==8)||(key==9)||(key==13)||(key==27)) return true;else if((("()-+ ").indexOf(keychar)>-1)) return true;else return false;}} function updateReqFldsForBillingCountryChange() {var companyCountrySelectObject=document.getElementById("companyCountry");var companyStateReqTag=document.getElementById("companyStateReqTag");var addressInfoReqTag=document.getElementById("addressInfoReqTag");var postalCodeReqTag=document.getElementById("postalCodeReqTag");var phoneReqTag=document.getElementById("phoneReqTag");if(companyCountrySelectObject.value==354||companyCountrySelectObject.value==146) {if(companyStateReqTag!=null) {getStyle(companyStateReqTag).display="inline";} if(addressInfoReqTag!=null) {getStyle(addressInfoReqTag).display="inline";} if(postalCodeReqTag!=null) {getStyle(postalCodeReqTag).display="inline";} if(companyCountrySelectObject.value==354&&phoneReqTag!=null) {getStyle(phoneReqTag).display="inline";} else {getStyle(phoneReqTag).display="none";}} else {if(companyStateReqTag!=null) {getStyle(companyStateReqTag).display="none";} if(addressInfoReqTag!=null) {getStyle(addressInfoReqTag).display="none";} if(postalCodeReqTag!=null) {getStyle(postalCodeReqTag).display="none";} if(phoneReqTag!=null) {getStyle(phoneReqTag).display="none";}}} function updateReqFldsForShippingCountryChange() {var theForm=document.getElementById("workingTtiForm");var shippingCountrySelectObject=getFormElementByName(theForm,"shippingCountryID");var shippingStateReqTag=document.getElementById("companyShippingStateReqTag");var shippingAddressInfoReqTag=document.getElementById("shippingAddressInfoReqTag");var shippingPostalCodeReqTag=document.getElementById("shippingPostalCodeReqTag");var shippingPhoneReqTag=document.getElementById("shippingPhoneReqTag");if(shippingCountrySelectObject.value==354||shippingCountrySelectObject.value==146) {if(companyShippingStateReqTag!=null) {getStyle(companyShippingStateReqTag).display="inline";} if(shippingAddressInfoReqTag!=null) {getStyle(shippingAddressInfoReqTag).display="inline";} if(shippingPostalCodeReqTag!=null) {getStyle(shippingPostalCodeReqTag).display="inline";} if(shippingCountrySelectObject.value==354&&shippingPhoneReqTag!=null) {getStyle(shippingPhoneReqTag).display="inline";} else {getStyle(shippingPhoneReqTag).display="none";}} else {if(companyShippingStateReqTag!=null) {getStyle(companyShippingStateReqTag).display="none";} if(shippingAddressInfoReqTag!=null) {getStyle(shippingAddressInfoReqTag).display="none";} if(shippingPostalCodeReqTag!=null) {getStyle(shippingPostalCodeReqTag).display="none";} if(shippingPhoneReqTag!=null) {getStyle(shippingPhoneReqTag).display="none";}}} function isEscapeKeyPressed(e){var e=e||window.event;var characterCode=e.charCode||e.keyCode;if(characterCode==27) {return true;} return false;} function isEnterKeyPressed(e){var characterCode if(e&&e.which){e=e characterCode=e.which} else{e=event characterCode=e.keyCode} if(characterCode==13){return true;} return false;} function handleSubmitFormKeyPressedEvent(e,info) {if(isEnterKeyPressed(e)) {info.isEnterKeyPressed=true;if(info.alwaysCallback!==undefined&&info.alwaysCallback!=null) info.alwaysCallback(e,info);if(info.enterPressedCallback!==undefined&&info.enterPressedCallback!=null) info.enterPressedCallback(e,info);if(info.isSubmitForm==true&&info.form!==undefined&&info.form!=null) {info.form.submit();} return false;} info.isEnterKeyPressed=false;if(info.alwaysCallback!==undefined&&info.alwaysCallback!=null) info.alwaysCallback(e,info);return true;} function initiateClientToWASSession(env,emailAddr,originEntity) {var entity="NDC";var param="?email=";param+=emailAddr;if(originEntity) {param+="&originEntity=";param+=originEntity;} var options={url:"/"+env+"/InitClientToWASSessionAction.do"+param,method:"GET",load:function(type,data,evt) {if(data!="") {entity=data;}},sync:true};dojo.io.bind(options);var entityCookie=new SingleCookieValue("entity");entityCookie.setValue(entity);entityCookie.store(null,"/");} function getQuerystring(key,default_) {if(default_==null)default_="";key=key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regex=new RegExp("[\\?&]"+key+"=([^&#]*)");var qs=regex.exec(window.location.href);if(qs==null) return default_;else return qs[1];} function retrieveAutoSavedCart(urlStr) {var customerID=null;try {var indx=document.cookie.indexOf("shopping_cart_id=shopping_cart_id:");var shoppingCartID=null;if(indx>-1) {shoppingCartID=document.cookie.substring(indx+"shopping_cart_id=shopping_cart_id:".length);shoppingCartID=shoppingCartID.split(";")[0];} var options={url:urlStr+"?shopping_cart_id="+shoppingCartID,sync:true,load:function(type,data,evt) {if(data!="") {customerID=data;}}};dojo.io.bind(options);} catch(ex) {} var ezBuySelElem=document.getElementById("ezBuyAcctSelector");if(customerID&&ezBuySelElem&&ezBuySelElem.type&&ezBuySelElem.type=="select-one") {ezBuySelElem.value=customerID;ezBuySelElem.disabled=true;} return false;}