// Switches highlight on or off in the main menu
function buildNav()
	{

	// MAIN NAVIGATION POINTS
	if (location.pathname.indexOf('home')>0)
		{
		document.getElementById('home').className='menulinkactive';
		document.getElementById('homesub').style.display='block';
		}
	if (location.pathname.indexOf('neuheiten')>0)
		{
		document.getElementById('neuheiten').className='menulinkactive';
		}
	if (location.pathname.indexOf('loesungen')>0)
		{
		document.getElementById('loesungen').className='menulinkactive';
		document.getElementById('loesungensub').style.display='block';
		}
	if (location.pathname.indexOf('kopierpapier')>0)
		{
		document.getElementById('kopierpapier').className='menulinkactive';
		}
	if (location.pathname.indexOf('bueromoebel')>0)
		{
		document.getElementById('bueromoebel').className='menulinkactive';
		document.getElementById('bueromoebelsub').style.display='block';
		}
	if (location.pathname.indexOf('praesentationsgeraete')>0)
		{
		document.getElementById('praesentationsgeraete').className='menulinkactive';
		document.getElementById('praesentationsgeraetesub').style.display='block';
		}

	if (location.pathname.indexOf('copykurier')>0)
		{
		document.getElementById('copykurier').className='menulinkactive';
		}
		
	if (location.pathname.indexOf('kontakt')>0)
		{
		document.getElementById('kontakt').className='menulinkactive';
		document.getElementById('kontaktsub').style.display='block';
		}


	// SUB-NAVIGATION POINTS
	if (location.pathname.indexOf('team.html')>0)
		{
		document.getElementById('team').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('schwarzweiss.html')>0)
		{
		document.getElementById('schwarzweiss').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('farbig.html')>0)
		{
		document.getElementById('farbig').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('zemp.html')>0)
		{
		document.getElementById('zemp').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('haworth.html')>0)
		{
		document.getElementById('haworth').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('dauphin.html')>0)
		{
		document.getElementById('dauphin').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('girsberger.html')>0)
		{
		document.getElementById('girsberger').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('3m.html')>0)
		{
		document.getElementById('3m').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('canon.html')>0)
		{
		document.getElementById('canon').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('epson.html')>0)
		{
		document.getElementById('epson').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('benq.html')>0)
		{
		document.getElementById('benq').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('optoma.html')>0)
		{
		document.getElementById('optoma').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('visalux.html')>0)
		{
		document.getElementById('visalux').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('andere.html')>0)
		{
		document.getElementById('andere').className='menulinkactivebg';
		}
	if (location.pathname.indexOf('standort.html')>0)
		{
		document.getElementById('standort').className='menulinkactivebg';
		}
	
	}


// If user is on Kontakt, Sitemap or Disclaimer, make that black
function settopnav()
	{
	if (location.pathname.indexOf('kontakt')>0)
		{
		var pos = 'kontakt';
		}

	if (location.pathname.indexOf('sitemap')>0)
		{
		var pos = 'sitemap';
		}

	if (location.pathname.indexOf('disclaimer')>0)
		{
		var pos = 'disclaimer';
		}
	if (pos)
		{
		document.getElementById(pos).className='topmenulinkon';
		}
	}


// Set background of main navigation points
function checkNav(id,check)
	{
	if (location.pathname.indexOf(check)>0)
		{
		id.className='menulinkactive';
		}
	else
		{
		id.className='menulink';
		}
	}



// Set background of sub-navigation points
function checkSubnav(id,check)
	{
	if (location.pathname.indexOf(check)>0)
		{
		id.className='menulinkactivebg';
		}
	else
		{
		id.className='submenulink';
		}
	}



// Sets the picture projektor
function claimprojektor(id)
	{
	var pix = Math.floor(Math.random()*6);
	var pix = pix +1;
	var url = "../../_img/global/claimprojektor"+pix+".jpg";
	document.getElementById(id).src=""+url+"";
	}


// Sets the picture moebel
function claimmoebel(id)
	{
	var pix = Math.floor(Math.random()*6);
	var pix = pix +1;
	var url = "../../_img/global/claimmoebel"+pix+".jpg";
	document.getElementById(id).src=""+url+"";
	}


// Sets the picture drucker
function claimdrucker(id)
	{
	var pix = Math.floor(Math.random()*5);
	var pix = pix +1;
	var url = "../../_img/global/claimdrucker"+pix+".jpg";
	document.getElementById(id).src=""+url+"";
	}



// Open the correct Situationsplan
function openPlan(id)
	{
	var top = (screen.height/2)-270;
	var left = (screen.width/2)-312;
	window.open("situationsplan_"+id+".html","situationsplan","top="+top+",left="+left+",width=645,height=600,scrollbars=yes");
	}


// Check that all required form fields are filled in

function checkFields()
	{
	if (document.kontakt.elements[2].value=='' || document.kontakt.elements[5].value=='' || document.kontakt.elements[6].value=='' || document.kontakt.elements[7].value=='' || document.kontakt.elements[9].value=='')
		{
		document.getElementById('warning').style.display='block';
		return false;
		}
	else
		{
		document.kontakt.submit();
		}
	}

