﻿// JavaScript Document

/******************************************
Header Java Script include created on 02/28/2007 - KL

*********************************************/

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] = "Czech Republic";
	
	CU[CC] = 'http://www.avaya.cz';
	CC++;

	CL[CC] = "Denmark";
	CU[CC] = 'http://www.avaya.dk';
	CC++;

	CL[CC] = "France";
	CU[CC] = 'http://www.avaya.fr';
	CC++;

	CL[CC] = "Germany";
	CU[CC] = 'http://www.avaya.de';
	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] = "Spain";
	CU[CC] = 'http://www.avaya.es';
	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] = "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;}';

//KL 9.04.07 New SEO Masthead
header_html +=' .no_display { display: none; }';
header_html +=' .mh_ipt { width: 152px; height: 38px; background: url(../images/_layouts/nav_ipt_off.gif) no-repeat;}';
header_html +=' .mh_cc { width: 175px;  height: 38px; background: url(../images/_layouts/nav_cc_off.gif) no-repeat;}';
header_html +=' .mh_uc { width: 180px;  height: 38px; background: url(../images/_layouts/nav_uc_off.gif) no-repeat;}';
header_html +=' .mh_cebp { width: 240px; height: 38px;  background: url(../images/_layouts/nav_cebp_off.gif) no-repeat;}';

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.es/"><img border="0" src="/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">Belgica</option>';
header_html += '<option value="http://www.avaya.com.br">Brasil</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 - frances</option><option value="http://www.avaya.com.cn">China</option>';
header_html += '<option value="http://www.avaya.cz">Republica Checa</option><option value="http://www.avaya.dk">Dinamarca</option>';
header_html += '<option value="http://www.avaya.fr">Francia</option><option value="http://www.avaya.de">Alemania</option>';
header_html += '<option value="http://www.avaya.hu">Hungría</option><option value="http://www.avayaglobalconnect.com">India</option>';
header_html += '<option value="http://www.avaya.ie">Irlanda</option><option value="http://www.avaya.co.il">Israel</option>';
header_html += '<option value="http://www.avaya.it">Italia</option><option value="http://www.avaya.co.jp">Japón</option>';
header_html += '<option value="http://www.avaya.co.kr">Corea</option><option value="http://www.avaya.com.mx">Mexico</option>';
header_html += '<option value="http://www.avaya.nl">Holanda</option><option value="http://www.avaya.pl">Polonia</option>';
header_html += '<option value="http://www.avaya.ru">Rusia</option><option value="http://www.avaya-apac.com">Singapur</option>';
header_html += '<option value="http://www.avaya.sk">Eslovaquia</option><option value="http://www.avaya.es" selected="yes">España</option>';
header_html += '<option value="http://www.avaya.se">Suecia</option><option value="http://www.avaya.ch/gcm/emea/ch-fr/">Suiza-frances</option>';
header_html += '<option value="http://www.avaya.ch/gcm/emea/ch-de/">Suiza-aleman</option><option value="http://www.avaya.co.uk">Gran Bretaña</option>';
header_html += '<option value="http://www.avaya.com/">Estados Unidos</option></optgroup>';
header_html += '<optgroup label="Regions"><option value="http://www.avaya-apac.com/">APAC</option><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.es/gcm/emea/es/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/sp/index.html" target="_blank">Cómo comprar</a> | ';
header_html += '<a href="http://www.avaya.es/gcm/emea/es/tasks/connect/contacts/sales/salescontact.htm">Contactos</a> | ';
header_html += '<a target="_self" href="http://support.avaya.com">Asistencia</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_es.asp">';
header_html += '<input type="hidden" name="SITE" ID="Hidden1" value="com"><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="Buscar"></td>';
header_html += '<td><a href="javascript:go(document.base);" onClick="return validateSearchBoxForm();"><img src="/includes/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_es.asp">Búsqueda avanzada</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.es/gcm/emea/es/pillars/iptelephony/index.htm"><img src="/includes/images/nav_ipt_spanish_off.gif" alt="IP Telephony" border="0"></a></td>';
//header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.es/gcm/emea/es/pillars/contactcenters/index.htm"><img src="/includes/images/nav_cc_spanish_off.gif" alt="Contact Centers" border="0"></a></td>';
//header_html += '<td class="header_menu_wrapper"><a href="http://www1.avaya.es/pillars/uc/index.htm"><img src="/includes/images/nav_uc_spanish_off.gif" alt="Unified Communications" border="0"></a></td>';
//header_html += '<td class="header_menu_wrapper"><a href="http://www1.avaya.es/pillars/cebp/index.htm"><img src="/includes/images/nav_cebp_spanish_off.gif" alt="Communications Enabled Business Processes" border="0"></a></td>';
//KL 9.4.07 New Masthead
header_html += '<td class="header_menu_wrapper"><a href="http://www1.avaya.es/pillars/uc/index.htm"><img src="/includes/images/uc_off_sp.gif" alt="Comunicaciones Unificadas" title="Comunicaciones Unificadas" border="0"><span class="no_display">Comunicaciones Unificadas</span></a></td>';
header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.es/gcm/emea/es/pillars/contactcenters/index.htm"><img src="/includes/images/cc_off_sp.gif" alt="Centros de Contacto" title="Centros de Contacto" border="0"><span class="no_display">Centros de Contacto</span></a></td>';
header_html += '<td class="header_menu_wrapper"><a href="http://www.avaya.es/gcm/emea/es/pillars/iptelephony/index.htm"><img src="/includes/images/ipt_off_sp.gif" alt="Telefonía IP" title="Telefonía IP" border="0"><span class="no_display">Telefonía IP</span></a></a></td>';
/*header_html += '<td class="header_menu_wrapper"><a href="http://www1.avaya.es/pillars/cebp/index.htm"><img src="/includes/images/nav_cebp_spanish_off.gif" alt="Procesos Empresariales Habilitados para las Comunicaciones" title="Procesos Empresariales Habilitados para las Comunicaciones" border="0"><span class="no_display">Procesos Empresariales Habilitados para las Comunicaciones</span></a></td>';*/
header_html += '</tr></table>';
//Header HTML End

document.write(header_html);
