var o_privParents=new Array();function excludeFromRole(){addParentRoles(document.manageRolesAndPrivExcludes.excludable_privilege_ids);addParentRoles(document.manageRolesAndPrivExcludes.excludable_child_role_ids);document.manageRolesAndPrivExcludes.action="/excludeFromRole.do";document.manageRolesAndPrivExcludes.submit()}function unexcludeFromRole(){addParentRoles(document.manageRolesAndPrivExcludes.includable_privilege_ids);addParentRoles(document.manageRolesAndPrivExcludes.includable_child_role_ids);for(x_i=0;x_i<document.manageRolesAndPrivExcludes.parent_roles.length;x_i++){document.manageRolesAndPrivExcludes.action="/unexcludeFromRole.do"}document.manageRolesAndPrivExcludes.submit()}function addParentRoles(B){if(B!=null){if(B.length){for(var A=0;A<B.length;A++){if(B[A].checked){for(var C=0;C<o_privParents.length;C++){if(o_privParents[C][0]==B[A].value){addOption("",o_privParents[C][1],document.manageRolesAndPrivExcludes.parent_roles,true)}}}}}else{if(B.checked){for(var C=0;C<o_privParents.length;C++){if(o_privParents[C][0]==B.value){addOption("",o_privParents[C][1],document.manageRolesAndPrivExcludes.parent_roles,true)}}}}}}function addOption(B,E,A,D){for(x_i=0;x_i<A.length;x_i++){if(A.options[x_i].value==E){return }}var C=document.createElement("OPTION");C.text=B;C.value=E;A.options.add(C);x_index=A.options.length;A.options[x_index-1].selected=D}function postForDirector(B,A){A.action="/officerIdentification.do";A.officer_key.value=B;A.submit()}function postForReport(B,A){A.action="/companiesOfficers.do";A.sort_on.value=B;A.submit()}function postForOrderSearchResults(B,A){A.action="/standardSearchCompanyResults.do";A.company_key.value=B;A.report_type.value="8006";A.submit()}function postForImageListFilter(B,A){A.action="/companyImages.do";doImageListFilter(B,A)}function postForFilingHistoryFilter(B,A){A.action="/companyFilingHist.do";doImageListFilter(B,A)}function doImageListFilter(G,F){var C;if(F.sort_order==null||F.sort_order.value==""){if(F.sort_order_select!=null){F.sort_order.value=F.sort_order_select.options[F.sort_order_select.selectedIndex].value
}}if(G=="SELECT_ALL_DOCUMENTS"){F.selectDeselectAll.checked=true;for(C=0;C<F.family_array_key.length;C++){F.family_array_key[C].checked=true}}else{if(G!=""){for(C=0;C<F.family_array_key.length;C++){if(F.family_array_key[C].value==G){F.family_array_key[C].checked=true}else{F.family_array_key[C].checked=false}}}}F.target_date_DD.value=trimString(F.target_date_DD.value);F.target_date_MM.value=trimString(F.target_date_MM.value);F.target_date_YYYY.value=trimString(F.target_date_YYYY.value);F.days_latitude.value=trimString(F.days_latitude.value);if((F.target_date_YYYY.value!="")&&(F.days_latitude.value!="")){var E=makeDate(F.target_date_DD.value,F.target_date_MM.value,F.target_date_YYYY.value);var H=new Date();H.setFullYear(E.getFullYear(),E.getMonth(),E.getDate()-parseInt(F.days_latitude.value));var B=new Date();B.setFullYear(E.getFullYear(),E.getMonth(),E.getDate()+parseInt(F.days_latitude.value));F.from_DD.value=H.getDate();F.from_MM.value=H.getMonth()+1;F.from_YYYY.value=H.getFullYear();F.to_DD.value=B.getDate();F.to_MM.value=B.getMonth()+1;F.to_YYYY.value=B.getFullYear()}else{F.from_DD.value=trimString(F.from_DD.value);F.from_MM.value=trimString(F.from_MM.value);F.from_YYYY.value=trimString(F.from_YYYY.value);F.to_DD.value=trimString(F.to_DD.value);F.to_MM.value=trimString(F.to_MM.value);F.to_YYYY.value=trimString(F.to_YYYY.value);if((validateDate(F.from_DD.value,F.from_MM.value,F.from_YYYY.value,"from date")==false)||(validateDate(F.to_DD.value,F.to_MM.value,F.to_YYYY.value,"to date")==false)){return }var D=makeDate(F.from_DD.value,F.from_MM.value,F.from_YYYY.value);var A=makeDate(F.to_DD.value,F.to_MM.value,F.to_YYYY.value);if((D!=null)&&(A!=null)){if(D.getTime()>A.getTime()){alert("the from date cannot be after the to date.");return }}}if((F.max_length_screen.value==null)||(F.max_length_screen.value=="")){F.max_length.value=-1}else{F.max_length.value=F.max_length_screen.value}F.submit()}function postForImageListFilter(G,F){var C;if(F.sort_order==null||F.sort_order.value==""){if(F.sort_order_select!=null){F.sort_order.value=F.sort_order_select.options[F.sort_order_select.selectedIndex].value
}}if(G=="SELECT_ALL_DOCUMENTS"){F.selectDeselectAll.checked=true;for(C=0;C<F.family_array_key.length;C++){F.family_array_key[C].checked=true}}else{if(G!=""){for(C=0;C<F.family_array_key.length;C++){if(F.family_array_key[C].value==G){F.family_array_key[C].checked=true}else{F.family_array_key[C].checked=false}}}}F.target_date_DD.value=trimString(F.target_date_DD.value);F.target_date_MM.value=trimString(F.target_date_MM.value);F.target_date_YYYY.value=trimString(F.target_date_YYYY.value);F.days_latitude.value=trimString(F.days_latitude.value);if((F.target_date_YYYY.value!="")&&(F.days_latitude.value!="")){var E=makeDate(F.target_date_DD.value,F.target_date_MM.value,F.target_date_YYYY.value);var H=new Date();H.setFullYear(E.getFullYear(),E.getMonth(),E.getDate()-parseInt(F.days_latitude.value));var B=new Date();B.setFullYear(E.getFullYear(),E.getMonth(),E.getDate()+parseInt(F.days_latitude.value));F.from_DD.value=H.getDate();F.from_MM.value=H.getMonth()+1;F.from_YYYY.value=H.getFullYear();F.to_DD.value=B.getDate();F.to_MM.value=B.getMonth()+1;F.to_YYYY.value=B.getFullYear()}else{F.from_DD.value=trimString(F.from_DD.value);F.from_MM.value=trimString(F.from_MM.value);F.from_YYYY.value=trimString(F.from_YYYY.value);F.to_DD.value=trimString(F.to_DD.value);F.to_MM.value=trimString(F.to_MM.value);F.to_YYYY.value=trimString(F.to_YYYY.value);if((validateDate(F.from_DD.value,F.from_MM.value,F.from_YYYY.value,"from date")==false)||(validateDate(F.to_DD.value,F.to_MM.value,F.to_YYYY.value,"to date")==false)){return }var D=makeDate(F.from_DD.value,F.from_MM.value,F.from_YYYY.value);var A=makeDate(F.to_DD.value,F.to_MM.value,F.to_YYYY.value);if((D!=null)&&(A!=null)){if(D.getTime()>A.getTime()){alert("the from date cannot be after the to date.");return }}}if((F.max_length_screen.value==null)||(F.max_length_screen.value=="")){F.max_length.value=-1}else{F.max_length.value=F.max_length_screen.value}F.submit()}function imageListTableHeaderClicked(C,B){for(index=0;index<C.family_array_key.length;
index++){var A=C.family_array_key_search_val[index].value;if(A=="true"){C.family_array_key[index].checked=true}else{if(A=="false"){C.family_array_key[index].checked=false}else{C.family_array_key[index].checked=false}}}C.from_MM.value=C.from_MM_search_val.value;C.from_YYYY.value=C.from_YYYY_search_val.value;C.to_MM.value=C.to_MM_search_val.value;C.to_YYYY.value=C.to_YYYY_search_val.value;C.max_length_screen.value=C.max_length_screen_search_val.value;if(C.sort_order_search_val==null||C.sort_order_search_val.value==""){C.sort_order.value=B+"Ascending"}else{if(((B+"Descending")!=C.sort_order_search_val.value)&&((B+"Ascending")!=C.sort_order_search_val.value)){C.sort_order.value=B+"Descending"}else{if((B+"Descending")==C.sort_order_search_val.value){C.sort_order.value=B+"Ascending"}else{if((B+"Ascending")==C.sort_order_search_val.value){C.sort_order.value=B+"Descending"}else{C.sort_order.value="typeAscending"}}}}postForImageListFilter("",C)}function postForSingleProduct(C,B,D,A){A.company_key.value=C;A.product_id.value=B;A.MOMENTO_KEY.value=D;A.submit()}function postForSingleProductWithCountryId(C,B,E,D,A){A.company_key.value=C;A.product_id.value=B;A.MOMENTO_KEY.value=E;A.country_id.value=D;A.submit()}function postForGenerateHTMLReport(A,B,G,E,F,D,C){C.order_id.value=A;C.product_id.value=B;C.company_key.value=G;C.orderline_id.value=E;C.entity_ref.value=F;C.entity_type_id.value=D;C.submit()}function postForSingleProductMaxMonEntityException(D,C,E,A,B){B.company_key.value=D;B.product_id.value=C;B.MOMENTO_KEY.value=E;B.monitoring_entities_limit.value=A;B.submit()}function postForReportProductTab(E,D,A,G,F,B,C){C.company_key.value=E;C.product_id.value=D;C.report_data_section_id.value=A;C.MOMENTO_KEY.value=G;C.country_id.value=F;if(B=="ledger"){C.action="/placeReportOrderForLedgerSelections.do"}C.submit()}function postForDirectorReport(C,B,D,A){A.stakeholder_key.value=C;A.product_id.value=B;A.MOMENTO_KEY.value=D;A.submit()}function postForPeopleIdentification(D,C,B,E,A){A.stakeholder_key.value=D;
A.product_id.value=B;A.entity_type_id.value=C;A.MOMENTO_KEY.value=E;A.submit()}function postToSearchAndOrderFavourite(C,A){var B=A.company_key.value;if(isJurisdictionSelected(A)==false){alert("at least one jurisdiction must be selected.");return }if((A.company_name.value!=null||A.company_name.value!="")){A.company_name.value=""}if(B!=null&&B!=""){A.action="/searchAndOrderFavourite.do";A.fav_partial_momento_key.value=C;A.submit()}else{alert("a number must be provided.");A.company_key.focus()}}function postToOrderLatestImage(E,D,A,C,B){B.action="/placeOrderForLatestImage.do";B.company_key.value=E;B.product_id.value=D;B.entity_name.value=A;B.entity_type.value=C;B.submit()}function postToDomesticSearch(A,B){if(A.country_id){if(A.country_id.options[A.country_id.selectedIndex].value=="Spacer"||A.country_id.options[A.country_id.selectedIndex].value==""){alert("select a country to proceed.");if(B=="y"){return false}}else{if(isJurisdictionSelected(A)==false){alert("at least one jurisdiction must be selected.");if(B=="y"){return false}}else{A.country_for_display.value=A.country_id.options[A.country_id.selectedIndex].value;if(B!="y"){A.submit()}}}}else{if(isJurisdictionSelected(A)==false){alert("at least one jurisdiction must be selected.");if(B=="y"){return false}}else{if(B!="y"){A.submit()}}}}function isJurisdictionSelected(A){if(A.include_england_scotland_wales!=null){if(A.include_england_scotland_wales.checked==true){return true}}if(A.include_northern_ireland!=null){if(A.include_northern_ireland.checked==true){return true}}if(A.include_republic_of_ireland!=null){if(A.include_republic_of_ireland.checked==true){return true}}return false}function postToInternationalOnline(C,G){if((C.country_id.options[C.country_id.selectedIndex].value=="Spacer")||(C.country_id.options[C.country_id.selectedIndex].value=="")){alert("select a country to proceed.");if(G=="y"){return false}}else{if(C.reason_code!=null&&C.reason_code.options[C.reason_code.selectedIndex].value=="0"){alert("select a reason code to proceed.");
if(G=="y"){return false}}else{if(C.area!=null&&C.area_dropdown_label!=null&&(C.rb_ss_duns_num_1==null||!C.rb_ss_duns_num_1.checked)&&(C.area.options[C.area.selectedIndex].value==""||C.area.options[C.area.selectedIndex].value=="Spacer")){alert("select a "+C.area_dropdown_label.value+" to proceed.");if(G=="y"){return false}}else{if(document.getElementById("rb_ss_duns_num_1")!=null&&document.getElementById("rb_ss_duns_num_1").checked==true&&isNaN(document.getElementById("intl_search_box").value)){alert("please enter a valid D-U-N-S\u00AE number.");if(G=="y"){return false}}else{var D=document.getElementById("intl_search_box");var F=document.getElementById("rb_ss_reg_name_1");var E=document.getElementById("rb_ss_reg_num_1");var A=document.getElementById("rb_ss_duns_num_1");var B=document.getElementById("rb_ss_tel_num_1");if(F==null||F.checked==true){D.name="company_name"}else{if(E!=null&&E.checked==true){D.name="company_key"}else{if(A!=null&&A.checked==true){D.name="duns_number"}else{if(B!=null&&B.checked==true){D.name="tel_number"}}}}if(G!="y"){C.submit()}}}}}}function postToOrderInternationalOffline(C,G,B){var D=C.entity_name.value;var E=C.company_key.value;var A=document.getElementById("EmailRecipients");if(C.country_id.options[C.country_id.selectedIndex].value=="Spacer"){alert("select a valid country to proceed.");if(G=="y"){return false}}else{if(D.length==0&&E.length==0){alert("specify either the company name or number to proceed.");if(G=="y"){return false}}else{if(B==true&&(E.length!=0&&isNaN(E))){alert("please enter a valid D-U-N-S\u00AE number.");if(G=="y"){return false}}else{if(A.length==0){alert("select a recipient");if(G=="y"){return false}}else{var F="IOFO:key="+E+":name="+D+":type=:p_id="+C.product_id.value+":country="+C.country_id.value;C.MOMENTO_KEY.value=F;if(C.deliveryMethodSelect.options[C.deliveryMethodSelect.selectedIndex].value=="DMO:name=Fax:p_id=31007:d_id=2"){if(C.FaxAreaCode.value.length==0||C.FaxNumber.value.length==0){alert("specify the fax area code and fax number.");
return }}if(C.deliveryMethodSelect.options[C.deliveryMethodSelect.selectedIndex].value=="DMO:name=Post:p_id=31005:d_id=3"){if(C.Address1Field.length==0||C.AddressPostcode.length==0||C.AddressCountry.options[C.AddressCountry.selectedIndex].value.length==0){alert("specify address 1, postcode and country.");return }}if(C.EmailRecipients!=null){selectAllItems(C.EmailRecipients)}C.search_address.value=assembleSearchAddress(C.address_line_1.value,C.address_line_2.value,C.town.value,C.area.value,C.postcode.value);if(C.search_address.value==""){C.search_address.value=C.country_id.options[C.country_id.selectedIndex].innerHTML}if(G!="y"){C.submit()}}}}}}function assembleSearchAddress(E,D,C,B,A){var F=E;if(D!=""&&F!=""){F+=", "}F+=D;if(C!=""&&F!=""){F+=", "}F+=C;if(B!=""&&F!=""){F+=", "}F+=B;if(A!=""&&F!=""){F+=", "}F+=A;return F}function postToOrderInternationalOfflineEmail(C,G){var F=C.entity_name.value;var B=C.company_key.value;if(F==""&&B==""){alert("please enter a company name and/or D-U-N-S� number.")}else{var E=C.userid.value;var D=C.username.value;var I=F!=""?"Company Name: "+F:"";var H=B!=""?"D-U-N-S� number: "+B:"";var A="mailto:"+G+"?subject=ICC International Document Request&body="+I+" "+H+", for user: "+D+" ("+E+")";win=window.open(A,"emailWindow");if(win&&win.open&&!win.closed){win.close()}}}function postToOrderInternationalInvestigation(D){var E=D.entity_name.value;var G=D.company_key.value;var C=D.town.value;var B=D.country_id.value;var F=E.replace(/\s/g,"");var A=C.replace(/\s/g,"");if(G==""&&F==""){alert("please enter company name")}else{if(B=="259"&&G==""&&A==""){alert("please enter town/city")}else{var H="IIO:key="+G+":name="+E+":type=:p_id="+D.product_id.value+":country="+D.country_id.value;D.II_MOMENTO_KEY.value=H;D.submit()}}}function postToCompanySearchesDomesticSearch(A){if(document.getElementById("number_search").checked==true){document.getElementById("company_name").name="company_key"}A.submit()}function postForMonitoringRecipientsSave(A){if(A.EmailRecipients!=null){selectAllItems(A.EmailRecipients)
}A.submit()}function postForMonitoringCreateAndAddRecipient(A){var B=document.createElement("input");B.type="hidden";B.name="add_recipient";B.value=true;A.appendChild(B);A.action="/manageRecipient.do";A.submit()}function postForMonitoringCreateRecipient(A){var B=document.createElement("input");B.type="hidden";B.name="add_recipient";B.value=false;A.appendChild(B);A.action="/manageRecipient.do";A.submit()}function postForPersistDashboard(A){var B=document.createElement("input");B.type="hidden";B.name="dashboard_saved";B.value=true;A.appendChild(B);A.submit()}function postForImageFromList(G,D,C,A,F){var E=null;if(D.MOMENTO_KEY.length==null){E=new Array(D.MOMENTO_KEY)}else{E=D.MOMENTO_KEY}var B;for(B=0;B<E.length;B++){if(E[B].value==G){E[B].checked=true}else{E[B].checked=false}}postForMultipleImages(D,C,A,F)}function postForMultipleImages(B,F,A,E){var H=0;var I=0;var J;var G=null;var D=null;if(B.MOMENTO_KEY.length==null){G=new Array(B.MOMENTO_KEY)}else{G=B.MOMENTO_KEY}if(B.pages.length==null){D=new Array(B.pages)}else{D=B.pages}if(formHasSelectedCheckBoxes(G)){for(J=0;J<G.length;J++){if(G[J].checked==true){H++;var C=parseInt(D[J].value);if(!isNaN(C)){I+=C}}}if(H>100){alert("you may only order 100 images at a time.")}else{if(I>200){var K=confirm("you have selected over 200 pages. This will take some time to prepare and download. Click OK if you wish to continue or Cancel to refine you request.");if(K){if(F){showProgressBarPanel(A,E)}B.submit()}}else{if(F){showProgressBarPanel(A,E)}B.submit()}}}}function postForMultipleDesktopReports(D){var C=0;var A;var B=null;if(D==null){alert("no company selected.");return }if(D.MOMENTO_KEY.length==null){B=new Array(D.MOMENTO_KEY)}else{B=D.MOMENTO_KEY}if(formHasSelectedCheckBoxes(B)){for(A=0;A<B.length;A++){if(B[A].checked==true){C++}}D.action="/orderOrderable.do";D.submit()}}function postForFilingHist(B,A){A.action="/companyFilingHist.do";A.company_key.value=B;A.submit()}function postForCompanyProductList(F,A,C,E,B,H,G,D){D.action=G;D.company_key.value=F;
D.entity_name.value=A;if(D.duns_number!=null){D.duns_number.value=C}D.country_id.value=E;D.user_id.value=B;D.service_id.value=H;D.submit()}function postForCreateCustomPackage(E){var B=document.getElementsByName("name");if(B[0].value==null||B[0].value=="Undefined"||B[0].value==""){alert("specify a package name.");return }E.product_code.value=E.product_code.value.toUpperCase();var A=document.getElementsByName("product_code");if(A[0].value==null||A[0].value=="Undefined"||A[0].value==""||!A[0].value.match(/^[A-Z][A-Z][A-Z]$/)){alert("specify a valid acronym: a three-letter code in upper case.");return }var D=document.getElementsByName("position");var C=0;for(i=0;i<D.length;i++){if(D[i].disabled==false){C++;if(D[i].options[D[i].selectedIndex].value==-1){alert("you need to specify a position for each included package element.");return }}}if(C==0){alert("you need to include at least one element.");return }var F=C;for(i=0;i<D.length;i++){if(D[i].disabled==false&&D[i].options[D[i].selectedIndex].value>=C){alert("make sure that the positions of the elements have correct values. \nIf you include 4 package elements, the only allowed position values are 1, 2, 3 and 4.");return }if(D[i].disabled==false){for(j=i+1;j<D.length;j++){if(D[j].disabled==false&&D[i].options[D[i].selectedIndex].value==D[j].options[D[j].selectedIndex].value){alert("one or more position values are the same. \nMake sure that no package elements have the same position.");return }}}}E.favourite.value=E.favouritePackage.checked;E.submit()}function postForOrderCustomPackage(D,F,A,E){var B=document.getElementsByName("position");var I=0;for(i=0;i<B.length;i++){if(B[i].disabled==false){I++;if(B[i].options[B[i].selectedIndex].value==-1){alert("you need to specify a position for each included package element.");return }}}if(I==0){alert("you need to include at least one element.");return }var G=I;for(i=0;i<B.length;i++){if(B[i].disabled==false&&B[i].options[B[i].selectedIndex].value>=I){alert("make sure that the positions of the elements have correct values. \nIf you include 4 package elements, the only allowed position values are 1, 2, 3 and 4.");
return }if(B[i].disabled==false){for(j=i+1;j<B.length;j++){if(B[j].disabled==false&&B[i].options[B[i].selectedIndex].value==B[j].options[B[j].selectedIndex].value){alert("one or more position values are the same. \nMake sure that no package elements have the same position.");return }}}}var C=document.getElementsByName("contained_products_id");var K=new Array();for(i=0;i<C.length;i++){if(C[i].checked){var H=B[Math.ceil(i/2)].options[B[Math.ceil(i/2)].selectedIndex].value;K[H]=C[i].value}}var J="";for(i=0;i<K.length;i++){if(J==""){J=K[i]}else{J+="."+K[i]}}D.MOMENTO_KEY.value=D.MOMENTO_PREFIX.value+"cmps_product_ids="+J;if(F){showProgressBarPanel(A,E)}D.submit()}function postForOrderCustomPackageDragDrop(D,F,B,E){var J=document.getElementsByClassName("rowSubSec");var C=document.getElementsByClassName("subSectionCheckbox");var K=document.getElementsByClassName("inputCheckbox");var G=0;var L=new Array();var H=0;var I="";C.each(function(M){if(M.checked){if(I==""){I=M.value}else{I+="."+M.value}}});D.MOMENTO_KEY.value=D.MOMENTO_PREFIX.value+"cmps_product_ids="+I;var A=false;C.each(function(M){if(M.value!="23501"){A=A||M.checked}});if(!A){alert("You need to include at least one element.");return }if(F){showProgressBarPanel(B,E)}D.submit()}function selectCustomPackage(C,A){var F;var I=0;var D=0;var H;var E;var G;var B=0;for(F=0;F<A.elements.length;F++){if(A.elements[F].name=="contained_products_id"&&A.elements[F].value==coverPageProduct){E=A.elements[F];D=1}if(A.elements[F].name=="position"&&D==1){G=A.elements[F];D=0}if((F>0)&&(A.elements[F].name=="contained_products_id")&&(A.elements[F-1].name=="contained_products_id")&&(A.elements[F-1].checked==true)){B++}if(A.elements[F].name=="contained_products_id"&&A.elements[F].value==C){I=1;H=A.elements[F].checked;if(H){if(F>0&&A.elements[F-1].name=="contained_products_id"){A.elements[F-1].checked=0}else{if(A.elements[F+1].name=="contained_products_id"){A.elements[F+1].checked=0}}}}if(A.elements[F].name=="position"&&I==1){A.elements[F].disabled=!H;
I=0}}if(B>0){E.checked=1;G.disabled=0}}function postForCompanyDetails(B,A){A.action="/companyDetails.do";A.company_key.value=B;A.submit()}function postForCompanyResults(B,A){A.perform_action_on_current_search.value=true;if(A.previous_index){A.previous_index.value=A.from_index.value}if(A.clicked_button){A.clicked_button.value=""}A.from_index.value=B;A.submit()}function postForImagePaging(C,B){var A=B.elements;for(i=0;i<A.length;i++){if(A[i].type=="checkbox"&&A[i].checked){alert("one or more documents have been selected; download these before proceeding to a different page of images");return }}B.action="/companyImagesPaged.do";B.perform_action_on_current_search.value=true;if(B.previous_index){B.previous_index.value=B.from_index.value}B.from_index.value=C;B.submit()}function postForSortedCompanyResults(C,D,A,B){B.perform_action_on_current_search.value=true;if(B.previous_index){B.previous_index.value=B.from_index.value}if(B.clicked_button){B.clicked_button.value=""}B.from_index.value=C;B.sort_on.value=D;B.sort_order.value=A;B.submit()}function postForInternationalCompanyResults(B,C,A){A.perform_action_on_current_search.value=true;if(A.previous_index){A.previous_index.value=A.from_index.value}if(A.clicked_button){A.clicked_button.value=""}A.from_index.value=B;A.direction.value=C;A.submit()}function postToPageResults(B,A){if(A.previous_index){A.previous_index.value=A.from_index.value}A.from_index.value=B;A.submit()}function postToAdvancedPageResults(B,A){if(A.previous_index){A.previous_index.value=A.from_index.value}A.from_index.value=B;A.action="/advancedSearchResults.do";A.submit()}function postForSortedSearchResults(C,D,A,B){if(B.previous_index){B.previous_index.value=B.from_index.value}B.from_index.value=C;B.sort_on.value=D;B.sort_order.value=A;B.action="/advancedSearchResults.do";B.submit()}function postForShowOfflineInternational(D,B,A,F,E,C){C.action=E;C.country_id.value=F;C.company_key.value=D;C.company_name.value=B;C.search_address.value=A;C.submit()}function postToDisplayInternationalSearch(A,B){document.internationalSearch.country_id.value=A;
document.internationalSearch.entity_name.value=B;document.internationalSearch.submit()}function postForCompanyIdentification(E,B,A,D,C){if(D=="true"){C.action="/freeCompanyIdentification.do"}else{C.action="/companyIdentification.do"}C.company_key.value=E;C.product_id.value=B;C.entity_name.value=A;C.submit()}function postForMailboxItem(B,A){form.action="/internationalMailboxItem.do";form.company_key.value=B;form.entity_name.value=A;form.submit()}function postForInternationalCompanyIdentification(H,F,M,C,N,L,I,B,G,E,K,J,D,A){if(E=="true"){A.action="/freeCompanyIdentification.do"}else{A.action="/companyIdentification.do"}A.company_key.value=H;A.product_id.value=F;A.country_for_display.value=M;A.country_id.value=M;A.postcode.value=C;A.entity_name.value=N;A.address.value=L;A.town.value=I;A.area.value=B;A.postcode.value=G;A.duns_number.value=H;A.tel_number.value=K;A.trading_style.value=J;A.branch_status.value=D;A.submit()}function postForInternationalSearchAndID(C,F,E,A,B,D){D.duns_number.value=C;D.country_id.value=F;D.country_for_display.value=E;D.user_id.value=A;D.service_id.value=B;D.submit()}function postForInternationalSingleProduct(G,E,B,F,A,D,H,C){C.entity_name.value=E;C.company_key.value=G;C.postcode.value=B;C.country_for_display.value=F;C.product_id.value=D;if(A&&A!=""){C.reportUri.value=A}else{C.reportUri.value=document.getElementById(G).value}C.MOMENTO_KEY.value=H;C.submit()}function postForInternationalMailboxReportItem(A,E,C,B,F,D){D.user_id.value=A;D.company_key.value=E;D.company_name.value=C;D.product_id.value=B;D.country_for_display.value=F;D.submit()}function postForOrderedProduct(E,F,B,D,A,C){C.action="/retrieveDeliverable.do";C.product_type.value=E;C.order_id.value=F;C.orderline_id.value=B;C.download_action.value=D;C.action_input.value=A;C.submit()}function postForEditPendingOrder(F,C,B,E,A,D){D.order_id.value=F;D.orderline_id.value=C;D.pagination_offset.value=B;D.sort_on.value=E;D.sort_order.value=A;D.submit()}function postToOrderReport(B,A){A.action="/orderableController.do";
A.MOMENTO_KEY.value=B;A.submit()}function postForLastCompanySearch(A){A.action="/lastCompanySearch.do";A.submit()}function postToUpdateOrder(C,B,D){if(B=="update"){C.orderline_cancel.value="";C.submit()}else{if(B=="cancel"){var A=confirm("this will cancel the item; do you wish to proceed?");if(A){C.orderline_cancel.value=D;C.submit()}}}}function postForCompleteOrder(C,B,A){setAutoCatalogParam(C,B,A)}function postForMultiListOrder(C,B,A){setAutoCatalogParam(C,B,A)}function setAutoCatalogParam(C,B,A){var D=B;if(A=="prompt"&&B==false){D=confirm("add products to my store?")}C.add_to_auto_catalogue_flag.checked=D;if(D){C.auto_catalogue_checked.value=1}else{C.auto_catalogue_checked.value=0}}function postForAddToMultiList(A){if(A==null){alert("no items are available to be added.");return }if(formHasSelectedCheckBoxes(A.elements)){A.clicked_button.value="multi-list";A.submit()}}function postForAddToAnalysisList(F){if(F==null){alert("no items are available to be added.");return }var B=F.analysis_list_max_items_pref_value.value;var D=getSelectedCheckBoxCount(F.elements);var C=F.current_analysis_list_count.value;var A=Number(B);var E=Number(D)+Number(C);if(E>A){alert("you can add a maximum of "+B+" companies to your analysis list");return }if(F==null){alert("no items are available to be added.");return }if(Number(D)>Number(0)){F.clicked_button.value="analysis-list";F.submit()}else{alert("Please select at least one item from the results.");return }}function postForAddToAnalysisListFromAdvSearchResults(D){var G=D.analysis_list_max_items_pref_value.value;var B=getSelectedCheckBoxCount(D.elements);var C=D.current_analysis_list_count.value;var E=Number(G);var H=Number(B)+Number(C);var J=parseInt(D.num_result_set_selected_rows.value);var I=parseInt(D.num_selected_on_page.value);var A=getCurrentlySelected(D);var F=(J-I)+A;if(H>E||F>E){alert("you can add a maximum of "+G+" companies to your analysis list");return }if(D==null){alert("no items are available to be added.");return }if(Number(B)>Number(0)){D.clicked_button.value="analysis-list";
D.submit()}else{alert("Please select at least one item from the results.");return }}function postForAddToLedger(A){if(A==null){alert("no items are available to be added.");return }if(formHasSelectedCheckBoxes(A.elements)){A.clicked_button.value="ledger-search-results";A.submit()}}function postForAddToLedgerFromCompanyId(A){if(A==null){alert("no items are available to be added.");return }A.submit()}function postForUpdateLedgerCreditLimitAndNotes(B){if(B==null){alert("no items are selected.");return }var A=getLedgerSelectedItems(B);if(A>0){B.clicked_button.value="update";B.submit()}else{alert("please select at least one item from your ledger.");return }}function postToDeleteFromLedger(B){if(B==null){alert("no items are selected.");return }var A=getLedgerSelectedItems(B);if(A>0){B.clicked_button.value="delete";B.submit()}else{alert("please select at least one item from your ledger.");return }}function postForReportOnLedgerSelected(B){if(B==null){alert("no items are selected.");return }var A=getLedgerSelectedItems(B);if(A>0){B.clicked_button.value="report_on_selected";B.submit()}else{alert("please select at least one item from your ledger.");return }}function postForAddToMonitoringLedgerSelected(B){if(B==null){alert("no items are selected.");return }var A=getLedgerSelectedItems(B);if(A>0){B.clicked_button.value="monitoring";B.submit()}else{alert("please select at least one item from your ledger.");return }}function postForInternationalMailbox(A,C,B){B.user_id.value=A;B.country_for_display.value=C;B.submit()}function postForInternationalMailboxed(A){A.action="/checkInternationalMailbox.do";A.submit()}function postForMultipleReports(A){if(A==null){alert("no items are available for multiple reports.");return }A.action="/multipleReport.do";A.submit()}function postForAddToMultipleReportOrdering(A,B){if(A==null){alert("no items are available to be added.");return }if(formHasAtLeastTwoCheckedBoxes(A.elements)){A.clicked_button.value="multiple";showProgressBarPanel(self,B);A.submit()
}}function postForAddToMonitoring(A){if(A==null){alert("no items are available to be added.");return }if(formHasSelectedCheckBoxes(A.elements)){A.clicked_button.value="monitoring";A.submit()}}function postToAddEntitiesToMonitoringGroup(D,C){var F=C.entity_key;var B=0;var A;for(A=0;A<F.length;A++){if(F[A].checked){++B}}var E=(B-D);if(E>0){alert("monitoring entity limit exceeded: please deselect "+E+" and try again")}else{C.submit()}}function toggleMonitoringGroupCombo(E,C){var A=E.group_id;var B=E.entity_name;var F=E.entity_type;var D;for(D=0;D<A.length;D++){if(A[D].id==C){A[D].disabled=!A[D].disabled;B[D].disabled=!B[D].disabled;F[D].disabled=!F[D].disabled}}}function postToMoveEntitiesToGroup(A){performActionOnSelectedMonitoringEntities(A,"/moveEntities.do")}function postToDeleteEntitiesFromGroup(A){performActionOnSelectedMonitoringEntities(A,"/deleteEntities.do")}function performActionOnSelectedMonitoringEntities(B,C){var D=0;var A=B.monitoring_entity_id.length;if(A!=null){for(index=0;index<A;index++){if(B.monitoring_entity_id[index].checked){D=D+1}}}else{if(B.monitoring_entity_id.checked){D=1}}if(D>0){B.action=C;B.submit()}}function postToPersistMonitoringGroup(A){for(index=0;index<A.notification_category_active.length;index++){var B=A.notification_category_active_cb[index].checked;A.notification_category_active[index].value=B}A.submit()}function postToDisplayHistoricNotificationsForEntity(A,B){B.action="/displayNotifications.do";B.from_mon_entity_name.value=A;B.submit()}function doSort(C,A,B){B.sort_on.value=C;B.sort_order.value=A;B.submit()}function postForReportAlert(E,B,A,D,C){alert(E);alert(B);alert(A);alert(D)}function postFormForDisplayPage(A){form.action="/displayPage.do";form.page_id=A}function postForLogout(A,B){var C=confirm("are you sure you want to leave?");if(C){B.user_id.value=A;B.action="/logout.do";B.submit()}else{alert("logout cancelled.")}}function postForProductDeliveryMethods(A){A.action="/viewProdDeliveryPrefs.do";A.submit()}function postForChangeChargeReference(B,A){B.action="/orderReferenceEdit.do";
B.order_reference_1.value=A;B.submit()}function postToOrderFromPlacementPage(A,B){if(validateSupplementaryInformation(A)){setAdditionalLineItemData(A,A.cover_page,"cover_page");setAdditionalLineItemData(A,A.company_report,"company_report");setAdditionalLineItemData(A,A.filing_history,"filing_history");selectAllItems(A.EmailRecipients);showProgressBarPanel(self,B);A.submit()}}function postToAddRecipientFromPlacementPage(C){var D=C.max_num_of_recipients.value;var A=C.EmailRecipients.length;if(A>=D){alert("you have already selected your maximum number of recipients.");return }setAdditionalLineItemData(C,C.cover_page,"cover_page");setAdditionalLineItemData(C,C.company_report,"company_report");setAdditionalLineItemData(C,C.filing_history,"filing_history");selectAllItems(C.EmailRecipients);var B=((C.add_to_auto_catalogue_flag!=null)&&(C.add_to_auto_catalogue_flag.checked));if(B){C.auto_catalogue_checked.value=1}else{C.auto_catalogue_checked.value=0}C.recipient_id.value="";C.recipient_action_type.value="order_placement_add";C.action="displayAddUpdateOrderRecipient.do";C.submit()}function postToAddRecipientFromNotificationsPage(C){var D=C.max_num_of_recipients.value;var A=C.EmailRecipients.length;if(A>=D){alert("you have already selected your maximum number of recipients.");return }selectAllItems(C.EmailRecipients);var B=((C.add_to_auto_catalogue_flag!=null)&&(C.add_to_auto_catalogue_flag.checked));if(B){C.auto_catalogue_checked.value=1}else{C.auto_catalogue_checked.value=0}C.recipient_action_type.value="monitoring_notifications";C.action="displayAddUpdateOrderRecipient.do";C.recipient_id.value="";C.submit()}function postToUpdateRecipientFromNotificationsPage(B,C){var A=document.getElementById("AvailEmailRecs");if(A.selectedIndex==-1){alert("select an available recipient to update.");return }B.recipient_action_type.value="monitoring_notifications";C.value=A.options[A.selectedIndex].value;B.submit()}function postToUpdateRecipientFromPlacementPage(B,C){var A=document.getElementById("AvailEmailRecs");
if(A.selectedIndex==-1){alert("select an available recipient to update.");return }B.recipient_action_type.value="order_placement_update";C.value=A.options[A.selectedIndex].value;B.action="displayAddUpdateOrderRecipient.do";B.submit()}function postToAddRecipientFromInternationalPage(B){var C=B.max_num_of_recipients.value;var A=B.EmailRecipients.length;if(A>=C){alert("you have already selected your maximum number of recipients.");return }B.recipient_id.value="";if((B.recipient_action_type.value=="order_investigation_add")||(B.recipient_action_type.value=="order_investigation_update")){B.recipient_action_type.value="order_investigation_add"}else{B.recipient_action_type.value="order_international_add"}B.action="displayAddUpdateInternationalOrderRecipient.do";B.submit()}function postToUpdateRecipientFromInternationalPage(B,C){var A=document.getElementById("AvailEmailRecs");if(A.selectedIndex==-1){alert("select an available recipient to update");return }if((B.recipient_action_type.value=="order_investigation_add")||(B.recipient_action_type.value=="order_investigation_update")){B.recipient_action_type.value="order_investigation_update"}else{B.recipient_action_type.value="order_international_update"}C.value=A.options[A.selectedIndex].value;B.action="displayAddUpdateInternationalOrderRecipient.do";B.submit()}function clearFormToDefaultsById(D){var A=D.elements;for(var C=0;C<A.length;C++){var B=A[C];if((B.name.length>"reset__".length)&&(B.name.substring(0,7)=="reset__")){clearElementToDefaultById(D,B.name.substring(7),B.value)}}setFocusOnFirstTextField(true)}function clearElementToDefaultById(C,F,I){var E=C.elements;for(var G=0;G<E.length;G++){var D=E[G];if(D.id==F){if((D.type=="text")||(D.type=="textarea")||(D.type=="hidden")||(D.type=="password")){D.value=I}else{if(D.type=="checkbox"){if(I=="checked"){D.checked=true}else{D.checked=false}}else{if(D.type=="select-one"){var A=D.options;for(var H=0;H<A.length;H++){var B=A[H];if(B.value==I){B.selected=true;break}}}else{if(D.type=="radio"){if(I==D.value){D.checked=true
}else{D.checked=false}}}}}}}}function postToClearRecipientFrom(A){clearAllItems(A.EmailRecipients);A.reset()}function clearAndResetOrderPlacementPage(A){postToClearRecipientFrom(A);setRecipientsAndFieldFocus(1,7)}function postForRemoveFromMultiList(A){if(formHasSelectedCheckBoxes(A.elements)){A.action="/removeCompanyFromMultiList.do";A.submit()}}function postForRemoveFromAnalysisList(A){if(formHasSelectedCheckBoxes(A.elements)){A.action="/removeCompanyFromMultiList.do?list_type=analysislist";A.submit()}}function postForDeleteSearchCriterion(B){var E=document.getElementsByName("delete_selected_criterion");var D=0;for(var A=0;A<E.length;A++){if(E[A].checked){var C=document.createElement("input");C.type="hidden";C.name="deleted_form_id";C.value=E[A].value;B.appendChild(C);D++}}if(D==0){alert("please select at least one item to delete")}else{B.action="/deleteSearchCriterion.do";B.submit()}}function checkAllToggle(A,B){var C=document.getElementsByName(A);for(i=0;i<C.length;i++){C[i].checked=B.checked?true:false}}function postForShowMultiListLineItems(B){if(formHasSelectedCheckBoxes(B.elements)){if(B.all_products.selectedIndex==0&&B.fav_products.selectedIndex==0){alert("a favourite or product must be selected.")}else{if(B.current_multilist_basket_size.value==B.allowed_multilist_basket_size.value){alert("your multilist basket is full: you cannot add any more items")}else{if((parseInt(B.current_multilist_basket_size.value)+parseInt(getAddToBasketCount(B)))>parseInt(B.allowed_multilist_basket_size.value)){alert("items cannot be added: your basket has a maximum of "+B.allowed_multilist_basket_size.value+" items")}else{if(B.fav_products.selectedIndex>0){B.action="/showMultiListLineItems.do";var A=B.fav_products.selectedIndex;var C=B.fav_products.options[A].value;B.product_detail.value=C;B.submit()}else{B.action="/showMultiListLineItems.do";var A=B.all_products.selectedIndex;var C=B.all_products.options[A].value;B.product_detail.value=C;B.submit()}}}}}}function getAddToBasketCount(B){var A=0;
for(i=0;i<B.multilist_item.length;i++){if(B.multilist_item[i].checked){A++}}return A}function postForAddToMultiListBasket(A){setMultiListCheckBoxDetails(A);if(validateSupplementaryInformation(A)){A.action="/addToMultiListBasket.do";A.submit()}}function setMultiListCheckBoxDetails(A){setAdditionalLineItemData(A,A.cover_page,"cover_page_check");setAdditionalLineItemData(A,A.company_report,"company_report_check");setAdditionalLineItemData(A,A.filing_history,"filing_history_check");setAdditionalLineItemData(A,A.mortgage_details,"mortgage_details_check")}function setAdditionalLineItemData(B,A,C){for(index=0;index<B.elements.length;index++){if(B.elements[index].name==C){if(B.elements[index].type=="checkbox"){checked=B.elements[index].checked;id=B.elements[index].id;if(A.length!=null){A[id].value=checked}else{A.value=checked}}}}}function postForUpdateMultiListBasket(A){setMultiListCheckBoxDetails(A);if(validateSupplementaryInformation(A)){A.action="/updateMultiListBasket.do";A.submit()}}function postForEditMultiListBasket(A){if(getSelectedCheckBoxCount(A.elements)!=1){alert("you must select a basket item to edit.")}else{A.action="/editMultiListBasket.do";A.submit()}}function postForRemoveFromMultiListBasket(A){if(formHasSelectedCheckBoxes(A.elements)){A.action="/removeFromMultiListBasket.do";A.submit()}}function postForCreateMultiListOrder(A){A.action="/showMultiListOrderDetails.do";A.submit()}function postForMultiOrderLineDownload(B,A,E){E.action="/multiOrderDownload.do";E.user_action.value=B;E.forward_target.value=A;var D=getSelectedCheckBoxCount(E.elements);if(D==null||Number(D)==Number(0)){alert("Please select at least one item from the orders list.");return }if(B=="clear_multi_download"){var C;if(A=="pending"||A=="ledger"){if(E.multi_orderstatus_download_item){E.multi_orderstatus_download_item.checked=false;for(C=0;C<E.multi_orderstatus_download_item.length;C++){E.multi_orderstatus_download_item[C].checked=false}}}else{if(E.multi_orderhistory_download_item){E.multi_orderhistory_download_item.checked=false;
for(C=0;C<E.multi_orderhistory_download_item.length;C++){E.multi_orderhistory_download_item[C].checked=false}}}}E.submit()}function pageOrderSearchResults(B,C,A){if(A.previous_index){A.previous_index.value=A.from_index.value}A.from_index.value=B;A.user_action.value=C;A.submit()}function pageListOfUsersResults(B,A){if(A.previous_index){A.previous_index.value=A.from_index.value}A.from_index.value=B;A.submit()}function pageAllOrderSearchResults(B,A){if(A.previous_index){A.previous_index.value=A.from_index.value}A.from_index.value=B;A.submit()}function postToFilterOrderSearchResults(A){A.filter_defined.value="true";A.submit()}function postToRefreshSearchResults(C,A,B){B.sort_on.value=C;B.sort_order.value=A;B.user_action.value="status";B.submit()}function doSortOrders(E,C,A,D){var B;D.user_action.value=E;if(D.sort_on.length==null){D.sort_on.value=C;D.sort_order.value=A}else{for(B=0;B<D.sort_on.length;B++){if(D.sort_on.options[B].value==C){D.sort_on.selectedIndex=B}}for(B=0;B<D.sort_order.length;B++){if(D.sort_order.options[B].value==A){D.sort_order.selectedIndex=B}}}D.submit()}function doShowSingleOrderById(B,A){A.customer_id.value="";A.customer_cd.value="";A.date_DD.value="";A.date_MM.value="";A.date_YYYY.value="";A.order_line_id.value="";A.popes_order_id.value="";A.popes_order_line_id.value="";A.sort_on.value="";A.sort_order.value="";A.order_id.value=B;A.pagination_offset.value="";A.submit()}function doShowOrdersForCustomer(B,A){A.customer_id.value=B;A.submit()}function postToDisplayRole(C,B){var A=document.getElementById(B);C.role_id.value=A.options[A.selectedIndex].value;C.action="/displayRole.do";C.submit()}function postToAction(B,A){B.action=A;B.submit()}function postToCrudDeliveryNote(A,B){B.operation.value=A;B.submit()}function postToEditDeliveryNoteMessage(A,C,B){B.operation.value=A;B.delivery_note_id.value=C;B.submit()}function postToDisplayUnit(A,B){B.unit_id.value=A;B.submit()}function postToDisplayRole(A,B){B.role_id.value=A;B.submit()}function postToDisplayUsers(D,A,B,C){C.customer_id.value=D;
C.customer_name.value=A;C.unit_id.value=B;C.submit()}function postForUserInput(A,B){B.unit_id.value=A;B.submit()}function postToListUsersfromUnit(C,A,B){B.unit_name.value=C;B.unit_id.value=A;B.submit()}function postToDisplayPrivilege(A,B){B.privilege_id.value=A;B.submit()}function postToEditPreferenceDefault(B,A,C){C.preference_id.value=B;C.privilege_id.value=A;C.submit()}function postForEditRecipient(B,A){A.recipient_id.value=B;A.submit()}function selectPrimaryRecipient(A){A.primary_recipient.value=A.set_default.checked}function postToSimulatePopesLoop(C,B,A){A.order_id.value=C;A.is_custom.value=B;A.submit()}function postForDeleteRecipients(A){A.action="/deleteRecipients.do";A.submit()}function postForUpdatePrimaryRecipient(B,A){A.action="/setPrimaryRecipient.do";A.recipient_id.value=B;A.submit()}function postForPasswordAssistant(A){A.action="/passwordAssistant.do";A.submit()}function postToMoveFavourite(C,B,A){C.action="/moveFavourite.do";C.favourite_id.value=B;C.move_action.value=A;C.submit()}function postForDeleteUsers(B,A){if(confirm("are you sure you wish to delete the selected users?")){if(formHasSelectedCheckBoxes(B.elements)){B.action="/deleteUser.do";B.forward_action.value=A;B.submit()}}}function postForPurgePreferenceCache(B,A){if(formHasSelectedCheckBoxes(B.elements)){B.action="/purgePreferences.do";B.is_paginated.value="true";B.forward_action.value=A;B.submit()}}function postForAssignUserToUnit(C,A,B){C.user_id.value=A;C.unit_id.value=B;C.submit()}function postForConsumerSearch(A){var B=A.birthdate.value;if(B!=""){A.birthdate_day.value=B.substring(0,2);A.birthdate_month.value=B.substring(3,5);A.birthdate_year.value=B.substring(6,10)}A.postcode.value=A.postcode.value.toUpperCase();A.submit()}function postForConsumerPicklist(B,A){B.picklist_index.value=A;B.submit()}function postForDeleteAvailableRecipient(E,B,C){var A=document.getElementById("AvailEmailRecs");if(A.selectedIndex==-1){alert("select an available recipient to delete.");return }var D=A.options[A.selectedIndex].value;
if(C==D){alert("you cannot delete your primary recipient.");return }B.value=A.options[A.selectedIndex].value;E.submit()}function postForFilingHistoryPage(B,A){B.direction.value=A;B.submit()}function keyfilingsMultipleReport(A,G,B,F,E,D){var C=document.getElementById("imageSearchForm");C.target_date_DD.value=A;C.target_date_MM.value=G;C.target_date_YYYY.value=B;C.company_key.value=F;C.entity_name.value=E;C.country_id.value=D;C.submit()}function doAddToLedger(D){var A=document.getElementsByClassName("credit_limit");for(var C=0;C<A.length;C++){var B=""+A[C].value;if(B!=""){B=removeChars(B);A[C].value=parseInt(B)}}checkCreditLimit(D)}function removeChars(C){temp=""+C;out="";for(var B=0;B<C.length;B++){pos=temp.charAt(B);var A=parseInt(pos);if(isNaN(A)){}else{out=out+A}}return out}function doUpdateCreditLedger(D){var A=document.getElementsByClassName("credit_limit");for(var C=0;C<A.length;C++){var B=""+A[C].value;if(B!=""){B=removeChars(B);A[C].value=parseInt(B)}}checkCreditLimit(D)}function checkCreditLimit(A){if(checkIntegers(A,"credit_limit[]")){A.submit()}else{alert("all credit limits must be integers, or left blank.")}}function addToLedger(B,A){selectOrDeselectAll(B,false);clearElementToDefault(B,"selected"+A,"checked");postForAddToLedger(B)}function postToStakeholderSearchMinMaxAge(H,F){var E=H.Min.value;var C=H.Max.value;if(!validateMinMaxAgeRange(E,C)){if(F){return false}else{return }}if(E!=""){if(checkIfContainsDecimalPlace(E)){alert("search values must not contain decimal points");if(F){return false}else{return }}if(!isNumber(E)){if(F){return false}else{return }}var A=new Date();var G=A.getFullYear()-E;A.setFullYear(G);var B=A.getDate();A.setDate(B);H.to_birthdate_day.value=A.getDate();H.to_birthdate_month.value=A.getMonth()+1;H.to_birthdate_year.value=A.getFullYear()}if(C!=""){if(checkIfContainsDecimalPlace(C)){alert("search values must not contain decimal points");return false}if(!isNumber(C)){if(F){return false}else{return }}C++;var D=new Date();var G=D.getFullYear()-C;
D.setFullYear(G);var B=D.getDate()+1;D.setDate(B);H.from_birthdate_day.value=D.getDate();H.from_birthdate_month.value=D.getMonth()+1;H.from_birthdate_year.value=D.getFullYear()}H.submit()}function checkListOfNumbersForm(B){if(B.preserve_list_of_numbers_order.value=="true"){var C=B.company_keys.value;var A=new Array();A=C.split(/[\w]+/);if(A.length-1==0){alert("You must enter at least one number to search on!");return }else{if(A.length-1>B.max_results_per_page.value){alert("You can only enter a maximum of "+B.max_results_per_page.value+" numbers!");return }}}B.submit()}function setBirthDateFields(B){var A=B.birthdate.value;if(A!=""){B.birthdate_day.value=A.substring(0,2);B.birthdate_month.value=A.substring(3,5);B.birthdate_year.value=A.substring(6,10)}}function postToStakeholderSearch(A,E){var G=A.stakeholder_search_type.selectedIndex;var L=A.stakeholder_search_type.options[G].value;if(L=="director"){A.director.value="true"}else{if(L=="member"){A.member.value="true"}else{if(L=="shareholder"){A.shareholder.value="true"}else{if(L=="ownerManager"){A.ownerManager.value="true"}else{if(L=="proprietor"){A.proprietor.value="true"}else{if(L=="stakeholder"){A.stakeholder.value="true"}}}}}}if(document.getElementById("dob_selected").checked){var C=A.from_birthdate.value;var J=A.to_birthdate.value;if(!validateDateRange(C,J)){if(E){return false}else{return }}if(C!=""){A.from_birthdate_day.value=C.substring(0,2);A.from_birthdate_month.value=C.substring(3,5);A.from_birthdate_year.value=C.substring(6,10)}if(J!=""){A.to_birthdate_day.value=J.substring(0,2);A.to_birthdate_month.value=J.substring(3,5);A.to_birthdate_year.value=J.substring(6,10)}}else{if(document.getElementById("age_selected").checked){var F=A.Min.value;var H=A.Max.value;A.min_age.value=F;A.max_age.value=H;if(!validateMinMaxAgeRange(F,H)){if(E){return false}else{return }}if(F!=""){if(checkIfContainsDecimalPlace(F)){alert("search values must not contain decimal points");if(E){return false}else{return }}if(!isNumber(F)){if(E){return false
}else{return }}var D=new Date();var I=D.getFullYear()-F;D.setFullYear(I);var B=D.getDate();D.setDate(B);A.to_birthdate_day.value=D.getDate();A.to_birthdate_month.value=D.getMonth()+1;A.to_birthdate_year.value=D.getFullYear()}if(H!=""){if(checkIfContainsDecimalPlace(H)){alert("search values must not contain decimal points");return false}if(!isNumber(H)){if(E){return false}else{return }}H++;var K=new Date();var I=K.getFullYear()-H;K.setFullYear(I);var B=K.getDate()+1;K.setDate(B);A.from_birthdate_day.value=K.getDate();A.from_birthdate_month.value=K.getMonth()+1;A.from_birthdate_year.value=K.getFullYear()}}}if(document.stakeholderSearchForm.company_postcode&&document.stakeholderSearchForm.include_republic_of_ireland){if(document.stakeholderSearchForm.include_republic_of_ireland.checked){document.stakeholderSearchForm.company_postcode.value=""}}A.submit()}function resultFormatsDelete(A){A.action="/deleteResultFormats.do";A.submit()}function submitForAdvancedSearchExport(B,A){var L=parseInt(B.max_rows.value);var G=parseInt(B.max_cols.value);var D=parseInt(B.num_cols.value);var F=parseInt(B.num_rows.value);var M=parseInt(B.num_result_set_rows.value);var K=parseInt(B.num_result_set_selected_rows.value);var I=parseInt(B.num_selected_on_page.value);var E=getCurrentlySelected(B);var H=(K-I)+E;var J;if(H>0){J=H}else{J=M}var C=B.large_export_threshold.value;if(J>L){alert("The export limit is "+L+" companies, please deselect "+(J-L)+" companies in the results and try exporting again")}else{if(D>G){alert("Cannot export results. There are too many columns in the result format.")}else{B.result_format_id.value=A;B.total_export_rows.value=J;B.action="/exportAdvancedSearchResultsAsXLS.do";if(J>C){if(confirm("WARNING: this is a large export and will be generated in the background.\n\nWhen complete you can retrieve it from your exports section.\n\nDo you want to continue?")){B.submit()}}else{B.submit()}}}}function getCurrentlySelected(E){var B=0;var A=E.elements;for(var D=0;D<A.length;D++){var C=A[D];
if(C.type=="checkbox"&&C.name=="selection_box_selected"){if(C.checked==true){B=B+1}}}return B}function submitToSaveResultFormat(A){A.action="/displayResultsFormatForEditing.do";A.submit()}function postListForm(C,A,B){if(C.options.length==0){alert("At least one item must be selected.")}else{selectAllItems(C);postToAction(A,B)}}function postToExportLedger(B){if(B==null){alert("no items are selected.");return }var C=parseInt(B.large_export_threshold.value);var A=getLedgerExportItems(B);B.clicked_button.value="export";B.ledger_export_rows.value=A;B.action="/retrieveLedger.do";if(A>C){if(confirm("WARNING: this is a large export and will be generated in the background.\n\nWhen complete you can retrieve it from your exports section.\n\nDo you want to continue?")){B.submit()}}else{B.submit()}}function postToSaveLedger(B){if(B==null){alert("no items are selected.");return }var C=parseInt(B.large_export_threshold.value);var A=getLedgerExportItems(B);B.ledger_export_rows.value=A;B.clicked_button.value="save";B.action="/retrieveLedger.do";B.submit()}function getLedgerExportItems(C){var D=parseInt(C.ledger_size.value);var B=getLedgerSelectedItems(C);var A;if(B>0){A=B}else{A=D}return A}function getLedgerSelectedItems(C){var A=parseInt(C.ledger_selections.value);var E=parseInt(C.num_selected_on_page.value);var D=getCurrentlySelected(document.paginationResults);var B=(A-E)+D;return B}function postForSortedLedger(C,A,B){B.action="/retrieveLedger.do";B.sort_on.value=C;B.sort_order.value=A;B.clicked_button.value="";B.submit()}function postFormToUpdateIPAuthentication(D){var E=document.getElementById(D);var H=document.getElementById("ipAddressesSelectionBox").options;var C=document.getElementById("emailSuffixesSelectionBox").options;var F=document.getElementById("defaultUnit");var A=F.selectedIndex;for(var B=0;B<H.length;B++){var G=document.createElement("input");G.type="hidden";G.name="customer_ip_addresses";G.value=H[B].value;E.appendChild(G)}for(var B=0;B<C.length;B++){var G=document.createElement("input");
G.type="hidden";G.name="customer_email_suffixes";G.value=C[B].value;E.appendChild(G)}var G=document.createElement("input");G.type="hidden";G.name="default_ip_unit_id";G.value=F.options[A].value;E.appendChild(G);E.submit()}function validateIPAddress(B){var D=document.getElementById("IPaddressFirstGroup").value;var F=document.getElementById("IPaddressSecondGroup").value;var A=document.getElementById("IPaddressThirdGroup").value;var C=document.getElementById("IPaddressFourthGroup").value;var E=D+"."+F+"."+A+"."+C;document.getElementById("IPaddressToAdd").value=E;if(D>255||F>255||A>255||C>254||D==0||isNaN(D)||isNaN(F)||isNaN(A)||isNaN(C)||D==""||F==""||A==""||C==""||D==null||F==null||A==null||C==null){alert("the ip address entered is not in the correct format");return false}return true}function checkStrategyNameEntered(A){if(removeWhiteSpace(A.strategy_name.value)==""){alert("please enter a strategy name");return false}else{return true}}function postToDownloadItem(A,B){B.action="/downloadExportable.do";B.download_id.value=A;B.submit()}function postFormToDeleteExport(A){if(getSelectedCheckBoxCount(A.elements)>0){A.submit()}else{alert("Please select at least one item to delete")}}function validateDynamicData(A){if(A.title.value.length==0){alert("please enter a title");return false}if(A.main_text.value.length==0){alert("please enter main text");return false}return true}function validateMetaTag(A){if(A.new_name.value.length==0){alert("please enter a meta tag name");return false}if(A.new_value.value.length==0){alert("please enter a meta tag value");return false}return true}function postToLedgerSection(C,A,D,B){if(B.previous_index){B.previous_index.value=B.from_index.value}B.clicked_button.value="";B.from_index.value=C;B.report_data_section_id.value=A;B.first_character_filter.value=D;B.action="/retrieveLedger.do";B.submit()}function postToPageLedgerResults(B,A){if(A.previous_index){A.previous_index.value=A.from_index.value}A.clicked_button.value="";A.from_index.value=B;A.submit()
}function submitFormToConsumerAddressLinkSearch(B,A){var C=document.getElementById(B);var D=document.createElement("input");D.type="hidden";D.name="nav_link_id";D.value=A;C.appendChild(D);C.submit()}function postToUpdatePersonalDetails(A){if(containsDataAndNonDefaultValue("Title")&&containsDataAndNonDefaultValue("First Name")&&containsDataAndNonDefaultValue("Surname")&&containsDataAndNonDefaultValue("Email address")&&containsDataAndNonDefaultValue("Address Line 1")&&containsDataAndNonDefaultValue("Address Line 2")&&containsDataAndNonDefaultValue("Town")&&containsDataAndNonDefaultValue("County")&&containsDataAndNonDefaultValue("Postcode")&&checkPasswordsMatch(A.password.value,A.confirm_password.value)){A.submit()}}function checkPasswordsMatch(B,A){if(B!=A){alert("passwords do not match");return false}return true}function clearPersonalDetailsForm(A){A.title.value="Title";A.firstname.value="";A.lastname.value="";A.email.value="";A.primary_office_country_code.value="44";A.primary_office_area_code.value="";A.primary_office_phone.value="";A.primary_office_address_1.value="";A.primary_office_address_2.value="";A.primary_office_town.value="";A.primary_office_county.value="";A.primary_office_postcode.value="";prePopulatePersonalDetails(A)}function prePopulatePersonalDetails(A){populateWithIdIfBlank("Title");populateWithIdIfBlank("First Name");populateWithIdIfBlank("Surname");populateWithIdIfBlank("Email address");populateWithIdIfBlank("Address Line 1");populateWithIdIfBlank("Address Line 2");populateWithIdIfBlank("Town");populateWithIdIfBlank("County");populateWithIdIfBlank("Postcode")}function populateWithIdIfBlank(A){var B=document.getElementById(A).value;if(B==""||B==null){document.getElementById(A).value=A}}function postToCreditCardPayment(A){if(containsDataAndNonDefaultValue("Title")&&containsDataAndNonDefaultValue("First Name")&&containsDataAndNonDefaultValue("Surname")&&containsDataAndNonDefaultValue("Email address")&&containsDataAndNonDefaultValue("Telephone Number")&&containsDataAndNonDefaultValue("Address Line 1")&&containsDataAndNonDefaultValue("Address Line 2")&&containsDataAndNonDefaultValue("Town")&&containsDataAndNonDefaultValue("County")&&containsDataAndNonDefaultValue("Postcode")&&validateTextField("First Name")&&validateTextField("Surname")&&validateEmailAddress("Email address")&&validateTelephoneNumber("Telephone Number")&&validateAddressLine("Address Line 1")&&validateAddressLine("Address Line 2")&&validateTextField("Town")&&validateTextField("County")&&validatePostcode("Postcode")&&validateSubAmountGreaterThanOrderValue()){A.submit()
}}function validateAddressLine(B){var D=document.getElementById(B).value;var C=/^([0-9A-Za-z\s]+)$/;var A=C.test(D);if(A==false){alert("Please enter a valid value in '"+B+"'.");return false}else{if(D.length>50){alert("The value in the '"+B+"' input box must not be greater than 50 characters.");return false}}return true}function validateEmailAddress(C){var D=document.getElementById(C).value;var B=/^([\w]+)(.[\w]+)*@([\w]+)(.[\w]{2,3}){1,2}$/;var A=B.test(D);if(A==false){alert("please enter a valid email address.")}return A}function validateTelephoneNumber(B){var D=document.getElementById(B).value;var C=/^([0-9\s]+)$/;var A=C.test(D);if(A==false){alert("Please enter a valid telephone number.");return false}else{if(D.length>15){alert("The value in the '"+B+"' input box must not be greater than 15 numeric digits.");return false}}return true}function validateTextField(B){var D=document.getElementById(B).value;var C=/^([A-Za-z\s]+)$/;var A=C.test(D);if(A==false){alert("Please enter a valid value in the '"+B+"' input box.");return false}else{if(D.length>50){alert("The value in the '"+B+"' input box must not be greater than 50 characters.");return false}}return true}function containsDataAndNonDefaultValue(A){var B=document.getElementById(A).value;if(B==""||B==null||B==A){alert("please enter a valid value in the '"+A+"' input box.");return false}return true}function containsIntegerAndNonDefaultValue(A){var B=document.getElementById(A).value;if(B==""||B==null||isNaN(B)||checkIfContainsDecimalPlace(B)){alert("please enter a valid integer value in the '"+A+"' input box.");return false}return true}function validatePostcode(C){var B=document.getElementById(C).value;var D=/[A-Z]{1,2}[0-9]{1,2} ?[0-9][A-Z]{2}/i;var A=D.test(B);if(A==false){alert("Please enter a valid postcode.")}return A}function validateSubAmountGreaterThanOrderValue(){var A=document.getElementById("Add to account (min �50)").value;if(A.charAt(0)=="�"||!isNaN(A.charAt(0))){var B=document.getElementById("order_total").innerHTML;
if(A.charAt(0)=="�"&&parseFloat(B.substring(1))>parseFloat(A.substring(1))){alert("Subscription amount must be equal to or greater than the order total amount of "+B);return false}else{if(!isNaN(A.charAt(0))&&parseFloat(B.substring(1))>parseFloat(A)){alert("Subscription amount must be equal to or greater than the order total amount of �"+B);return false}}}return true}function adjustForPrePay(B){var A=B.preAdjustedAmount.value*0.9;B.subscription_amount.value="�"+A.toFixed(2);document.getElementById("charge_amount").value=A;document.getElementById("vat_message").innerHTML=" Incl VAT & 10% Disc.";document.getElementById("order_total").innerHTML="�"+A.toFixed(2)}function adjustForPAYG(A){var B=A.preAdjustedAmount.value*1;A.subscription_amount.value="Add to account (min �50)";document.getElementById("charge_amount").value=B.toFixed(2);document.getElementById("vat_message").innerHTML=" Incl VAT";document.getElementById("order_total").innerHTML="�"+B.toFixed(2)}function postToRegisterSubscriptionUser(B){var A=document.getElementById("prepay");var C=document.getElementById("paynow");if(!A.checked&&!C.checked){alert("Please select the type of subscription, Pre-pay or Pay as You Go")}else{B.submit()}}function toggleLayerVisibility(A){var B=A.style.visibility;if(B=="hidden"){A.style.visibility="visible";A.style.display="block"}else{A.style.visibility="hidden";A.style.display="none"}}function postForNextFiling(N,O){var R=encodeURIComponent(O);var S=document.getElementById("filingsTable");var D=document.getElementById("loadingDiv");var F="footerContainer"+N;var G="imageKey"+N;var H=document.getElementById(F);var K=document.getElementById(G);var I=document.getElementById("counter");toggleLayerVisibility(K);var L={start:function(V,U){},complete:function(V,U){},success:function(W,U){if(U[0].responseText!==undefined){var X=document.createElement("div");var V="divExpanded"+U[0].tId;X.setAttribute("id",V);X.innerHTML=U[0].responseText;S.appendChild(X);toggleLayerVisibility(H);updateFilingCount()
}toggleLayerVisibility(K)},failure:function(V,U){toggleLayerVisibility(K)},abort:function(V,U){toggleLayerVisibility(K)}};var P=function(U){};var B=function(U){};var E={success:P,failure:B,customevents:{onStart:L.start,onComplete:L.complete,onSuccess:L.success,onFailure:L.failure,onAbort:L.abort},argument:[I]};var M=document.getElementById("company_key").value;var C=document.getElementById("entity_name").value;var T=document.getElementById("country_id").value;var A=encodeURIComponent(C);var Q="entity_name="+A+"&company_key="+M+"&country_id="+T;var J=location.protocol+"//"+location.host+"/filingHistoryPagination.do?"+Q+"&continuation_index="+N+"&continuation_key="+R;YAHOO.util.Connect.asyncRequest("GET",J,E)}function updateFilingCount(){var D=Number(0);var C=document.getElementById("FilingHistoryPage");var B=null;if(C.subSectionCount.length==null){B=new Array(C.subSectionCount)}else{B=C.subSectionCount}for(x_i=0;x_i<B.length;x_i++){D=Number(D)+Number(B[x_i].value)}var A=document.getElementById("divTotalCount");A.innerHTML="items listed: "+D}function postForFilingItemFromList(D,B){var C=null;if(B.MOMENTO_KEY.length==null){C=new Array(B.MOMENTO_KEY)}else{C=B.MOMENTO_KEY}var A;for(A=0;A<C.length;A++){if(C[A].value==D){C[A].checked=true}else{C[A].checked=false}}postForFilingItems(B)}function postForFilingItems(E){var D=0;var B;var C=null;if(E.MOMENTO_KEY.length==null){C=new Array(E.MOMENTO_KEY)}else{C=E.MOMENTO_KEY}if(formHasSelectedCheckBoxes(C)){for(B=0;B<C.length;B++){if(C[B].checked==true){D++}}var A=document.getElementById("warning_items").value;var G=document.getElementById("max_items").value;if(Number(D)>Number(G)){alert("you may only order "+G+" images at a time.");return }else{if(Number(D)>Number(A)){var F=confirm("you have selected over "+A+" items. This will take some time to prepare and download. Click OK if you wish to continue or Cancel to refine your request.");if(F){E.action="/orderableController.do";E.submit()}}else{E.action="/orderableController.do";E.submit()
}}}}function postForSortedFilingHistory(C,A,B){B.sort_on.value=C;B.sort_order.value=A;postForFilingHistoryFilter("",B)}function verifyConformsToPasswordRules(C){var D=document.getElementById(C).value;var B=/.*([A-Za-z][0-9]|[0-9][A-Za-z]).*/;var A=B.test(D);if(D.length<8||!A){alert("passwords must be a minimum of eight characters and contain at least one letter and one number");return false}return true}function postForCompanySearchFromResetPassword(B){var C=document.getElementById("new password").value;var A=document.getElementById("confirm new password").value;if(containsDataAndNonDefaultValue("old password")&&containsDataAndNonDefaultValue("new password")&&containsDataAndNonDefaultValue("confirm new password")&&containsDataAndNonDefaultValue("password reminder")&&verifyConformsToPasswordRules("new password")&&checkPasswordsMatch(C,A)){B.action="/resetPassword.do";B.submit()}}function validateWarrantyAmount(D){var C=document.getElementById(D).value;var B=/^\d{3,6}$/;var A=B.test(C);if(A==false){alert("Please enter a valid valid amount. It should be in pence.")}return A}function postForWarrantyQuotePageFromApplicationForm(B,A){if(containsDataAndNonDefaultValue("user email")&&isValidEmail("user email")&&containsIntegerAndNonDefaultValue("warranty value")&&validateWarrantyValue(B)&&assembleAndValidateBankSortCodeForm(B)&&containsIntegerAndNonDefaultValue("bank account number")&&validateAccountNumber("bank account number")){showProgressBarPanel(A,"#990000");B.action="/requestWarrantyQuote.do";B.submit()}}function isValidEmail(B){var E=document.getElementById(B).value;var D=E.indexOf("@");var C=E.lastIndexOf(".");var A=E.indexOf(" ");if((D<1)||(C<D+2)||(C+2>=E.length)||(A!=-1)){alert("please enter a valid email address.");return false}else{return validateEmailAddress(B)}}function assembleAndValidateBankSortCodeForm(C){var B=C.firstGroup.value;var D=C.secondGroup.value;var A=C.thirdGroup.value;if(B.length<2||D.length<2||A.length<2){alert("bank sort code must be in the format 00-00-00");
return false}else{if(!isNumber(B)||!isNumber(D)||!isNumber(A)){return false}else{C.bank_sort_number.value=B+D+A;return true}}}function validateWarrantyValue(C){var A=C.min_warranty_value.value;var E=C.max_warranty_value.value;var B=C.warranty_value.value;var D=B%10;if(Number(B)>=Number(A)&&Number(B)<=Number(E)&&Number(B%10)==0){return true}else{if(Number(B%10)!=0){alert("Please enter a warranty in multiples of 10")}else{alert("Please enter a warranty value between \u00A3"+A+" and \u00A3"+E)}return false}}function validateAccountNumber(A){var B=document.getElementById(A).value;if(B.length<7||B.length>8){alert("Please enter a valid bank account number. It must be 7 or 8 digits.");return false}return true}function postForDeclineWarranty(C,D){var A=C.decline_reason_select.value;var B=C.other_reason.value;if(A=="other"&&B.length==0){alert("Please enter a reason")}else{if(A=="other"){C.decline_reason.value="other reason - "+B}else{C.decline_reason.value=A}C.action=D;C.submit()}}function postToUpdateTransaxAccount(A){if(containsIntegerAndNonDefaultValue("merchant id")){A.submit()}}function postToUpdateWarranty(B,A){if(B.warranty_application_ids.size==0){B.warranty_application_id.value=B.warranty_application_ids.value;B.renew_fg.value=B.renew_fgs.checked}else{B.warranty_application_id.value=B.warranty_application_ids[A].value;B.renew_fg.value=B.renew_fgs[A].checked}B.submit()};
