// added for Automotive DL
var suppliersParams  = "width=396,height=438,toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no";

/* open new window with dealer loc */
function openDealers(){
	myurl = "http://www.boschautoparts.co.uk/bdl/loc_select.asp"
	window.open(myurl, "dealer", suppliersParams);
}

/* open new window with suppliers */
function openSuppliers(){
    myurl = "http://www.boschautoparts.co.uk/bdl/loc_search.asp?strLocator=Product"
    window.open(myurl, "suppliers", suppliersParams);
}

/* open new window with service agents */
function openService(){
	myurl = "http://www.boschautoparts.co.uk/bdl/loc_search.asp?strLocator=Service"
	window.open(myurl, "service", suppliersParams);
}

/* open new window with training centres */
function openTraining(){
	myurl = "http://www.boschautoparts.co.uk/bdl/loc_search.asp?strLocator=Training"
	window.open(myurl, "training", suppliersParams);
}

// Original Functions

function openContactEmail(e){
	openContact("","","","",e);
}

function openContact(igb,ioption1,ioption2,ioption3,iemail){
	if (((typeof(iemail)== "undefined")||iemail=="")&&((typeof(email)== "undefined")||email=="")){
		iemail="";
		igb=((typeof(igb)== "undefined") || (igb == ""))?(typeof(gb)=="undefined")?(typeof(business_division)=="undefined")?"":business_division:gb:igb;
		ioption1=((typeof(ioption1)== "undefined") || (ioption1 == ""))?(typeof(option1)=="undefined")?(typeof(sub_division1)=="undefined")?"":sub_division1:option1:ioption1;
		ioption2=((typeof(ioption1)== "undefined") || (ioption2 == ""))?(typeof(option2)=="undefined")?(typeof(sub_division2)=="undefined")?"":sub_division2:option1:ioption1;
		ioption3=((typeof(ioption1)== "undefined") || (ioption3 == ""))?(typeof(option3)=="undefined")?(typeof(sub_division3)=="undefined")?"":sub_division3:option1:ioption1;
	}else{
		igb="";ioption1="";ioption2="";ioption3="";
		if((typeof(iemail)== "undefined")||iemail==""){
			iemail=email;email="";
		}
	}
	myurl = "http://www.bosch.co.uk/content/service/contact/index.asp";
	if ((typeof(myurl) != "undefined") && (myurl != "")) {
		if(myurl.indexOf("?")>0){
			myurl = myurl+"&gb=" + escape(igb.toUpperCase()) + "&option1=" + escape(ioption1.toUpperCase()) + "&option2=" + escape(ioption2.toUpperCase()) + "&option3=" + escape(ioption3.toUpperCase()) + "&email=" + escape(iemail)+"&opener=" + escape(self.location.href);
		}else{
			myurl = myurl+"?gb=" + escape(igb.toUpperCase()) + "&lang=en&option1=" + escape(ioption1.toUpperCase()) + "&option2=" + escape(ioption2.toUpperCase()) + "&option3=" + escape(ioption3.toUpperCase()) + "&email=" + escape(iemail)+"&opener=" + escape(self.location.href);
		}
		window.open(myurl, "contact", "width=564,height=508,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no");
	}
}

function displayDate() {
	theDate = new Date();
	var year = theDate.getYear();
	var month = (theDate.getMonth())+1;
	var day = theDate.getDate();
	if (year < 1000) year+=1900;
	if (day  < 10) day="0"+day;
	if (month < 10) month="0"+month;
	var myDate = "day/month/year";
	myDate = myDate.replace(/day/,day);
	myDate = myDate.replace(/month/,month);
	myDate = myDate.replace(/year/,year);
	if(document.getElementById){
		if(document.getElementById("hsDate")){
			document.getElementById("hsDate").innerHTML=myDate;
		}
	}
}

function openWebassistant(q){
	var path="http://www.bosch.co.uk/content/service/wa/index.asp";
	if (typeof(q) != "string") q = "";
	if(path.indexOf("?") < 0){
		path+="?lang=en";
	}
	path+="&query="+q;
	window.open(path,"wa","width=564,height=508,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no");
}

function openSource(igb){
	var path="http://www.bosch.co.uk/content/service/supplier/index.asp";
	var path="http://www.bosch.co.uk/content/service/supplier/index.asp";
	igb=((typeof(igb)== "undefined") || (igb == ""))?(typeof(gb)=="undefined")?(typeof(business_division)=="undefined")?"":business_division:gb:igb;
	if(path.indexOf("?") < 0){
		path+="?lang=en";
	}
	window.open(path+"&gb="+igb,"dealer","width=564,height=508,toolbar=no,location=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no");
}

function openCountryLocator(){
	var path="";
	if(path.indexOf("?") < 0){
		path+="?lang=en";
	}
	window.open(path,"cl","");
}

function openMyBosch(){
	var path="http://www.bosch.co.uk/content/service/mb/index.asp";
	if(path.indexOf("?") < 0){
		path+="?lang=en";
	}
	window.open(path,"mybosch","");
}

function openImpressum(){
	var path="http://www.bosch.co.uk/content/language2/html/1062.htm";
	if(path.indexOf("?") < 0){
		path+="?lang=en";
	}
	window.open(path,"imprint","width=440,height=418,toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no");
}

var html = 	'	<script language="Javascript" src="http://header.bosch.com/js/header.js"></script>'
html += '	<link rel="stylesheet" type="text/css" href="http://header.bosch.com/css/header_ltr.css">'
html += '	<div id="headerService">'
html += '		<div class="hsHeader">'
html += '			<div class="hsHeaderRow">'
html += '				<div class="hsHeaderCell">'
html += '					<div class="headerButtonsRow">'
html += '						<table cellpadding="0" cellspacing="0" border="0" width="720">'
html += '							<tr>'
html += '								<td class="headerButtonIcon">'
html += '									<a title="Web Assistant" class="headerButtonLabel" target="_blank" onclick="openWebassistant();return false;" href="http://www.bosch.co.uk/content/service/wa/index.asp?lang=en">'
html += '										<img title="Web Assistant" src="http://header.bosch.com/shared/icon_wa.gif" width="25" height="17" alt="" border="0" align="top">'
html += '									</a>'
html += '								</td>'
html += '								<td class="headerButton">'
html += '									<a title="Web Assistant" class="headerButtonLabel" target="_blank" onclick="openWebassistant();return false;" href="http://www.bosch.co.uk/content/service/wa/index.asp?lang=en">'
html += '										<nobr>Web Assistant</nobr>'
html += '									</a>'
html += '								</td>'
html += '								<td class="buttonsDelimiter">'
html += '									<img src="http://header.bosch.com/shared/spacer.gif" width="1" height="1" alt="" border="0">'
html += '								</td>'
html += '								<td class="headerButtonIcon">'
html += '									<a title="Contact" class="headerButtonLabel" target="_blank" onclick="openContact();return false;" href="http://www.bosch.co.uk/content/service/contact/index.asp?lang=en">'
html += '										<img title="Contact" src="http://header.bosch.com/shared/icon_contact.gif" width="27" height="17" alt="" border="0" align="top">'
html += '									</a>'
html += '								</td>'
html += '								<td class="headerButton">'
html += '									<a title="Contact" class="headerButtonLabel" target="_blank" onclick="openContact();return false;" href="http://www.bosch.co.uk/content/service/contact/index.asp?lang=en">'
html += '										<nobr>Contact</nobr>'
html += '									</a>'
html += '								</td>'
html += '								<td class="buttonsDelimiter">'
html += '									<img src="http://header.bosch.com/shared/spacer.gif" width="1" height="1" alt="" border="0">'
html += '								</td>'
html += '								<td class="headerButtonIcon">'
//html += '									<a title="Dealer Locator" class="headerButtonLabel" target="_blank" onclick="openSource();return false;" href="http://www.bosch.co.uk/content/service/supplier/index.asp?lang=en">'
html += '									<a title="Dealer Locator" class="headerButtonLabel" target="_blank" onclick="openDealers();return false;" href="http://www.boschautoparts.co.uk/bdl/loc_select.asp">'
html += '										<img title="Dealer Locator" src="http://header.bosch.com/shared/icon_dealer.gif" width="27" height="17" alt="" border="0" align="top">'
html += '									</a>'
html += '								</td>'
html += '								<td class="headerButton">'
//html += '									<a title="Dealer Locator" class="headerButtonLabel" target="_blank" onclick="openSource();return false;" href="http://www.bosch.co.uk/content/service/supplier/index.asp?lang=en">'
html += '									<a title="Dealer Locator" class="headerButtonLabel" target="_blank" onclick="openDealers();return false;" href="http://www.boschautoparts.co.uk/bdl/loc_select.asp">'
html += '										<nobr>Dealer Locator</nobr>'
html += '									</a>'
html += '								</td>'
html += '								<td class="buttonsDelimiter">'
html += '									<img src="http://header.bosch.com/shared/spacer.gif" width="1" height="1" alt="" border="0">'
html += '								</td>'
html += '								<td class="headerButtonIcon">'
html += '									<a title="My Bosch" class="headerButtonLabel" href="http://www.bosch.co.uk/content/service/mb/index.asp?lang=en">'
html += '										<img title="My Bosch" src="http://header.bosch.com/shared/icon_mb.gif" width="24" height="17" alt="" border="0" align="top">'
html += '									</a>'
html += '								</td>'
html += '								<td class="headerButton">'
html += '									<a title="My Bosch" class="headerButtonLabel" href="http://www.bosch.co.uk/content/service/mb/index.asp?lang=en">'
html += '										<nobr>My Bosch</nobr>'
html += '									</a>'
html += '								</td>'
html += '								<td class="buttonsDelimiter">'
html += '									<img src="http://header.bosch.com/shared/spacer.gif" width="1" height="1" alt="" border="0">'
html += '								</td>'
html += '								<td width="100%">'
html += '								</td>'
html += '								<td class="buttonsDelimiter">'
html += '									<img src="http://header.bosch.com/shared/spacer.gif" width="1" height="1" alt="" border="0">'
html += '								</td>'
html += '								<td class="headerButton2">'
html += '									<a title="Imprint" class="headerButtonLabel" target="_blank" onclick="openImpressum();return false;" href="http://www.bosch.co.uk/content/language2/html/1062.htm">'
html += '										<nobr>Imprint</nobr>'
html += '									</a>'
html += '								</td>'
html += '								<td class="buttonsDelimiter">'
html += '									<img src="http://header.bosch.com/shared/spacer.gif" width="1" height="1" alt="" border="0">'
html += '								</td>'
html += '								<td class="headerButton2">'
html += '									<nobr><span id="hsDate" class="headerButtonLabel"></span></nobr>'
html += '								</td>'
html += '							</tr>'
html += '						</table>'
html += '					</div>'
html += '					<div class="headerLogoRow">'
html += '						<img src="http://header.bosch.com/logos/logo_en.gif" width="720" height="49" alt="" border="0" usemap="#logolink"><br>'
html += '						<map name="logolink"><area shape="rect" coords="350,0,720,49" href="http://www.bosch.co.uk/content/language2/html/index.htm" alt="Startpage"></map>'
html += '					</div>'
html += '					<div class="breadcrumbRowDiv">'
html += '						<div class="breadcrumbRow">'
html += '							<span class="breadcrumbButton"><img src="http://header.bosch.com/shared/arrow_back_white.gif" width="8" height="12" alt="" border="0"><a href="http://www.bosch.co.uk" class="breadcrumbButtonLabel"><nobr>Start Bosch UK</nobr></a></span>'
if ((document.URL != "http://www.boschautoparts.co.uk") && (document.URL != "http://www.boschautoparts.co.uk/default.asp") && (document.URL != "http://www.boschautoparts.co.uk/")) {
	html += '							<span class="breadcrumbButton"><img src="http://header.bosch.com/shared/arrow_back_white.gif" width="8" height="12" alt="" border="0"><a href="http://www.boschautoparts.co.uk" class="breadcrumbButtonLabel"><nobr>Automotive Parts</nobr></a></span>'
}
html += '						</div>'
html += '					</div>'
html += '				</div>'
html += '			</div>'
html += '		</div>'
html += '	</div>'
html += '	<div class="hsXtraSpacer"></div>'
html += '	<script language="Javascript">'
html += '		isrc="http://if.internetwork-bosch.com/counter.php";			'
html += '		country="uk";						'
html += '		flybase="<span style=\'display:none;\'><img src=\'"+isrc+"?x="+Math.round(Math.random()*10000)+"&amp;page="+escape(country)+"&amp;loc="+escape(document.location.href)+"&amp;referrer="+escape(document.referrer)+"\' width=0 height=0 ></span>";			'
html += '		document.write(flybase);			'
html += '	</script>'
html += '	<script language="Javascript">displayDate();</script>'

document.write(html)