function show_person ()
{
var person_chosen = document.getElementById("txt1").value;
var match_found = -1;

for	(var i=0; i < search_people.length; i++) 
	{ 
    if		(search_people[i][0].toLowerCase() == person_chosen.toLowerCase())	match_found = i;
	}

//alert(match_found > 0);
if		(match_found >= 0)
		{
		document.getElementById('ov_people_name').innerHTML = search_people[match_found][0];				// name
		document.getElementById('ov_people_role').innerHTML = search_people[match_found][1];				// role
		document.getElementById('ov_pople_email1').setAttribute('href',"mailto:" + search_people[match_found][3])
		document.getElementById('ov_people_email').innerHTML = search_people[match_found][3];				// email
		document.getElementById('ov_people_phone').innerHTML = search_people[match_found][2];				// phone
		}
else	{
		document.getElementById('ov_people_name').innerHTML = "Sorry no match found";
		document.getElementById('ov_people_role').innerHTML = " ";
		document.getElementById('ov_people_email').innerHTML = " ";
		document.getElementById('ov_people_phone').innerHTML = " ";
		}
}

function show_person2 (person_chosen)
{
var match_found = -1;

for	(var i=0; i < search_people.length; i++) 
	{ 
    if		(search_people[i][0].toLowerCase() == person_chosen.toLowerCase())	match_found = i;
	}

//alert(match_found > 0);
if		(match_found >= 0)
		{
		document.getElementById('ov_people_name').innerHTML = search_people[match_found][0];				// name
		document.getElementById('ov_people_role').innerHTML = search_people[match_found][1];				// role
		document.getElementById('ov_pople_email1').setAttribute('href',"mailto:" + search_people[match_found][3])
		document.getElementById('ov_people_email').innerHTML = search_people[match_found][3];				// email
		document.getElementById('ov_people_phone').innerHTML = search_people[match_found][2];				// phone
		}
else	{
		document.getElementById('ov_people_name').innerHTML = "Sorry no match found";
		document.getElementById('ov_people_role').innerHTML = " ";
		document.getElementById('ov_people_email').innerHTML = " ";
		document.getElementById('ov_people_phone').innerHTML = " ";
		}
}


var search_people =
[
["Adelfo Marino",						"managing director, Germany",				"+49 (0) 2331-959720",		"adelfo.marino@brandaddition.com"],
["Adrian (Ady) Mitchell",				"export supervisor",						"+44 (0) 161 786 0353",		"adrian.mitchell@brandaddition.com"],
["Alice Greenwood-Thompson",			"buyer",									"+44 (0) 161 786 0388",		"Alice.Greenwood-Thompson@brandaddition.com"],
["Andrew Gorrie",						"senor purchasing manager",					"+44 (0) 207 396 6857",		"andrew.gorrie@brandaddition.com"],
["Andy Dunham",							"web developer",							"+44 (0) 161 786 0296",		"andrew.dunham@brandaddition.com"],
["Anita Wong",							"general manager, Hong Kong",				"+852 2301 3082",			"anita.wong@brandaddition.com"],
["Anne-Marie ONeill",					"account executive",						"+44 (0) 161 786 0309",		"Anne-Marie.ONeill@brandaddition.com"], 
["Beth Pilgrim",						"buyer",									"+44 (0) 207 396 6820",		"beth.pilgrim@brandaddition.com"],
["Carmen Mechow",						"project-coordinator",						"+44 (0) 161 786 0221",		"Carmen.Mechow@brandaddition.com"], 
["Carole Meyrick",						"credit control",							"+44 (0) 161 786 0215",		"carole.meyrick@brandaddition.com"],
["Chris Ashworth",						"account manager",							"+44 (0) 161 786 0265",		"chris.ashworth@brandaddition.com"], 
["Chris Lee",							"chief executive",							"+44 (0) 161 786 0423",		"chris.lee@brandaddition.com"],
["Claire Dooner",						"senior account manager",					"+44 (0) 207 396 6877",		"claire.dooner@brandaddition.com"],
["Claire Higgins",						"buyer",									"+44 (0) 207 396 6825",		"claire.higgins@brandaddition.com"],
["Claire McDermott",					"internal account manager",					"+44 (0) 161 786 0276",		"Claire.McDermott@brandaddition.com"],
["Claire Thomson",						"finance director",							"+44 (0) 161 786 0415",		"claire.thomson@brandaddition.com"],
["Colette Blunt",						"financial accountant (vat & treasury)",	"+44 (0) 161 786 0415",		"colette.blunt@brandaddition.com"],
["Dagmara Hrabal-Zielenkiewicz",		"accounts assistant",						"+44 (0) 161 874 2301",		"dagmara.hrabal-Zielenkiewicz@brandaddition.com"],
["Dan Dimmock",							"senior designer",							"+44 (0) 161 786 0365",		"daniel.dimmock@brandaddition.com"],
["Darren Stockley",						"export assistant",							"+44 (0) 161 786 0353",		"darren.stockley@brandaddition.com"],
["David Landes",						"sales and marketing director",				"+44 (0) 161 786 0391",		"david.landes@brandaddition.com"],
["Dawn Oliver",							"account executive",						"+44 (0) 161 786 0387",		"dawn.oliver@brandaddition.com"],
["Dean Harris",							"head of customer services",				"+44 (0) 161 786 0202",		"dean.harris@brandaddition.com"],
["Deborah Hoyes",						"buyer",									"+44 (0) 207 396 6832",		"deborah.hoyes@brandaddition.com"],
["Derek Hartley",						"operations manager, UK",					"+44 (0) 161 786 0263",		"derek.hartley@brandaddition.com"],
["Diane Stewart",						"order administrator",						"+44 (0) 161 786 0231",		"diane.stewart@brandaddition.com"],
["Emily Bewley",						"account executive",						"+44 (0) 161 786 0262",		"emily.bewley@brandaddition.com"],
["Erin Sandbach",						"internal account manager",					"+44 (0) 161 786 0312",		"erin.sandbach@brandaddition.com"],
["Francesca Grant",						"account executive",						"+44 (0) 161 786 0264",		"Francesca.Grant@brandaddition.com"],
["Gabriel Alvarado-Rauscher",			"account executive",						"+44 (0) 161 786 0286",		"gabriel.alvarado@brandaddition.com"],
["Gary Fitzsimmons",					"it network manager",						" ",						"gary.fitzsimons@brandaddition.com"],
["Gary Loe",							"facilities manager",						"+44 (0) 161 786 0421",		"gary.loe@brandaddition.com"],
["Grace Ward",							"order administrator",						"+44 (0) 161 786 0435",		"Grace.Ward@brandaddition.com"],
["Harley Bartles",						"internal account manager",					"+44 (0) 161 786 0379",		"harley.bartles@brandaddition.com"],
["Helen Brennan",						"purchasing manager",						"+44 (0) 161 786 0375",		"helen.brennan@brandaddition.com"],
["Helen Taylor",						"senior account manager",					"+44 (0) 207 396 6808",		"helen.taylor@brandaddition.com"],
["Holly Sharrock",						"internal account manager",					"+44 (0) 161 786 0314",		"holly.sharrock@brandaddition.com"],
["Ian Hayden",							"designer - London",						"+44 (0) 207 396 6818",		"ian.hayden@brandaddition.com"],
["Ian Keartland",						"managing director, Ireland",				"+353 1 456 5326",			"ian.keartland@brandaddition.com"],
["Jade Horrocks",						"order administrator",						"+44 (0) 161 786 0411",		"jade.horrocks@brandaddition.com"],
["Janet Sanders",						"customer services projects manager",		"+44 (0) 161 786 0355",		"janet.sanders@brandaddition.com"],
["Jedd Capper",							"graphic designer",							"+44 (0) 161 786 0396",		"jedd.capper@brandaddition.com"],
["Jessica OCallaghan",					"account manager",							"+44 (0) 207 396 6807",		"jessica.ocallaghan@brandaddition.com"],
["Jim Smith",							"team senior",								"+44 (0) 161 786 0313",		"jim.smith@brandaddition.com"],
["Jo Chapman",							"head of human resources",					"+44 (0) 161 786 0393",		"jo.chapman@brandaddition.com"],
["Jo Farwell",							"account executive",						"+44 (0) 161 786 0297",		"jo.farwell@brandaddition.com"],
["John Chambers",						"sales director",							"+44 (0) 207 396 6858",		"john.chambers@brandaddition.com"],
["John Griffin",						"it team",									" ",						"john.griffin@brandaddition.com"],
["Jonathan Britton",					"general manager - London",					"+44 (0) 207 396 6823",		"jonathan.britton@brandaddition.com"],
["Juliette Richard-Lenoble",			"account manager",							"+44 (0) 207 396 6827",		"juliette.richard-lenoble@brandaddition.com"],
["June Cannon",							"account manager",							"+44 (0) 786 672 5434",		"june.cannon@brandaddition.com"],
["June Perry",							"order administrator",						"+44 (0) 161 786 0236",		"june.perry@brandaddition.com"],
["Karen Hamlyn",						"project co-ordinator",						"+44 (0) 161 786 0224",		"karen.hamlyn@brandaddition.com"],
["Kate Browning",						"senior buyer",								"+44 (0) 207 396 6843",		"kate.browning@brandaddition.com"],
["Ken Livingstone",						"account executive",						"+44 (0) 161 874 2313",		"ken.livingstone@brandaddition.com"],
["Kevin Ronan",							"buyer",									"+44 (0) 161 786 0334",		"kevin.ronan@brandaddition.com"],
["Laura Harding",						"account manager",							"+44 (0) 207 396 6828",		"laura.harding@brandaddition.com"],
["Laura Rowlands",						"account executive",						"+44 (0) 161 786 0378",		"laura.rowlands@brandaddition.com"],
["Lesley Wigglesworth",					"credit control",							"+44 (0) 161 874 2332",		"lesley.wigglesworth@brandaddition.com"],
["Lesley Wotherspoon",					"lead account manager",						"+44 (0) 161 874 2340",		"lesley.wotherspoon@brandaddition.com"],
["Lindsay Brett",						"financial controller",						"+44 (0) 161 786 0323",		"lindsay.brett@brandaddition.com"],
["Lorraine Butler",						"team leader - creative services",			"+44 (0) 161 786 0325",		"lorraine.butler@brandaddition.com"],
["Lilli Mottram",						"designer",									"+44 (0) 207 396 6824",		"lilli.mottram@brandaddition.com"],
["Lisa Bann",							"project co-ordinator",						"+44 (0) 161 786 0343",		"lisa.bann@brandaddition.com"],
["Malcolm Windsor",						"stock controller",							"+44 (0) 161 786 0258",		"malcolm.windsor@brandaddition.com"],
["Mandy Johnson",						"team leader",								"+44 (0) 161 786 0361",		"mandy.johnson@brandaddition.com"],
["Marcia Allen",						"senior buyer",								"+44 (0) 207 396 6810",		"marcia.allen@brandaddition.com"],
["Marie Williams",						"buyer",									"+44 (0) 207 396 6842",		"marie.williams@brandaddition.com"],
["Mark Humphrey",						"ict support administrator",				" ",						"mark.humphrey@brandaddition.com"],
["Mark Johnson",						"marketing manager",						"+44 (0) 161 786 0386",		"mark.johnson@brandaddition.com"],
["Mark O Neill",						"account manager",							"+44 (0) 161 872 9527",		"mark.oneill@brandaddition.com"],
["Mark Povey",							"account executive - corporate sales",		"+44 (0) 161 786 0275",		"mark.povey@brandaddition.com"],
["Martin Halberstadt",					"new business development, germany",		"+49 233 1959716",			"martin.halberstadt@brandaddition.com"],
["Melanie Greenhalgh",					"team leader",								"+44 (0) 161 786 0363",		"melanie.greenhalgh@brandaddition.com"],
["Melissa Samways",						"purchasing manager",						"+44 (0) 207 396 6892",		"melissa.samways@brandaddition.com"],
["Michael Bauer",						"account manager, germany",					"+49 178 2959753",			"michael.bauer@brandaddition.com"],
["Michael Jackson-Leafield",			"account director",							"+44 (0) 161 786 0344",		"michael.jackson-leafield@brandaddition.com"],
["Michelle Ferguson",					"accountant",								"+44 (0) 161 786 0416",		"michelle.ferguson@brandaddition.com"],
["Michelle Wade",						"team senior",								"+44 (0) 161 786 0238",		"michelle.wade@brandaddition.com"],
["Nathalie Alvarez",					"regional client development executive",	"+44 (0) 161 786 0266",		"nathalie.alvarez@brandaddition.com"],
["Neil Morley",							"graphic designer",							"+44 (0) 161 786 0412",		"neil.morley@brandaddition.com"],
["Nick Field",							"account director",							"+44 (0) 1934 744 551",		"nfield@brandaddition.com"],
["Nicky Gold",							"account director",							"+44 (0) 7768 084 844",		"nicky.gold@brandaddition.com"],
["Nick Kyrillou",						"account manager",							"44 (0) 207 396 2074",		"nick.kyrillou@brandaddition.com"],
["Phil Bell",							"stock controller",							"+44 (0) 161 786 0349",		"philip.bell@brandaddition.com"],
["Philip Catterall",					"web/graphic designer",						"+44 (0) 161 786 0327",		"philip.catterall@brandaddition.com"],
["Rachael Willsher",					"corporate account manager",				"+44 (0) 161 786 3628",		"rachael.willsher@brandaddition.com"],
["Rhea Huggins",						"account executive",						"+44 (0) 207 396 2013",		"rhea.huggins@brandaddition.com"],
["Richard Williams",					"photographer",								"+44 (0) 161 786 3631",		"richard.williams@brandaddition.com"],
["Russell Coulston",					"head of creative services",				"+44 (0) 161 786 0409",		"russell.coulston@brandaddition.com"],
["Sabine Burnand",						"account executive",						"+44 (0) 161 786 0351",		"Sabine.Burnand@brandaddition.com"],
["Sam Coffman",							"project co-ordinator",						"+44 (0) 161 786 0424",		"sam.coffman@brandaddition.com"],
["Simon Brothers",						"business development director",			"+44 (0) 7973 272 823",		"simon.brothers@brandaddition.com"],
["Siobhan Howlett",						"commercial director",						"+44 (0) 207 396 6879",		"siobhan.howlett@brandaddition.com"],
["Stephanie Wardle",					"project coordinator",						"+44 (0) 161 786 0214",		"Stephanie.Wardle@brandaddition.com"],
["Stephen Brett",						"ict manager",								" ",						"stephen.brett@brandaddition.com"],
["Stephen Ladley",						"buyer",									"+44 (0) 161 786 0261",		"stephen.ladley@brandaddition.com"],
["Stuart Molloy",						"distribution manager",						"+44 (0) 161 786 0248",		"stuart.molloy@brandaddition.com"],
["Suzanne Smith",						"financial analyst",						"+44 (0) 161 786 0326",		"suzanne.smith@brandaddition.com"],
["Timothy Chiu",						"role",										"+852 2301 3082",			"timothy.chiu@brandaddition.com"],
["Tom Frith",							"senior designer",							"+44 (0) 207 396 6806",		"tom.frith@brandaddition.com"],
["Vicki Crosby",						"account manager",							"+44 (0) 161 786 0301",		"vicki.crosby@brandaddition.com"],
["Vincent Slater",						"project co-ordinator",						"+44 (0) 161 786 0348",		"vincent.slater@brandaddition.com"]
];

function StateSuggestions() {
this.states = search_people;
}

/**
 * Request suggestions for the given autosuggest control. 
 * @scope protected
 * @param oAutoSuggestControl The autosuggest control to provide suggestions for.
 */
StateSuggestions.prototype.requestSuggestions = function (oAutoSuggestControl /*:AutoSuggestControl*/,
                                                          bTypeAhead /*:boolean*/) {
    var aSuggestions = [];
    var sTextboxValue = oAutoSuggestControl.textbox.value;
    
    if (sTextboxValue.length > 0){
    
        //convert value in textbox to lowercase
        var sTextboxValueLC = sTextboxValue.toLowerCase();

        //search for matching states
        for (var i=0; i < this.states.length; i++) { 

            //convert state name to lowercase
            var sStateLC = this.states[i][0].toLowerCase();
           
            //compare the lowercase versions for case-insensitive comparison
            if (sStateLC.indexOf(sTextboxValueLC) == 0) {

                //add a suggestion using what's already in the textbox to begin it                
                aSuggestions.push(sTextboxValue + this.states[i][0].substring(sTextboxValue.length));
            } 
        }
    }

    //provide suggestions to the control
    oAutoSuggestControl.autosuggest(aSuggestions, bTypeAhead);
};
