// MAIN NAV

var loc = self.location.href;

function swapover(n) {if (document.images){document.images['image_'+n].src = eval("c_" + n + ".src");}}
function swapout(n) 
{
	if (loc.indexOf("/"+n+"/") ==-1)
	{
		if (document.images){document.images['image_'+n].src = eval("b_" + n + ".src");}
	}
} 

var hash=escape(self.location.pathname);
/*if (hash)
{
	var testeradframe = hash.indexOf('adframe');
	if (testeradframe==-1)
	{	
		var testerhtm = hash.indexOf('.htm');
		if (testerhtm == -1)
		{
			hash+='index.html';
		}
		var temp='/cgi-bin/adframe'+hash;
		top.location=temp 
	}
} */

function encodeAdframeUrl(url,adframesessionid)
{
	if ((adframesessionid != '') && (adframesessionid.indexOf("<") == -1) )
	{
		if (url.indexOf('?') > -1)
		{
			url += "&";
		}
		else
		{	
			url += "?" ;
		} 
		url = '/cgi-bin/adframe/'+url+'id='+adframesessionid;
	}
	return url;
}

function genericOpenNoScroll(name,url,width,height)
{
	var genmesg = open(url,name,"toolbar=0,status=0,menubar=0,resizable=no,scrollbars=no,width="+width+",height="+height); 
}

function genericOpen(name,url,width,height)
{
	var genmesg = open(url,name,"toolbar=1,status=0,menubar=1,resizable=yes,scrollbars=yes,width="+width+",height="+height); 
}

var extension='_b';

// Ersetzt alle Vorkommnisse des String "From" im String "string" durch den String "to"
function substitute(string,from,to){
	var temp=''
	if (string.indexOf(from)!=-1){
		temp=string.substring(0,string.indexOf(from))
		temp+=to
		temp+=substitute(string.substring(string.indexOf(from)+from.length,string.length),from,to)
	}
	else temp=string
	return temp
}

function zoom(bildID)
{
	var path=substitute(self.document.images[bildID].src,'\\','/');
	var filename=path.substring(path.lastIndexOf('/'),path.length);
	var dir=path.substring(0,path.lastIndexOf('/'));
	var ImgSrc=dir + substitute(filename,'.',extension+'.');
	zoomwindow=window.open('','zoom','width=200,height=200,resizable=no,toolbar=0,status=1,menubar=0,scrollbars=no')
	zoomwindow.document.open()
	zoomwindow.document.write('<head><title>AMTEC Packaging Machines - Zoom</title><link rel="stylesheet" type="text/css" href="/de/styles.css"><script language="javascript" src="/de/script.js"></script></head><body onload="opener.resize();" bgcolor="#ffffff" link="#FFB000" alink="#FFB000" vlink="#FFB000" text="#00255D" leftmargin="0" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0"><center><table border="0" cellpadding="0" cellspacing="0"><tr><td><img name=bild src=' + ImgSrc + ' alt="AMTEC Packaging Machines" title="AMTEC Packaging Machines" border="0" hspace="8" vspace="8"></td></tr><tr><td align="center"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="55" height="20" align="center"><a noadd href="javascript:self.close()" title="close window"><img src="/de/img/button_close.gif" width=55 height=20 alt="" border="0"></a></td></tr></table></td></tr></table></center></body></html>')
	zoomwindow.document.close()
	zoomwindow.focus()
}

function zoomByArticleNo(articleno)
{
	var ImgSrc='/machines_img/' + articleno + '_b.jpg';
	zoomwindow=window.open('','zoom','width=200,height=200,resizable=no,toolbar=0,status=1,menubar=0,scrollbars=no')
	zoomwindow.document.open()
	zoomwindow.document.write('<head><title>AMTEC Packaging Machines - Zoom</title><link rel="stylesheet" type="text/css" href="/de/styles.css"><script language="javascript" src="/de/script.js"></script></head><body onload="opener.resize();" bgcolor="#ffffff" link="#FFB000" alink="#FFB000" vlink="#FFB000" text="#00255D" leftmargin="0" topmargin="0" rightmargin="0" marginheight="0" marginwidth="0"><center><table border="0" cellpadding="0" cellspacing="0"><tr><td><img name=bild src=' + ImgSrc + ' alt="AMTEC Article-No: ' + articleno + '" title="AMTEC Article-No: ' + articleno + '" border="0" hspace="8" vspace="8"></td></tr><tr><td align="center"><table border="0" cellpadding="0" cellspacing="0"><tr><td width="55" height="20" align="center"><a noadd href="javascript:self.close()" title="close window"><img src="/de/img/button_close.gif" width=55 height=20 alt="" border="0"></a></td></tr></table></td></tr></table></center></body></html>')
	zoomwindow.document.close()
	zoomwindow.focus()
}

function resize()
{
	var width=zoomwindow.document.images.bild.width
	var height=zoomwindow.document.images.bild.height

	if (document.all)
	{
		//  IE 
		zoomwindow.resizeTo(width+60,height+130);
	}
	else if (document.getElementById)
	{
		// Netscape 7 
		zoomwindow.resizeTo(width+53,height+122);
	}
	else if (document.layers)
	{
		// Netscape 4 und so
		zoomwindow.resizeTo(width,height);
	}		
}

if (document.images)
{
b_machines = new Image(); b_machines.src = "/de/img/nav_machines_off.gif";
c_machines = new Image(); c_machines.src = "/de/img/nav_machines_on.gif";

b_company = new Image(); b_company.src = "/de/img/nav_company_off.gif";
c_company = new Image(); c_company.src = "/de/img/nav_company_on.gif";

b_service = new Image(); b_service.src = "/de/img/nav_service_off.gif";
c_service = new Image(); c_service.src = "/de/img/nav_service_on.gif";
}

// MAIN NAV SUB
      function noErrors() {
        return true;
      }
      window.onerror = noErrors;

      function checkBrowser() {
        this.ver = navigator.appVersion;
        this.dom = document.getElementById?1:0;
        this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom)?1:0;
        this.ie4 = (document.all && !this.dom)?1:0;
        this.ns5 = (this.dom && parseInt(this.ver) >= 5)?1:0;
        this.ns4 = (document.layers && !this.dom)?1:0;
        this.bw = (this.ie5 || this.ie4 || this.ns4 || this.ns5);
        return this;
      }

      bw = new checkBrowser();

      function show(div,nest) {
        obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
        obj.visibility='visible';
      }

      function hide(div,nest) {
        obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
        obj.visibility='hidden';
      }

      function showHideSubMenu(ID) {
        if (ID == 1) {show('SubMenu01')} else {hide('SubMenu01')};
		if (ID == 2) {show('SubMenu02')} else {hide('SubMenu02')};
		if (ID == 3) {show('SubMenu03')} else {hide('SubMenu03')};
      }