items=
{
   '1':{'className':'dropDownBox','contentClassName':'dropDownBoxContent','items':new Array(
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'autohaus/geschichte.php',
		'html':'Firmengeschichte'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'autohaus/oldtimer.php',
		'html':'Oldtimer'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'autohaus/bilder.php',
		'html':'Bildnachlese'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'autohaus/team.php',
		'html':'Unser Opel Team'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'autohaus/anfahrt.php',
		'html':'Ihr Weg zu uns'
	})},

   '2':{'className':'dropDownBox','contentClassName':'dropDownBoxContent','items':new Array(
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'fahrzeuge/neuwagen.php',
		'html':'Neuwagen'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'fahrzeuge/gebrauchtwagen.php',
		'html':'Gebrauchtwagen'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'fahrzeuge/roller.php',
		'html':'Roller'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'fahrzeuge/anhaenger.php',
		'html':'Anh&auml;nger'
	})},

   '4':{'className':'dropDownBox','contentClassName':'dropDownBoxContent','items':new Array(
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'service/aktuell.php',
		'html':'Aktuell'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'service/rent.php',
		'html':'Mietwagen'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'service/panne.php',
		'html':'Pannenservice'
	},
	{
		'className':'dropDownNavi',
		'onActive':'this.className=\'dropDownNaviActive\';',
		'onDeactive':'this.className=\'dropDownNavi\';',
		'href':'service/waschanlage.php',
		'html':'Waschanlage'
	})}


}



function ahdMenuEngine(name,items, maxRightMargin)
{
	var machine=this;

	this.name=name;
	this.items=items;
	this.maxRightMargin=(maxRightMargin ? maxRightMargin : 'Math.round((document.body.clientWidth)/2)+720');

	this.timer=500;
	this.timerObj=false;

	this.renderItem=function(id, path) {
		html='';

		if (this.items[id] && this.items[id]['items'] && this.items[id]['items'].length>0)
		{


			html+='<div';
			html+=' id="'+this.name+'_'+id+'"';
			html+=' onmouseover="'+this.name+'.clearTimer();"';
			html+=' onmouseout="'+this.name+'.setTimer();"';
			html+=(this.items[id]['className'] ? ' class="'+this.items[id]['className']+'"' : '');
			html+='>';

			html+='<div';
			html+=' onmouseover="'+this.name+'.clearTimer();"';
			html+=' onmouseout="'+this.name+'.setTimer();"';
			html+=(this.items[id]['contentClassName'] ? ' class="'+this.items[id]['contentClassName']+'"' : '');
			html+='>';

			for (j=0;j<this.items[id]['items'].length;j++)
			{

				html+='<div';
				html+=' onmouseover="'+this.name+'.clearTimer();'+(this.items[id]['items'][j]['onActive'] ? this.items[id]['items'][j]['onActive'] : '')+'"';
				html+=' onmouseout="'+this.name+'.setTimer();'+(this.items[id]['items'][j]['onDeactive'] ? this.items[id]['items'][j]['onDeactive'] : '')+'"';
				html+=(this.items[id]['items'][j]['className'] ? ' class="'+this.items[id]['items'][j]['className']+'"' : '');
				html+='>';

				html+='<a';
				html+=' href="'+path+this.items[id]['items'][j]['href']+'"';
				html+=' onfocus="'+this.name+'.clearTimer();"';
				html+=' onblur="'+this.name+'.setTimer();"';
				html+='>';

				html+=this.items[id]['items'][j]['html'];

				html+='</a>';

				html+='</div>\n';

			}

			html+='</div>';
			html+='</div>\n';
		}
		document.write(html);
	},

	this.show=function(id) {
 		id=this.name+'_'+id;

		if (document.getElementById && document.getElementById(id)) 
		{
 			this.clearTimer();
			this.hide();

			rightMargin=(parseInt(document.getElementById(id).offsetLeft))+parseInt(document.getElementById(id).parentNode.offsetLeft)+parseInt(document.getElementById(id).offsetWidth);
			maxRightMargin=(isNaN(this.maxRightMargin) ? eval(this.maxRightMargin) : parseInt(this.maxRightMargin));

			if (rightMargin>maxRightMargin)
			{
				newLeft=parseInt(document.getElementById(id).offsetLeft)+maxRightMargin-rightMargin;
				document.getElementById(id).style.left=newLeft+'px';
			}

			document.getElementById(id).style.visibility='visible';
 			this.toggleObjectsVisibility('hidden');
		}
	},

	//-----------------------------------------------------------------------------
	this.setTimer=function ()
	{
		this.clearTimer();
		this.timerObj=setTimeout(this.callHide,this.timer);
	},

	//-----------------------------------------------------------------------------
	this.callHide=function ()
	{
		machine.hide();
	},

	//-----------------------------------------------------------------------------
	this.clearTimer=function ()
	{
		clearTimeout(this.timerObj);
	},

	this.hide=function () {
		var i;

		if (document.getElementById)
		{
			for (i in this.items)
			{
				if (obj=document.getElementById(this.name+'_'+i))
				{
					obj.style.visibility='hidden';
				}
			}
		}
 		this.toggleObjectsVisibility('visible');
	},

	//-----------------------------------------------------------------------------
	this.toggleObjectsVisibility=function (visibility) {
		var i;

		if (document.body.getElementsByTagName)
		{
			objs=document.body.getElementsByTagName('OBJECT');
			for (i=0;i<objs.length;i++)
			{
				if (objs[i].getAttribute('ahdMenuFadeOut'))
				{
					objs[i].style.visibility=visibility;
				}
			}
		}
	}
}
<!--noCrawl:start-->


