﻿/*
© Copyright 2008 City of Huntington Beach. All rights reserved.
*/

function showLookup(id)
{
    //Get the control's list
    var l=document.getElementById(id+'_List');
    if (l != null)
    {
        //Show the list
        l.style.visibility="visible";
    }
    else
    {
        //Get the currently selected document type
        var t=document.getElementById('DropDownList1');
        if (t != null)
        {
            //Try getting a custom list
            var h=getLookupHTML(t.options[t.selectedIndex].value, id);
            
            //Get the Div to add the list to
            var d=document.getElementById(id+'_Div');
            if (d != null && h != "")
            {
                d.innerHTML=h;
            }
        }
    }

    //Hide any other visible lookups
    var s=document.getElementsByTagName('select');
    if (s != null)
    {
        for (i=0;i<s.length;i++)
        {
            if (s[i].id.indexOf('_List') >= 0 && s[i].id != id+'_List')
            {
                s[i].style.visibility="hidden";
            }
        }
    }
}

function selectLookup(id)
{
    //Get the control and list
    var t=document.getElementById(id);
    var l=document.getElementById(id+'_List');
    if (t != null && l != null)
    {
        t.value=l.options[l.selectedIndex].text;
    }
}

function getLookupHTML(type, id)
{
    var html='';
    if ((type == "PlansBLDG" || type == "Permits") && id == "ctl00_ContentPlaceHolder1__Description")
    {
        html +='<SELECT NAME="'+id+'_List" id="'+id+'_List" size="10">\n';// onChange="selectLookup(\''+id+'\');" style="font-size:small;">\n';
        html += '<OPTION value="Re-roofing, residential">Re-roofing, residential</OPTION>\n';
        html += '<OPTION value="Block Walls, Retaining Walls, Garden Walls">Block Walls, Retaining Walls, Garden Walls</OPTION>\n';
        html += '<OPTION value="Patios, no sides">Patios, no sides</OPTION>\n';
        html += '<OPTION value="Addition Residential">Addition Residential</OPTION>\n';
        html += '<OPTION value="Alterations/Remodels Residential">Alterations/Remodels Residential</OPTION>\n';
        html += '<OPTION value="Pools, Spas (below ground)">Pools, Spas (below ground)</OPTION>\n';
        html += '<OPTION value="Fences (Chain Link, Wood)">Fences (Chain Link, Wood)</OPTION>\n';
        html += '<OPTION value="Windows, Doors">Windows, Doors</OPTION>\n';
        html += '<OPTION value="Re-roofing, commercial/industrial">Re-roofing, commercial/industrial</OPTION>\n';
        html += '<OPTION value="Alterations/Remodels Tenant Improvement">Alterations/Remodels Tenant Improvement</OPTION>\n';
        html += '<OPTION value="Addition Tenant Improvement">Addition Tenant Improvement</OPTION>\n';
        html += '<OPTION value="Signs, Spray Booths, Antennas, Cellular Poles, Storage Racks, Equipment Pads, Removal of Underground Tanks">Signs, Spray Booths, Antennas, Cellular Poles, Storage Racks, Equipment Pads, Removal of Underground Tanks</OPTION>\n';
        html += '<OPTION value="New Residential Home">New Residential Home</OPTION>\n';
        html += '<OPTION value="Screened in Patios">Screened in Patios</OPTION>\n';
        html += '<OPTION value="Alterations/Remodels Multi Residential">Alterations/Remodels Multi Residential</OPTION>\n';
        html += '<OPTION value="Spas (above ground)">Spas (above ground)</OPTION>\n';
        html += '<OPTION value="Sunroom/Solarium ">Sunroom/Solarium </OPTION>\n';
        html += '<OPTION value="Residential Demolition - Entire Structure">Residential Demolition - Entire Structure</OPTION>\n';
        html += '<OPTION value="Skylights">Skylights</OPTION>\n';
        html += '<OPTION value="New Condos/Townhomes ">New Condos/Townhomes </OPTION>\n';
        html += '<OPTION value="Addition Multi Residential">Addition Multi Residential</OPTION>\n';
        html += '<OPTION value="Carports, Garages">Carports, Garages</OPTION>\n';
        html += '<OPTION value="New Shopping Centers">New Shopping Centers</OPTION>\n';
        html += '<OPTION value="New Office Buildings">New Office Buildings</OPTION>\n';
        html += '<OPTION value="New Hotels/Motels ">New Hotels/Motels </OPTION>\n';
        html += '<OPTION value="New Other Commercial Buildings ">New Other Commercial Buildings </OPTION>\n';
        html += '<OPTION value="Restaurants">Restaurants</OPTION>\n';
        html += '<OPTION value="Service Stations">Service Stations</OPTION>\n';
        html += '<OPTION value="School/Education">School/Education</OPTION>\n';
        html += '<OPTION value="Religious">Religious</OPTION>\n';
        html += '<OPTION value="Parking Garage">Parking Garage</OPTION>\n';
        html += '<OPTION value="Other - Commercial">Other - Commercial</OPTION>\n';
        html += '<OPTION value="New Multi Residential 100+ Units">New Multi Residential 100+ Units</OPTION>\n';
        html += '<OPTION value="C/I Demolition">C/I Demolition</OPTION>\n';
        html += '<OPTION value="C/I Other">C/I Other</OPTION>\n';
        html += '<OPTION value="Other Misc.">Other Misc.</OPTION>\n';
        html += '<OPTION value="Fire Repairs">Fire Repairs</OPTION>\n';
        html += '<OPTION value="Structural - Other Misc.">Structural - Other Misc.</OPTION>\n';
        html += '<OPTION value="New Multi Residential 2-4 Units">New Multi Residential 2-4 Units</OPTION>\n';
        html += '<OPTION value="New Multi Residential 5-20 Units">New Multi Residential 5-20 Units</OPTION>\n';
        html += '<OPTION value="New Multi Residential 21 - 99 Units  ">New Multi Residential 21 - 99 Units  </OPTION>\n';
        html += '<OPTION value="Mobile Homes">Mobile Homes</OPTION>\n';
        html += '<OPTION value="Residential Demolition - Partial">Residential Demolition - Partial</OPTION>\n';
        html += '<OPTION value="Industrial Complex or Lg Industrial Building">Industrial Complex or Lg Industrial Building</OPTION>\n';
        html += '<OPTION value="Water Heater">Water Heater</OPTION>\n';
        html += '<OPTION value="Meter Upgrade">Meter Upgrade</OPTION>\n';
        html += '</SELECT>';
    }
    else if (type == "Photos" && id == "ctl00_ContentPlaceHolder1__CategoryNumber")
    {
        html +='<SELECT NAME="'+id+'_List" id="'+id+'_List" size="10">\n';
        html += '<OPTION value="19">Aerials - 19</OPTION>\n';
        html += '<OPTION value="48">Airports - 48</OPTION>\n';
        html += '<OPTION value="62">Awards and Presentations - 62</OPTION>\n';
        html += '<OPTION value="11">Bathing Beauties - 11</OPTION>\n';
        html += '<OPTION value="2">Beach Condos - 2</OPTION>\n';
        html += '<OPTION value="1">Beach Parking - 1</OPTION>\n';
        html += '<OPTION value="10">Beaches/Lifeguards - 10</OPTION>\n';
        html += '<OPTION value="45">Bicentennial  1975 – 1977 - 45</OPTION>\n';
        html += '<OPTION value="3">Boards/Commissions - 3</OPTION>\n';
        html += '<OPTION value="4">Bolsa Chica - 4</OPTION>\n';
        html += '<OPTION value="60">Centennial 2009 - 60</OPTION>\n';
        html += '<OPTION value="13">Christmas - 13</OPTION>\n';
        html += '<OPTION value="6">Churches - 6</OPTION>\n';
        html += '<OPTION value="7">City Council/Mayors - 7</OPTION>\n';
        html += '<OPTION value="5">City Employees - 5</OPTION>\n';
        html += '<OPTION value="15">City Hall, Original 1923-1974 bldg - 15</OPTION>\n';
        html += '<OPTION value="29">Civic Center and Satellite Facilities - 29</OPTION>\n';
        html += '<OPTION value="57">Civic Organizations - 57</OPTION>\n';
        html += '<OPTION value="8">Dedications - 8</OPTION>\n';
        html += '<OPTION value="47">Demolitions – Old Structures - 47</OPTION>\n';
        html += '<OPTION value="59">Dignitaries, Misc - 59</OPTION>\n';
        html += '<OPTION value="43">Disneyland, Amusement Parks - 43</OPTION>\n';
        html += '<OPTION value="22">Driftwood Inn/Waterfront - 22</OPTION>\n';
        html += '<OPTION value="9">Early Businesses Downtown - 9</OPTION>\n';
        html += '<OPTION value="54">Fire Department - 54</OPTION>\n';
        html += '<OPTION value="23">Floods - 23</OPTION>\n';
        html += '<OPTION value="24">Golf Courses - 24</OPTION>\n';
        html += '<OPTION value="26">Harbours - 26</OPTION>\n';
        html += '<OPTION value="21">Historic, General - 21</OPTION>\n';
        html += '<OPTION value="36">Huntington Beach Company (Ranch) - 36</OPTION>\n';
        html += '<OPTION value="50">Huntington Beach Country Fair - 50</OPTION>\n';
        html += '<OPTION value="44">Huntington Beach Families - 44</OPTION>\n';
        html += '<OPTION value="27">Libraries - 27</OPTION>\n';
        html += '<OPTION value="17">Main Street/Ocean Ave/PCH - 17</OPTION>\n';
        html += '<OPTION value="10">Marine Safety - 10</OPTION>\n';
        html += '<OPTION value="28">McDonnell Douglas/Boeing - 28</OPTION>\n';
        html += '<OPTION value="15">Memorial Hall - 15</OPTION>\n';
        html += '<OPTION value="14">Methodist Campgrounds/Tent City - 14</OPTION>\n';
        html += '<OPTION value="21">Miscellaneous - 21</OPTION>\n';
        html += '<OPTION value="42">Miscellaneous Newspaper Pics - 42</OPTION>\n';
        html += '<OPTION value="30">Newland House - 30</OPTION>\n';
        html += '<OPTION value="31">Oil - 31</OPTION>\n';
        html += '<OPTION value="51">Orange County Fair - 51</OPTION>\n';
        html += '<OPTION value="53">Orange County Parks - 53</OPTION>\n';
        html += '<OPTION value="52">Orange Show – Riverside - 52</OPTION>\n';
        html += '<OPTION value="33">Parades - 33</OPTION>\n';
        html += '<OPTION value="16">Pav-A-Lon/Pavilion - 16</OPTION>\n';
        html += '<OPTION value="34">Pier - 34</OPTION>\n';
        html += '<OPTION value="55">Police Department - 55</OPTION>\n';
        html += '<OPTION value="56">Public Art - 56</OPTION>\n';
        html += '<OPTION value="35">Railroads - 35</OPTION>\n';
        html += '<OPTION value="37">Recreation/Parks - 37</OPTION>\n';
        html += '<OPTION value="38">Scenic - 38</OPTION>\n';
        html += '<OPTION value="39">Schools - 39</OPTION>\n';
        html += '<OPTION value="46">Scouting Lake Park - 46</OPTION>\n';
        html += '<OPTION value="40">Seniors - 40</OPTION>\n';
        html += '<OPTION value="58">Shopping Centers - 58</OPTION>\n';
        html += '<OPTION value="41">Surfing - 41</OPTION>\n';
        html += '<OPTION value="18">Trailer Parks - 18</OPTION>\n';
        html += '<OPTION value="49">Twins Conventions  -  1938-1958 - 49</OPTION>\n';
        html += '<OPTION value="20">Veterans - 20</OPTION>\n';
        html += '<OPTION value="12">WW II - 12</OPTION>\n';
        html += '</SELECT>';
    }

    return html;
}

