
var wein_filter_names = new Array('farbeart', 'landnr', 'regionnr', 'rebsorte', 'warengruppenr', 'preisgruppe');

var cleared=true;
 
var button = new Array();

button[0] = new Image();
button[0].src = "/img/navibg.gif";

button[1] = new Image();
button[1].src = "/img/nav_trenner.gif";

button[2] = new Image();
button[2].src = "/img/navibg_hi.gif";

button[1] = new Image();
button[1].src = "/img/nav_trenner_hi.gif";

button[3] = new Image();
button[3].src = "/img/subnav_bg.gif";

/*
*/

function navihiliteHide(num,count)
{
	for (a=0;a<count;a++) 
	{
		// var otherdivname2 = "tn"+a;
		// var lastotherdivname2 = "tn"+(a-1);
		if (a>0) 
		{
		var formerdivname3 = "tn_in"+(a-1);
		}
		var otherdivname3 = "tn_in"+a;
	
		var navitrenner = "nt"+(a);
		var nextnavitrenner = "nt"+(a+1);
		aname = "nava"+a;

		if (document.getElementById(otherdivname3) && document.getElementById(otherdivname3).selected!=true)
		{
			if (a==0 || a==count)
			{
				document.images[navitrenner].src="/img/no.gif";
			} 
			else if (document.getElementById(formerdivname3).selected!=true) 
			{
				document.images[navitrenner].src="/img/nav_trenner.gif";
			} 
			
			if (a+1==count)
			{
				document.images[nextnavitrenner].src="/img/no.gif";
			} 
			
			document.getElementById(otherdivname3).style.backgroundImage="url(/img/navibg.gif)";
			document.getElementById(otherdivname3).style.height="20px";
			document.getElementById(otherdivname3).style.color="#FFFFFF";
			document.getElementById(aname).style.color="#FFFFFF";
		} 
		else 
		{ 
			document.images[navitrenner].src="/img/nav_trenner_hi.gif";
			document.images[nextnavitrenner].src="/img/nav_trenner_hi.gif";
		}
	}
}

function naviClear(num,count)
 {
	if (cleared==false) 
	{
	var a=0;
		for (a=0;a<=count;a++) 
		{
			var otherdivname = "subnavdiv"+a;
			if (document.getElementById(otherdivname))
			{
				document.getElementById(otherdivname).style.visibility="hidden";
			}			
		}
	navihiliteHide(num,count);
	return cleared=true;
	}
 }
 
function navihiliteShow(num,count)
{
	divname2 = "tn"+num;
	navitrennerL = "nt"+(num);
	divname3 = "tn_in"+num;
	aname = "nava"+num;
	
	if (num>0) 
	{
		document.images[navitrennerL].src="/img/nav_trenner_hi.gif";
		// document.getElementById(divname3).style.backgroundColor="#E6E6E6";
		document.getElementById(divname3).style.backgroundImage="url(/img/navibg_hi.gif)";
		document.getElementById(divname3).style.height="24px";
		navitrennerR = "nt"+(num+1);
		document.images[navitrennerR].src="/img/nav_trenner_hi.gif";
	}
	document.getElementById(divname3).style.color="#668800";
	document.getElementById(aname).style.color="#668800";
	
}

function navihiliteSelect(num,count) 
{
	var topdivname = "tn_in"+num;
	aname = "nava"+num;
	document.getElementById(topdivname).selected=true;
	document.getElementById(aname).style.color="#668800";
	document.getElementById(topdivname).style.backgroundImage="url(/img/navibg_hi.gif)";
	document.getElementById(topdivname).style.height="24px";
	/*
	*/
	
	navitrennerL = "nt"+(num);
	navitrennerR = "nt"+(num+1);
	document.images[navitrennerL].src="/img/nav_trenner_hi.gif";
	document.images[navitrennerR].src="/img/nav_trenner_hi.gif";
}

function naviShow(num,count) 
{
	if (count>0) 
	{
		naviClear(num,count);
	}
	if (cleared==true) 
	{
		// document.getElementById("subnavi").style.visibility="visible";
		if (num>0) 
		{
			divname = "subnavdiv"+num;
			document.getElementById(divname).style.visibility="visible";
		}
		navihiliteShow(num,count);
		return cleared=false;
	} 
}

function naviHide(num,count)
{
	divname = "subnavdiv"+num;
	document.getElementById(divname).style.visibility="hidden";
}

function resizebg()
{
	winWidth = document.body.clientWidth;
	minWidth = 980;
	maxWidth = 1280;
	diffWidth = ((winWidth-minWidth)/2);

	if (winWidth<minWidth) 
	{ 
		contentWidth = minWidth; 
	}
	else if (winWidth>maxWidth) 
	{ 
		contentWidth = maxWidth; 
	}
	else 
	{ 
		contentWidth = (minWidth+diffWidth); 
	}

	if (winWidth>contentWidth) 
	{ 
		xposout = ((winWidth-contentWidth)/2); 
		xposin = ((winWidth-minWidth)/2); 
	} 
	else 
	{ 
		xposin=0; 
		xposout=0; 
	}

	document.getElementById("footerbgdiv").style.left=xposout;
	document.getElementById("footerbgdiv").style.width=contentWidth;
	document.getElementById("footerbgdiv").style.clip="rect(0px "+diffWidth+"px 0px "+diffWidth+")";

	document.getElementById("outerdiv").style.left=xposin;
	/*
	document.getElementById("bgdivclip").style.left=xposout;
	document.getElementById("bgdivclip").style.width=contentWidth;
	document.getElementById("bgdivclip").style.clip="rect(0px "+diffWidth+"px 0px "+diffWidth+")";
	*/
}

function howtoBewertung () 
{
	fenster = window.open('/richtlinien-bewertung.html', "fenster1", "width=600,height=400,status=yes,scrollbars=yes,resizable=yes,menubar=no,location=no,toolbar=no");
	fenster.focus();
}

function remove_cookie(CookieName) 
{
	document.cookie = CookieName + "=" + '' + '; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT';
}

function reset_wein_filter() 
{
	for (i = 0; i < wein_filter_names.length; i++) 
	{
		remove_cookie(wein_filter_names[i]);
	}
}

function set_wein_filter(CookieName, CookieValue) 
{
	document.cookie = CookieName+"="+CookieValue+"; path=/";
}