﻿function ShowNextPage(){
  HideItem('Page1');
  ShowItem('Page2');
}

function ShowPreviousPage(){
  ShowItem('Page1');
  HideItem('Page2');
}

function ShowForm(){
  ShowNextPage();
  ShowItem('Page1');
  ShowItem('Page2');
  HideItem('btnNext');
  HideItem('HouseNameTextRow');
  HideItem('FindAddressButton');
  HideItem('btnPrevious');
}

function ShowRepaymentPeriod(){
  var intAmount = document.getElementById('Amount').value;
  if(intAmount<1000){
    HideItem('rlblRepaymentPeriods');
    HideItem('RepaymentPeriods');
    ShowItem('MobileNumberRow');
  }else{
    ShowItem('rlblRepaymentPeriods');
    ShowItem('RepaymentPeriods');
    HideItem('MobileNumberRow');
  }
}

function ShowMobileNumber(){
  ShowItem('rlblRepaymentPeriods');
  ShowItem('RepaymentPeriods');
  HideItem('MobileNumberRow');
}

function DisableSubmitButton(){
  document.getElementById('btnPrevious').disabled = 'true';
  document.getElementById('btnSubmit').value = 'Processing...   ';
  document.getElementById('btnSubmit').disabled = 'true';
}

function DisableSubmitButtonUcc(){
  document.getElementById('btnSubmit').value = 'Processing...   ';
  document.getElementById('btnSubmit').disabled = 'true';
}

function HideFormControlsUL(){
  ShowItem('UnsecuredLoanDetailsRow');
  HideItem('YourDetailsRow');
  HideItem('SalutationRow');
  HideItem('FirstNameRow');
  HideItem('SurnameRow');
  HideItem('DayNumberRow');
  HideItem('MobileNumberRow');
  HideItem('EveningNumberRow');
  HideItem('EmailAddressRow');
  HideItem('DoBRow');
  HideItem('AddressDetailsRow');
  HideItem('HouseNameTextRow');
  HideItem('HouseNumberRow');
  HideItem('HouseNameRow');
  HideItem('AddressField1');
  HideItem('AddressField2');
  HideItem('AddressField3');
  HideItem('PostcodeRow');
  HideItem('AddressButton');
  HideItem('NextButtonRow');
  HideItem('EmploymentStatusRow');
  HideItem('IncomeRow');
  HideItem('btnPrevious');
  HideItem('LoanInfoRow');
  HideItem('EmployerNameRow');
  HideItem('NationalInsuranceNoRow');
  HideItem('PayDate1Row');
  HideItem('IsDirectDepositRow');
  HideItem('PayFrequencyRow');
  HideItem('EmploymentDurationRow');
  HideItem('DebitCardTypeCodeRow');
  HideItem('PayDate2Row');
  HideItem('BankAccountNoRow');
  HideItem('BankSortCodeRow');
  HideItem('OptionalInfoRow');
  ShowItem('ResidentialStatusRow');
  ShowItem('PurposeRow');
  ShowItem('EmployedRow');
  ShowItem('RepaymentPeriodsRow');
  ShowItem('Page1');
  ShowItem('Page2');
}

function HideCounty(){
  HideItem('AddressField3');
}

function HideFormControlsUnsecured(){
  HideItem('MobileNumberRow');
}

function HideFormControlsProvident(){
  HideItem('RepaymentPeriodsRow');
  HideItem('PurposeRow');
  HideItem('ResidentialStatusRow');
  HideItem('EmployedRow');
}

function HideItem(Id){
  if(document.getElementById(Id)){ document.getElementById(Id).style.display = 'none'; }
}
function ShowItem(Id){
  if(document.getElementById(Id)){ document.getElementById(Id).style.display = ''; }
}


