//Sniffer
function Is() 
{
var agent = navigator.userAgent.toLowerCase();
this.major = parseInt(navigator.appVersion);
this.minor = parseFloat(navigator.appVersion);
this.ns  = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
this.ns2 = (this.ns && (this.major == 2));
this.ns3 = (this.ns && (this.major == 3));
this.ns4b = (this.ns && (this.minor < 4.04));
this.ns4 = (this.ns && (this.major == 4));
this.ns6 = (this.ns && (this.major >= 5));
this.ie   = (agent.indexOf("msie") != -1);
this.ie3  = (this.ie && (this.major == 2));
this.ie4  = (this.ie && (this.major >= 4));
this.op = (agent.indexOf("opera") != -1);
this.op3 = (this.op && (this.major == 3));
this.op4 = (this.op && (this.major == 4));
this.op5 = (this.op && (this.major == 5));
this.op6 = (this.op && (this.major == 6));
this.op7 = (this.op && (this.major == 7));
this.win   = (agent.indexOf("win")!=-1);
this.mac   = (agent.indexOf("mac")!=-1);
this.unix  = (agent.indexOf("x11")!=-1);
if (this.op) 
{
this.ie = false;
this.ie3 = false;
this.ie4 = false;
}
}
var is = new Is();	//Instanz
//DOM-Switch	
if(is.ns4 ) 
{
doc_start_tag = 'document["';
doc_end_tag = '"]';
sty = '';
htm = '.document';
} 
else if(is.ie4 && !(is.op)) 
{
doc_start_tag = 'document.all["';
doc_end_tag = '"]';
sty = '.style';
htm = '';
}
else //	suppose it´s DOM compatible...
{
doc_start_tag = 'document.getElementById("';
doc_end_tag = '")';
sty = '.style';
htm = '.document';
} 
////////////////////////////////////////////////////////////////////////////////////
// Position finder
////////////////////////////////////////////////////////////////////////////////////
function findPosX(obj)
{
var curleft = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curleft += obj.offsetLeft
obj = obj.offsetParent;
}
}
else if (obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
function mObject(name)	
{
this.style = eval(doc_start_tag + name + doc_end_tag + sty);
}
var miMenuDepthMax = 1;
var miMenuDepthIterator = 0;
function miGetHTML()
{
/* dH = divHTML */
dH="";
if (this.url != "END")
{
dH = "<div id=\"" + this.id + "\" class=\"" + this.css + "\" style=\"position:absolute;left:" + this.x + "px;top:" + this.y + "px;width:" + (this.w ) + "px;height:" + miH + "px;visibility:hidden;background:opaque;background-color:" + this.papa.miStdColor + ";\" onMouseOver=\"" + this.id + ".mOver();\" onMouseOut=\"" + this.id + ".mOut();\">";
dH += "<a href=\"" + this.url + "\"";
if ( this.Target == "blank" )
{				
dH += " target=\"_blank\"";
}
dH += " onMouseOver=\"" + this.id + ".mOver();\" onMouseOut=\"" + this.id + ".mOut();\" onFocus=blur();>";
dH += this.Text + "</a>";
dH += "</div>";
}
else 
{
// Create line at the bottom of menu
var borderBottomY = this.y ;
var borderWidth = this.w;
if (is.ie) borderWidth -= 4;
dH += "<div id=\"" + this.id + "\" style='background-color:#2994d6;position:absolute;left:" + this.x + "px;top:" + borderBottomY + "px;width:" + (borderWidth+4) + "px;height:1px;visibility:hidden;'><img src='/im/bl.gif' width='" + (borderWidth ) + "' height='1'></div>";
}			
this.written = true;
return(dH);
}
function miMouseOver()
{
this.papa.unsetCloseTimeout();		//Papa ist valid !
this.papa.currentOpened = this;		//now i´m open
if (this.url != "TITLE") this.mObj.backgroundColor = this.papa.miHighColor;		//selbst highlighten
if ( miMenuDepthMax > 1)
{			
if (this.kid != null)
this.kid.Show();			//und eigene Gruppe öffnen
}
}
function miMouseOut()
{
this.papa.setCloseTimeout();
if (this.url != "TITLE") 
{
if (!this.selected) this.mObj.backgroundColor = this.papa.miStdColor;	
else this.mObj.backgroundColor = this.papa.miSelColor;	
}
}
function miClose()
{
this.unsetCloseTimeout;
if (this.papa.currentOpened == this) this.papa.currentOpened = null;
if (this.url != "TITLE") 
{
if (!this.selected) this.mObj.backgroundColor = this.papa.miStdColor;		//set StdColor
else this.mObj.backgroundColor = this.papa.miSelColor;	
this.mObj.visibility = "hidden";
}
}
function miReset()
{
if (this.url != "TITLE") 
{
if (!this.selected) this.mObj.backgroundColor = this.papa.miStdColor;		//set StdColor
else this.mObj.backgroundColor = this.papa.miSelColor;	
}
}
function miInit(mX, mY)
{
if (this.written)
{
this.mObj = eval(doc_start_tag + this.id + doc_end_tag + sty);
if (this.url == "END") this.mObj.backgroundColor = "#2994d6";
else this.mObj.backgroundColor = this.papa.miStdColor;
this.x = mX;
this.y = mY;
this.mObj.left = this.x;
this.mObj.top = this.y + 1;
if (this.url == "END" && is.ie) this.mObj.top = this.y + 2;
}
else { 
alert ("Invalid Usage. Div for " + this.id + "was not written.");
}
}
function miSetCloseTimeout()
{
this.papa.setCloseTimeout();
}
function miUnsetCloseTimeout()
{
this.papa.unsetCloseTimeout();
}
function miSetSelected()
{
this.selected = true;
this.mObj.backgroundColor = this.papa.miSelColor;
this.papa.setSelected();
}
function mItem(id, url, Text, Target)		//-> added target to open in a new page (default is self)
{
//properties
this.id = id;
this.url = url;
this.Text = Text;
if ( !Target ) this.Target = "";
else this.Target = Target;
//this.altText = altText;
this.x = 0;
this.y = 0;
this.w = 0;
this.h = 0;
this.mObj = null;					//javascript style Object;
this.written = false; 				//flag to check whether the corresponding div was written
this.closeTimeout = null;			//Variable to hold the Timeout
this.selected = false;
//family
this.papa = null;
//functions
this.mOver = miMouseOver;
this.mOut = miMouseOut;
this.close = miClose;
this.getHTML = miGetHTML;		
this.Init = miInit;
this.resetItem = miReset;
this.setSelected = miSetSelected;
this.setCloseTimeout = miSetCloseTimeout; 
this.unsetCloseTimeout = miUnsetCloseTimeout; 
}
//mGroup Functions
//mgInit 
//initialize recursively the js-style Objects for self and kids
function mgInit()
{
if (!this.written) {
alert ("Invalid Usage. Div for " + this.id + "was not written.");
}
//iterate through kids
for (var k=0; k < this.kids.length; k++) {
this.kids[k].Init(0, this.y + (miH * k));
}		
}
function mgAddItem(kid)
{
this.kids[this.kids.length] = kid;
kid.papa = this;
kid.x = this.x - 1;
kid.y = this.y + ((this.kids.length - 1) * miH) ;
kid.w = this.w;
kid.css = this.kidsCSStyle;
}
//mgGetHTML 
//generates recursively the HTML-Code for self and kids
//returns a string with the HTML-Code
function mgGetHTML()
{
var divText="";
//iterate through kids in reverse order (because of Z-Order) 
for (var i = this.kids.length - 1; i >= 0; i--)
{
divText += this.kids[i].getHTML();
}		
this.written = true;
return(divText);
}
function mgShow(cPosX)
{
cPosX += this.xDispl;
strPosX = cPosX + "px";
for (var k=0; k < this.kids.length; k++) {
this.kids[k].mObj.left = strPosX;
this.kids[k].mObj.visibility = "visible";
}		
}
function mgReset()
{
}
function mgClose()
{
this.unsetCloseTimeout;
//kids
for (var i=0; i<this.kids.length;i++)
{
if (this.kids[i] != null) this.kids[i].mObj.visibility = "hidden";
}		
}
function mgSetCloseTimeout()
{	
if (this.closeTimeout == null) this.closeTimeout = window.setTimeout(this.id + ".close()", tpCloseTime);
this.papa.setCloseTimeout();
}
function mgUnsetCloseTimeout()
{
if (this.closeTimeout != null) window.clearTimeout(this.closeTimeout);		//eigenen Timeout löschen
this.closeTimeout = null;
this.papa.unsetCloseTimeout();					//papas Timeout löschen
}
function mgSetSelected()
{
this.selected = true;
this.papa.setSelected();	//nur durchreichen
}
/* 	der x Value wird automatisch durch den TopPoint gesetzt, 
x gibt nun das Displacement an, relativ zur xPos des TopPoint, 
war nötig für den Menüpunkt Links */
function mGroup(id, xDispl, y, w, h, kidsCSStyle, miStdColor, miHighColor, miSelColor)
{
//properties
this.id = id;
this.xDispl = xDispl;
this.y = y;
this.w = w;
this.h = h;
this.kidsCSStyle = kidsCSStyle;
this.miStdColor = miStdColor;
this.miHighColor = miHighColor;
if (miSelColor != null) this.miSelColor = miSelColor;
else this.miSelColor = miL1SelectionBackgroundColor;
this.mObj = null;					//javascript style Object;
this.written = false; 				//flag to check whether the corresponding div was written
this.closeTimeout = null;		//Variable to hold the Timeout
this.selected = false;
//family
this.currentOpened = null;		//currently selected MenuItem
this.currentHighlight = null;			//currently highlighted MenuItem
this.currentSelected = null;			//currently highlighted MenuItem
this.papa = null;
this.kids = new Array();
//functions
this.Init = mgInit;
this.addItem = mgAddItem;
this.getHTML = mgGetHTML;		
this.Show = mgShow;
this.resetGroup = mgReset;
this.close = mgClose;
this.setSelected = mgSetSelected;
this.setCloseTimeout = mgSetCloseTimeout; 
this.unsetCloseTimeout = mgUnsetCloseTimeout; 
}
function tpClose()
{
//if (!this.selected) eval ("document.images['" + this.imName + "'].src=\"" + this.imLow + "\"");
//	else eval ("document.images['" + this.imName + "'].src=\"" + this.imSel + "\"");
if (currentOpenedTopPoint == this) currentOpenedTopPoint = null;
if (this.menuGroup != null)
{
this.menuGroup.close(); 				//invisible setzen und highlights killen.
}
}
function tpMouseOver()
{
domObj = document.getElementById("d" + this.id);
cPosX = findPosX(domObj);
this.unsetCloseTimeout();												//evtl gesetzten Timeout löschen
if (this.menuGroup != null) this.menuGroup.unsetCloseTimeout();
if (currentOpenedTopPoint != null && currentOpenedTopPoint != this) 
currentOpenedTopPoint.close();										//evtl. geöffnetes Menu schliessen
currentOpenedTopPoint = this;											//yes, i´m open
if (this.menuGroup != null) this.menuGroup.Show(cPosX);													//und eigene Gruppe öffnen
}
function tpMouseOut()
{
if (this.menuGroup != null) this.setCloseTimeout();
else this.close();	//direkt lowlighten
}
function tpSetCloseTimeout()
{
if (this.closeTimeout == null) this.closeTimeout = window.setTimeout(this.id + ".close()", tpCloseTime);
}
function tpUnsetCloseTimeout()
{
if (this.closeTimeout != null) window.clearTimeout(this.closeTimeout);		
this.closeTimeout = null;
}
function tpGetHTML()
{
if (this.menuGroup != null)
{
return(this.menuGroup.getHTML());
}
else return("");
}
function tpSetGroup(menuGroup)
{
this.menuGroup = menuGroup;					//TopPoint eine Gruppe zuordnen
menuGroup.papa = this;						//Gruppe verlinken
}
function tpInit()
{
if (this.menuGroup != null)
{
this.menuGroup.Init();
}
}
function tpSetSelected()
{
this.selected = true;
}
function mTopPoint(id, imName, imLow, imHigh, imSel)
{
this.id = id;
this.mObj = null; 				//javascript style-object
this.imName = imName;
this.selected = false;			//Boolean
this.closeTimeout = null;		//Variable to hold the Timeout
this.menuGroup= null;
this.imLow = imLow;
this.imHigh= imHigh;
this.imSel = imSel;
//functions
this.mOver = tpMouseOver;
this.mOut = tpMouseOut;
this.setGroup = tpSetGroup;
this.getHTML = tpGetHTML;
this.Init = tpInit;
this.close = tpClose;
this.setCloseTimeout = tpSetCloseTimeout; 
this.unsetCloseTimeout = tpUnsetCloseTimeout; 
this.setSelected = tpSetSelected;
}
function writeMenus()
{
menuHTML = "";
for (var i=0; i < mMenus.length; i++)
{
menuHTML += mMenus[i].getHTML();//+ "\r\n";
}
return(menuHTML);
}

function writeTopMenuEng()
{
menuHTML = "";
//write Buttons
menuHTML += "<div class=\"nav\" style=\"position:relative;left:0px;top:-16px;margin-bottom:-16px;visibility:visible;background:transparent;\">";
menuHTML += "<table class=\"navtable\" cellpadding=\"0\" cellspacing=\"0\">";
menuHTML += "<tr>";
menuHTML += "<td class=\"navmarg\"><a href=\"/en/index.shtml\" onfocus=\"blur();\">VESTOSINT&reg;</a></td>";
menuHTML += "<td id=\"dtpEige\"><a href=\"javascript:tpEige.mOver();\" 		onmouseover=\"tpEige.mOver();window.status='';return true;\" onmouseout=\"tpEige.mOut();\" onfocus=\"blur();\">Properties</a></td>";
menuHTML += "<td id=\"dtpProd\"><a href=\"/en/products/index.shtml\" 	onfocus=\"blur();\">Products</a></td>";
menuHTML += "<td id=\"dtpAnwe\"><a href=\"javascript:tpAnwe.mOver();\" 		onmouseover=\"tpAnwe.mOver();window.status='';return true;\" onmouseout=\"tpAnwe.mOut();\" onfocus=\"blur();\">Applications</a></td>";
menuHTML += "<td id=\"dtpAnsp\"><a href=\"javascript:tpAnsp.mOver();\" 		onmouseover=\"tpAnsp.mOver();window.status='';return true;\" onmouseout=\"tpAnsp.mOut();\" onfocus=\"blur();\">Contact</a></td>";
menuHTML += "<td id=\"dtpServ\"><a href=\"javascript:tpServ.mOver();\" 		onmouseover=\"tpServ.mOver();window.status='';return true;\" onmouseout=\"tpServ.mOut();\" onfocus=\"blur();\">Service</a></td>";
menuHTML += "<td id=\"dtpEbus\"><a href=\"javascript:tpEbus.mOver();\" 		onmouseover=\"tpEbus.mOver();window.status='';return true;\" onmouseout=\"tpEbus.mOut();\" onfocus=\"blur();\">E-Business</a></td>";
menuHTML += "<td id=\"dtpLink\"><a href=\"javascript:tpLink.mOver();\" 		onmouseover=\"tpLink.mOver();window.status='';return true;\" onmouseout=\"tpLink.mOut();\" onfocus=\"blur();\">Links</a></td>";
menuHTML += "</tr></table>";
menuHTML += "</div>";
return(menuHTML);
}
//Globals
var currentOpenedTopPoint = null;
//Declarations
var mMenus = new Array();
//Definition
var tpCloseTime = 500; 				
tpStandardBackgroundColor = "#2b94d4";		//TopPointNormal Color
tpHighlightBackgroundColor = "#1b84c4";		//TopPointHighlight Color
tpSelectionBackgroundColor = "#ff0000";		//TopPointSelection Color
miL1StandardBackgroundColor = "#eeeeee";
miL1HighlightBackgroundColor = "#cccccc";
miL1SelectionBackgroundColor = "#efefef";
miL2StandardBackgroundColor = "#efefef";
miL2HighlightBackgroundColor = "#ffffff";
miL2SelectionBackgroundColor = "#ffffff";
miTextHighlightColor = "#ff0000";	//"#efefef";
var mgY = 89;						//Y pos of MainLayers
if (is.ns6)
mgY += 1;
var mgX = 180;						//X Start Pos of Main Layers
var tpW = 120;						//TopPoint Width 
var mgXDisplacement = 0;
var mgYDisplacement = 0;
var miH = 12;						//StdHeight of MenuItems
var miArrowImage = "/im/menu/arrowblue.gif";
var miBlindGif = "/im/bl.gif";
var tpEige = new mTopPoint("tpEige", "tppEige", "/im/menu/nav_firm.gif", "/im/menu/nav_firm_h.gif", "/im/menu/nav_firm_h.gif");
var tpProd = new mTopPoint("tpProd", "tppProd", "/im/menu/nav_prod.gif", "/im/menu/nav_prod_h.gif", "/im/menu/nav_prod_h.gif");
var tpAnwe = new mTopPoint("tpAnwe", "tppAnwe", "/im/menu/nav_anwe.gif", "/im/menu/nav_anwe_h.gif", "/im/menu/nav_anwe_h.gif");
var tpAnsp = new mTopPoint("tpAnsp", "tppAnsp", "/im/menu/nav_ansp.gif", "/im/menu/nav_ansp_h.gif", "/im/menu/nav_ansp_h.gif");
var tpServ = new mTopPoint("tpServ", "tppServ", "/im/menu/nav_serv.gif", "/im/menu/nav_serv_h.gif", "/im/menu/nav_serv_h.gif");
var tpEbus = new mTopPoint("tpEbus", "tppEbus", "/im/menu/nav_ebus.gif", "/im/menu/nav_ebus_h.gif", "/im/menu/nav_ebus_h.gif");
var tpLink = new mTopPoint("tpLink", "tppLink", "/im/menu/nav_link.gif", "/im/menu/nav_link_h.gif", "/im/menu/nav_link_h.gif");
var mgEige = new mGroup("mgEige", 0, mgY, 114, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
var mivsi_listings = new mItem("mivsi_listings", "/en/properties/listings.shtml", "Listings"); 						
mgEige.addItem(mivsi_listings);		
var mivsi_quali = new mItem("mivsi_quali", "/en/properties/quality.shtml", "Quality Assurance"); 						
mgEige.addItem(mivsi_quali);		
var miEigeEnd = new mItem("miEigeEnd", "END", "");
mgEige.addItem(miEigeEnd);
var mgProd = new mGroup("mgProd", 0, mgY, 138, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
//var miProdEnd = new mItem("miProdEnd", "END", "");
//mgProd.addItem(miProdEnd);
var mgAnwe = new mGroup("mgAnwe", 0, mgY, 140, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
var mivsi_metbesch = new mItem("mivsi_metbesch", "/en/applications/coating_metal/index.shtml", "Coating of metal"); 						
mgAnwe.addItem(mivsi_metbesch);		
var mivsi_lackadditive = new mItem("mivsi_lackadditive", "/en/applications/paint_additives/index.shtml", "Paint Additives"); 						
mgAnwe.addItem(mivsi_lackadditive);		
var mivsi_thermocomp = new mItem("mivsi_thermocomp", "/en/applications/thermoplastic_composites/index.shtml", "Thermoplastic Composites"); 						
mgAnwe.addItem(mivsi_thermocomp);		
var miAnweEnd = new mItem("miAnweEnd", "END", "");
mgAnwe.addItem(miAnweEnd);
var mgAnsp = new mGroup("mgAnsp", 0, mgY, 240, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
var mitechmark = new mItem("mitechmark", "/en/contact/technical_marketing.php", "Market Development"); 						
mgAnsp.addItem(mitechmark);		
var miksc = new mItem("miksc", "/en/contact/customer_service_center.shtml", "Customer Service Center and Regional Contacts"); 						
mgAnsp.addItem(miksc);		
var miAnspEnd = new mItem("miAnspEnd", "END", "");
mgAnsp.addItem(miAnspEnd);
var mgServ = new mGroup("mgServ", 0, mgY, 110, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
var mibrosch = new mItem("mibrosch", "/en/service/brochure.shtml", "Brochures"); 						
mgServ.addItem(mibrosch);		
var miprodinfo = new mItem("miprodinfo", "/en/service/product_information.shtml", "Product Information"); 						
mgServ.addItem(miprodinfo);		
var misds = new mItem("misds", "/en/service/safety_data_sheets.shtml", "Safety Data Sheets"); 						
mgServ.addItem(misds);		
var miServEnd = new mItem("miServEnd", "END", "");
mgServ.addItem(miServEnd);
var mgEbus = new mGroup("mgEbus", 0, mgY, 118, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
var miebus_strategy = new mItem("miebus_strategy", "/en/e-business/strategy.shtml", "Strategy"); 						
mgEbus.addItem(miebus_strategy);		
var miebus_ordermanagement = new mItem("miebus_ordermanagement", "/en/e-business/ordermanagement.shtml", "Ordermanagement"); 						
mgEbus.addItem(miebus_ordermanagement);		
var miebus_ansprech = new mItem("miebus_ansprech", "/en/e-business/contact.shtml", "Contact"); 						
mgEbus.addItem(miebus_ansprech);		
var miEbusEnd = new mItem("miEbusEnd", "END", "");
mgEbus.addItem(miEbusEnd);
var mgLink = new mGroup("mgLink", -110 /* nach links verschieben */, mgY, 180, 100, "mItemTable", miL1StandardBackgroundColor, miL1HighlightBackgroundColor, miL1SelectionBackgroundColor);
var miCoatings = new mItem("miCoatings", "http://www.degussa4coatings.com", "www.degussa4coatings.com", "blank");
mgLink.addItem(miCoatings);
var miPlastics = new mItem("miPlastics", "http://www.degussa-plastics.com", "www.degussa4plastics.com", "blank");
mgLink.addItem(miPlastics);
var miDaicel = new mItem("miDaicel", "http://www.daicel-evonik.com", "www.daicel-evonik.com&nbsp;&nbsp;(extern)", "blank");
mgLink.addItem(miDaicel);
var miHPPChina = new mItem("miHPPChina", "http://www.degussa-hpp.com.cn", "www.degussa-hpp.com.cn (extern)", "blank");
mgLink.addItem(miHPPChina);
var miVestamelt = new mItem("miVestamelt", "http://www.vestamelt.com", "www.vestamelt.com", "blank");
mgLink.addItem(miVestamelt);
var miLinkEnd = new mItem("miLinkEnd", "END", "");
mgLink.addItem(miLinkEnd);
tpEige.setGroup(mgEige);
tpProd.setGroup(mgProd);
tpAnwe.setGroup(mgAnwe);
tpAnsp.setGroup(mgAnsp);
tpServ.setGroup(mgServ);
tpEbus.setGroup(mgEbus);
tpLink.setGroup(mgLink);
//Set Menu Array 
mMenus[mMenus.length] = tpEige;
mMenus[mMenus.length] = tpProd; 
mMenus[mMenus.length] = tpAnwe; 
mMenus[mMenus.length] = tpAnsp; 
mMenus[mMenus.length] = tpServ; 
mMenus[mMenus.length] = tpEbus;
mMenus[mMenus.length] = tpLink;
//mInit()
//Initialize the style objects of all menu elements 
function doInit()
{
for (var i=0; i < mMenus.length; i++)
{
mMenus[i].Init();
}
}
function mInit()
{
if (is.ns4) window.setTimeout("doInit()", 1000) 	// NS %$§#&%$
else
doInit();		
}