// QuickSearch - Global (Version 1.0) - C.McKee
//Generic Country Array (Circa 2001) 07 Update
//Generic Country Array (Circa 2001) 09 DwellingsUpdate
// Country arrays
 var arrayCountryISOCode=		new Array('GBR');
 var arrayCountryDesc=			new Array('United Kingdom');

// Area/region arrays
 var arrayCountryCodeID=		new Array('GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR','GBR');
 var arrayAreaCodeID2=			new Array('CCK,CDG,CAE,CCJ','CCK','CDG','CAE','CCJ','EAA','GBF','GDG','GDC','BBB','BCC','BCD','BCE','BCF','BCG','BDH','BDJ');  
 var arrayAreaDescription=		new Array('Wales','Anglesey','Cardigan Bay & Mid Wales','Pembrokeshire & The South','Snowdonia & The North','The Cotswolds','Cheshire','Here/Shire, Wye Val','Shropshire','Exmoor & Somerset','East Devon','South Devon','Devon West & Dartmoor','Devon Heartland','North Devon','North Cornwall Coast','South Cornwall Coast');
 var arrayAreaType=				new Array(1,2,2,2,2,1,1,1,1);


function getAreas(strCountryID)
{
    //wipe the area options, we are changing country, note: this also clears and repops the sub-area options
    clearAreas();
    objSelect=document.getElementById('area');
    //walk the arrays adding the OPTION values
    for (i = 0; i < arrayAreaCodeID2.length; i++)
    {
        if (strCountryID==arrayCountryCodeID[i])
        {
            strIndent="";
            if (arrayAreaType[i] !=1)
            {strIndent="  ";}
            strLabel2=strIndent + arrayAreaDescription[i];
            lngThisNodesItemID=arrayAreaCodeID2[i];
            fooOption = new Option(strLabel2, lngThisNodesItemID);
            objSelect.options.add(fooOption,-1);
            //objSelect.options[i+1]=fooOption;
        }
    }
    //we have a single element so don't show the 'Please select' option
    if (i==1)
    {
        objSelect.options[0]=null;
    }
}
function clearAreas()
{
    //wipe the SELECT OPTIONS to avoid dupes
    objSelect=document.getElementById('area');
    lngSELECTLength=objSelect.options.length;
    for (i = 0; i <= lngSELECTLength; i++)
    {
        objSelect.options[lngSELECTLength-i]=null;
    }
    //add the control's title option, used to force a user selection
    strLabel2='Select destination';
    lngThisNodesItemID=-99;
    fooOption = new Option(strLabel2, lngThisNodesItemID);
    objSelect.options.add(fooOption,-1);
}