﻿// Radio button switcher
// Shows/hides a panel in response to a radio button change
// Author: SRW
// Date: 26/2/08
function swappanels(pnltoshow, pnltohide)
{
     document.getElementById(pnltoshow).style.display = 'inline';
     document.getElementById(pnltohide).style.display = 'none';
}

// Find address
// Updates display for postcode searching
// Author: SRW
// Date: 26/2/08
function findaddress(btnpressed, pctextbox, selectbox, btntoretrive)
{
    ctl = document.getElementById(btnpressed);
    var tsuccess
    tsuccess =  eval(document.getElementById(pctextbox).getAttribute("pfvalidation").replace('return ', ''));
    if(tsuccess)
    {
        selectforresults = selectbox;
        btnforretrieve = btntoretrive;
        pcaByPostcodeBegin(document.getElementById(pctextbox).value, btnpressed)
        ctl.value = ctl.getAttribute("waitmessage");
    }
    else
    {
    
    }

    return false;
}

// Retrieves an address
// Retrieves the correct address from the DDL
// Author: SRW
// Date: 26/2/08
function getaddress(pnltoshow, pnltohide, _t1, _t2, _t3, _t4, _t5, _t6)
{
    t1= _t1;
    t2= _t2;
    t3= _t3;
    t4= _t4;
    t5= _t5;
    t6= _t6;
    pcaFetchBegin();
    swappanels(pnltoshow, pnltohide);
    return false;
}

