// JavaScript Document


function BCL(Label,URII)
{

	var myHash = new Hash();

	myHash.setItem("", "Az");
	myHash.setItem("", "Azz");
	myHash.setItem("", "Azzz");
	myHash.setItem("", "Azzzz");
	myHash.setItem("", "Ez");
	myHash.setItem("", "Ezz");
	myHash.setItem("", "Ezzz");
	myHash.setItem("", "Iz");
	myHash.setItem("", "Izz");
	myHash.setItem("", "Izzz");
	myHash.setItem("", "Oz");
	myHash.setItem("", "Ozz");
	myHash.setItem("", "Ozzz");
	myHash.setItem("", "Uz");
	myHash.setItem("", "Uzz");
	myHash.setItem("", "Uzzz");
	myHash.setItem("", "Nz");
	myHash.setItem("", "Cz");
	myHash.setItem("", "Sz");
	myHash.setItem("S", "Szz");
	myHash.setItem("", "Yz");

	var uniTransLabel = new Array();
	for (var i = 0; i < Label.length; i++) {
		uniTransLabel[i] = stripTag(Label[i]);
	
		var pattern = /(\w)(\w*)/; // a letter, and then one, none or more letters 
		var a = uniTransLabel[i];//document.form1.text1.value.split(/\s+/g); // split the sentence into an array of words
		var parts = a.match(pattern); // just a temp variable to store the fragments in.
		
		if (myHash.hasItem(a.substring(0,1)))
		{
			var t = a.substring(0,1)
			var firstLetter = myHash.getItem(t.toUpperCase());
		} else{	
			var firstLetter = a.substring(0,1);
		}
		var restOfWord = a.substring(1,a.length);
		a = firstLetter + restOfWord; // re-assign it back to the array and move on
		uniTransLabel[i] = a;
		//alert(uniTransLabel[i] + i);
	}


	NewCount = 0;
	multiArray = new Array();
	for (i=0;i<URII.length;i++) {
		multiArray[NewCount] = [stripTag(Label[i]), URII[i],uniTransLabel[i] ];
		NewCount++;
	}
	
	//sort the 2 dimensional array by first label
	sortList(multiArray);

	HTMLBody = "";
	selectedIndex = 0;
	selectedValue = "";
	selectedIndex = document.forms["CountryPullDown"].Countries.selectedIndex;
	if (selectedIndex >= 0) {
		selectedValue = document.forms["CountryPullDown"].Countries.options[selectedIndex].value
	}
	
	if (selectedIndex >= 0) {
		for (i=0;i<NewCount;i++)
		{
			document.forms["CountryPullDown"].Countries.options[i].value = multiArray[i][1];
			document.forms["CountryPullDown"].Countries.options[i].text = multiArray[i][0];
		}
		for (i=0;i<NewCount;i++)
		{
			if (document.forms["CountryPullDown"].Countries.options[i].value==selectedValue) {
				document.forms["CountryPullDown"].Countries.selectedIndex = i;
			}
		}
	}
}

	var CC = 0;
	var CL = new Array();
	var CU = new Array();					

	CL[CC] = "Argentina";
	CU[CC] = 'http://www.avaya.com.ar';
	CC++;

	CL[CC] = "Australia";
	CU[CC] = 'http://www.avaya.com.au';
	CC++;

	CL[CC] = "Austria";
	CU[CC] = 'http://www.avaya.at';
	CC++;

	CL[CC] = "Belgium";
	CU[CC] = 'http://www.avaya.be';
	CC++;

	CL[CC] = "Brazil";
	CU[CC] = 'http://www.avaya.com.br';
	CC++;

	CL[CC] = "Canada - English";
	CU[CC] = 'http://www.avaya.ca';
	CC++;
	
	CL[CC] = "Canada - French";			
	CU[CC] = 'http://www.avaya.ca/gcm/nar/fr-ca/home/index.htm';
	CC++;

	CL[CC] = "China";
	CU[CC] = 'http://www.avaya.com.cn';
	CC++;

	CL[CC] = "Croatia";
	CU[CC] = 'http://www.avaya.eu/hr';
	CC++;
	
	CL[CC] = "Czech Republic";
	CU[CC] = 'http://www.avaya.cz';
	CC++;

	CL[CC] = "Denmark";
	CU[CC] = 'http://www.avaya.dk';
	CC++;

	CL[CC] = "Finland";
	CU[CC] = 'http://www.avaya.fi';
	CC++;

	CL[CC] = "France";
	CU[CC] = 'http://www.avaya.fr';
	CC++;
	
	CL[CC] = "Germany";
	CU[CC] = 'http://www.avaya.de';
	CC++;

	CL[CC] = "Greece";
	CU[CC] = 'http://www.avaya.gr';
	CC++;
	
	CL[CC] = "Hungary";
	CU[CC] = 'http://www.avaya.hu';
	CC++;

	CL[CC] = "India";
	CU[CC] = 'http://www.avayaglobalconnect.com';
	CC++;

	CL[CC] = "Ireland";
	CU[CC] = 'http://www.avaya.ie';
	CC++;

	CL[CC] = "Israel";
	CU[CC] = 'http://www.avaya.co.il';
	CC++;

	CL[CC] = "Italy";
	CU[CC] = 'http://www.avaya.it';
	CC++;

	CL[CC] = "Japan";
	CU[CC] = 'http://www.avaya.co.jp';
	CC++;

	CL[CC] = "Korea";
	CU[CC] = 'http://www.avaya.co.kr';
	CC++;

	CL[CC] = "Mexico";
	CU[CC] = 'http://www.avaya.com.mx';
	CC++;

	CL[CC] = "Netherlands";
	CU[CC] = 'http://www.avaya.nl';
	CC++;

	CL[CC] = "Poland";
	CU[CC] = 'http://www.avaya.pl';
	CC++;

	CL[CC] = "Russia";
	CU[CC] = 'http://www.avaya.ru';
	CC++;

	CL[CC] = "Singapore";
	CU[CC] = 'http://www.avaya-apac.com';
	CC++;

	CL[CC] = "Slovakia";
	CU[CC] = 'http://www.avaya.sk';
	CC++;

	CL[CC] = "Slovenia";
	CU[CC] = 'http://www.avaya.eu/si';
	CC++;
	
	CL[CC] = "Spain";
	CU[CC] = 'http://www.avaya.es';
	CC++;

	CL[CC] = "Sub Saharan Africa";
	CU[CC] = 'http://www.avaya.co.za';
	CC++;
	
	CL[CC] = "Sweden";
	CU[CC] = 'http://www.avaya.se';
	CC++;

	CL[CC] = "Switzerland - French";
	CU[CC] = 'http://www.avaya.ch/gcm/emea/ch-fr/';
	CC++;
	
	CL[CC] = "Switzerland - German";
	CU[CC] = 'http://www.avaya.ch/gcm/emea/ch-de/';
	CC++;

	CL[CC] = "Turkey";
	CU[CC] = 'http://www.avaya.com.tr';
	CC++;
	
	CL[CC] = "United Kingdom";
	CU[CC] = 'http://www.avaya.co.uk';
	CC++;

	CL[CC] = "United States";
	CU[CC] = 'http://www.avaya.com/';
	CC++;

var header_html;

function JumpTo(URL) {
	if (URL == "WorldWideLink") 
	{
		var URLValue = document.getElementById("WorldWideLink");	
		document.location.href = URLValue.attributes.href.value;
	} 
	else {
		document.location.href = URL;
	}
}

//Stylesheet Start
header_html = '<style>';
header_html += 'a.pagelink {color:#CC0000 !important;text-decoration:none !important;font-size:1.1em !important;}';
header_html += 'a.pagelink:hover {	color: #666666 !important;}';
header_html += '.header_text {font-family: Verdana; font-size: .625em; color: #333333; padding-top:4px;}';
header_html += '.header_text a:link {font-family: Verdana; font-size: 1.0em; color: #333333;}';
header_html += '.header_text a:visited {font-family: Verdana; font-size: 1.0em; color: #333333;}';
header_html += '.header_text a:hover {font-family: Verdana; font-size: 1.0em; color: #CC0000;}';
header_html += '.header_search_tb {border: solid 1px #CCCDCB; height: 19px; margin-right: 2px; padding: 2; color: #706D6D; font-size: .625em;  }';
header_html += '.header_search_wrapper {vertical-align: top; text-align:left; padding-top: 16px;}';
header_html += '.header_support_wrapper {padding-top: 16px; vertical-align: top; text-align:right; padding-right: 20px;}';
header_html += '.header_country_wrapper {padding-top: 16px; vertical-align: top;}';
header_html += '.header_search_tb { border: 1px solid #cccccc; margin-right: 2px; padding: 2.5px; color: #808080; font-family: Verdana; font-size: .625em; height: 19px; }';
header_html += '.header_menu_wrapper {padding-right: 1px;}';
header_html += '</style>';
//Stylesheet End

//Header HTML Start
header_html += '<table width="750" height="62" cellpadding="0" cellspacing="0" border="0" ID="Table1"><tr>';
header_html += '<td class="header_logo_wrapper" width="180"><a href="http://www.avaya.co.uk"><img border="0" src="https://www1.avaya.com/includes/images/mh_logo.gif"></a></td>';
header_html += '<td class="header_country_wrapper" width="180">';
header_html += '<form name="CountryPullDown" ID="Form1"><select name="Countries" id="Countries" style="width: 170px; font-size: 0.7em;" onChange="JumpTo(this.value)">';
header_html += '<optgroup label="Countries">';
header_html += '<option value="http://www.avaya.com.ar">Argentina</option><option value="http://www.avaya.com.au">Australia</option>';
header_html += '<option value="http://www.avaya.at">Austria</option><option value="http://www.avaya.be">Belgium</option>';
header_html += '<option value="http://www.avaya.com.br">Brazil</option><option value="http://www.avaya.ca">Canada - English</option>';
header_html += '<option value="http://www.avaya.ca/gcm/nar/fr-ca/home/index.htm">Canada - French</option><option value="http://www.avaya.com.cn">China</option>';
header_html += '<option value="http://www.avaya.eu/hr">Croatia</option><option value="http://www.avaya.cz">Czech Republic</option>';
header_html += '<option value="http://www.avaya.dk">Denmark</option><option value="http://www.avaya.fi">Finland</option>';
header_html += '<option value="http://www.avaya.fr">France</option><option value="http://www.avaya.de">Germany</option>';
header_html += '<option value="http://www.avaya.gr">Greece</option><option value="http://www.avaya.hu">Hungary</option>';
header_html += '<option value="http://www.avayaglobalconnect.com">India</option><option value="http://www.avaya.ie">Ireland</option>';
header_html += '<option value="http://www.avaya.co.il">Israel</option><option value="http://www.avaya.it">Italy</option>';
header_html += '<option value="http://www.avaya.co.jp">Japan</option><option value="http://www.avaya.co.kr">Korea</option>';
header_html += '<option value="http://www.avaya.com.mx">Mexico</option><option value="http://www.avaya.nl">Netherlands</option>';
header_html += '<option value="http://www.avaya.no">Norway</option><option value="http://www.avaya.pl">Poland</option>';
header_html += '<option value="http://www.avaya.ru">Russia</option><option value="http://www.avaya-apac.com">Singapore</option>';
header_html += '<option value="http://www.avaya.sk">Slovakia</option><option value="http://www.avaya.eu/si">Slovenia</option>';
header_html += '<option value="http://www.avaya.es">Spain</option><option value="http://www.avaya.co.za">Sub Saharan Africa</option>';
header_html += '<option value="http://www.avaya.se">Sweden</option><option value="http://www.avaya.ch/gcm/emea/ch-fr/">Switzerland - French</option>';
header_html += '<option value="http://www.avaya.ch/gcm/emea/ch-de/">Switzerland - German</option><option value="http://www.avaya.com.tr">Turkey</option>';
header_html += '<option value="http://www.avaya.co.uk" selected="yes">United Kingdom</option><option value="http://www.avaya.com/">United States</option></optgroup>';
header_html += '<optgroup label="Regions"><option value="http://www.avaya-apac.com/">APAC</option><option value="http://www.cala.avaya.com">Caribbean, Latin America</option>';
header_html += '<option value="http://www.emea.avaya.com">EMEA</option><option value="http://www.avaya.ae">MENA</option></optgroup>';
header_html += '<option value="http://www.avaya.co.uk/gcm/master-usa/en-us/tasks/connect/contacts/worldwide/worldwide.htm">Worldwide Directory</option></select></form></td>';
header_html += '<td class="header_support_wrapper" width="280"><div class="header_text"><a href="http://www1.avaya.com/forms/esales/uk/en/index.html" target="_blank">How to Buy</a> | ';
header_html += '<a href="http://www.avaya.co.uk/gcm/emea/en-us/tasks/connect/contacts/sales/salescontact.htm">Contacts</a> | ';
header_html += '<a target="_self" href="http://support.avaya.com/japple/css/japple?PAGE=Home">Support</a></div></td>';
header_html += '<SCRIPT LANGUAGE="Javascript" SRC="https://www.avaya.com/_includes/scripts/veritysearch.js"></SCRIPT>';
header_html += '<form name="base" onKeyPress="showKeyValue(event)" onSubmit="return validateSearchBoxForm();" ID="Form2" action="http://esearch.avaya.com/r/results_uk.asp">';
header_html += '<input type="hidden" name="SITE" ID="Hidden1" value="red_uk"><td class="header_search_wrapper"><table cellpadding="0" cellspacing="0" id="Table3" border="0">';
header_html += '<tr><td><input id="Text1" type="text" class="header_search_tb" valign="top" NAME="querytext" onFocus="this.value=\'\'" value="Search Avaya"></td>';
header_html += '<td><a href="javascript:go(document.base);" onClick="return validateSearchBoxForm();"><img src="/images/mh_submit.gif" alt="Go" border="0"></a></td></tr>';
header_html += '</table><div class="header_text">  <a href="http://esearch.avaya.com/r/default_uk.asp">Advanced Search</a></div></td></form></tr></table>';
header_html += '<table width="750" cellpadding="0" cellspacing="0" border="0"><tr>';
header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.co.uk/gcm/emea/en-us/portfolio/unified_communications/index.htm"><img src="/images/pillars/nav_uc_off.gif" alt="Unified Communications" border="0"></a></td>';
header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.co.uk/gcm/emea/en-us/pillars/contactcenters/index.htm"><img src="/images/pillars/nav_contact_off.gif" alt="Contact Centers" border="0"></a></td>';
header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.co.uk/gcm/emea/en-us/pillars/iptelephony/index.htm"><img src="/images/pillars/nav_ipt_off.gif" alt="IP Telephony" border="0"></a></td>';
//header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.co.uk/gcm/emea/en-us/portfolio/communications_enabled_business_processes/index.htm"><img src="/images/nav_cebp_off.gif" alt="Communications Enabled Business Processes" border="0"></a></td>';
header_html += '</tr></table>';
//Header HTML End

document.write(header_html);
