//### By Renish Ghodasara Date: 18 Sep. 2007
//### This script checks for the logo if it exists in the script then it takes its path to generate the menu

var o
o = document.getElementById("xLogo");
if (o) {
	menuPath = o.src;
	menuPath = menuPath.replace("images/xchanginglogo.gif", "");

	document.write("	<div id=\"nav\">");
	document.write("		<ul>");
	document.write("			<li><a href=\"" + menuPath + "Home.html\">HOME</a></li>");
	document.write("		</ul>");
	document.write("		<ul>");
	document.write("			<li><a href=\"" + menuPath + "CustomerSolutions/GlobalBPO.html\">CUSTOMER SOLUTIONS</a>");
	document.write("			</li>");
	document.write("		</ul>");
	document.write("		<ul>");
	document.write("			<li><a href=\"" + menuPath + "HowWeDeliver.html\">HOW WE DELIVER</a>");
	document.write("				<ul>");
	document.write("					<li><a href=\"" + menuPath + "HowWeDeliver/OurOfferings.html\">Our offerings</a></li>");
	document.write("					<li><a href=\"" + menuPath + "HowWeDeliver/XchangingWay.html\"><i>The Xchanging Way</i></a></li>");
	document.write("				</ul>");
	document.write("			</li>");
	document.write("		</ul>");
	document.write("		<ul>");
	document.write("			<li><a href=\"" + menuPath + "AboutUs.html\">ABOUT US</a>");
	document.write("				<ul>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/Ourglobalpresence.html\">Our global presence</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/OurStrategy.html\">Our strategy</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/OurValues.html\">Our values</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/Whatwedo.html\">What we do</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/Howwedoit.html\">How we do it</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/Howwecontract.html\">How we contract</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/Howwearestructured.html\">How we are structured</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/WhyCustomersChooseXchanging.html\">Why customers choose Xchanging</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/Wherethemarketismovingto.html\">Where the market is moving to</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/TheBoard.html\">The Board</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/ExecutiveManagement.html\">Management team</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/CorporateGovernance.html\">Governance</a></li>");
	document.write("					<li><a href=\"" + menuPath + "AboutUs/CSR.html\">Corporate Social Responsibility</a></li>");
	document.write("				</ul>");
	document.write("			</li>");
	document.write("		</ul>");
	document.write("		<ul>");
	document.write("			<li><a href=\"" + menuPath + "InvestorRelations.html\">INVESTOR RELATIONS</a>");
	document.write("				<ul>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/FinancialInformation.html\">Financial information</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/FinancialReportsPresentations.html\">Financial reports and presentations</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/FinancialPress.html\">Regulatory news</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/SharePriceInformation.html\">Share price information</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/FinancialCalendar.html\">Financial calendar</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/ShareHolderServices.html\">Shareholder information</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/AnalystCoverage.html\">Analyst coverage</a></li>");
	document.write("					<li><a href=\"" + menuPath + "InvestorRelations/KeyContactInformation.html\">Key contact information</a></li>");
	document.write("				</ul>");
	document.write("			</li>");
	document.write("		</ul>");
	document.write("	</div>");
}

function getLanguage(language) {
	var url = window.location.href;
	url = url.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
	var pos = url.indexOf('//');
	var nohttp = url.substr(pos + 2, url.length);
	pos = nohttp.indexOf('/');
	var urlPath = nohttp.substr(pos + 1, nohttp.length);
	var hostPort = nohttp.substr(0, pos);

	if (hostPort.toLowerCase() == "srv00198.support.local") {
		if (language == "fr") { document.write("http://srv00198.fr.local/" + urlPath); }
		else if (language == "de") { document.write("http://srv00198.de.local/" + urlPath); }
		else { document.write("http://srv00198.support.local/" + urlPath); }
	}
	else if (hostPort.toLowerCase() == "srv00198.fr.local") {
		if (language == "fr") { document.write("http://srv00198.fr.local/" + urlPath); }
		else if (language == "de") { document.write("http://srv00198.de.local/" + urlPath); }
		else { document.write("http://srv00198.support.local/" + urlPath); }
	}
	else if (hostPort.toLowerCase().substr(0, 3) == "ws4") {
		pos = urlPath.indexOf('/');
		var urlPath = urlPath.substr(pos + 1, urlPath.length);
		if (language == "fr") { document.write("http://" + hostPort + "/XTestWebFr/" + urlPath); }
		else if (language == "de") { document.write("http://" + hostPort + "/XTestWebDe/" + urlPath); }
		else { document.write("http://" + hostPort + "/XTestWeb/" + urlPath); }
	}
	else {
		if (language == "fr") { document.write("http://www.xchanging.fr/" + urlPath); }
		else if (language == "de") { document.write("http://www.xchanging.de/" + urlPath); }
		else { document.write("http://www.xchanging.com/" + urlPath); }
	}
}

function pop_Form(url, height, width) {

	var browserType = null;
	if (navigator.userAgent.toUpperCase().indexOf('MSIE') >= 0) {
		browserType = "MSIE";
	} else if (navigator.userAgent.toUpperCase().indexOf('SAFARI') >= 0) {
		browserType = "SAFARI";
	} else if (navigator.userAgent.toUpperCase().indexOf('OPERA') >= 0) {
		browserType = "OPERA";
	} else if (navigator.userAgent.toUpperCase().indexOf('FIREFOX') >= 0) {
		browserType = "FIREFOX";
	} else {
		browserType = "";
	}

	if (browserType == 'MSIE') {
		window.showModalDialog(url, this, "status:no; dialogHeight:" + height + "px; dialogWidth:" + width + "px; help:no; scroll:no; resizable:0; title.text:Xchanging");
		self: close;
	}
	else {
		window.open(url, this, 'height=' + height + ',width=' + width + ',toolbar=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=yes,modal=yes');
	}
}
