function doSelectCompany() {
  var nr = document.companyselect.company.options[document.companyselect.company.selectedIndex].value;

  if (nr != -1) {
    for (i=1; i<=document.companyselect.numcompanies.value; i++) {
      document.getElementById("company"+i).style.display = "none";
    }
    document.getElementById("company"+nr).style.display = "block";
  }
}

actlogo = 1;

function chooseLogo(numlogos) {
  rd = Math.floor(Math.random()*numlogos)+1;
  actlogo = rd;
  document.getElementById("logo"+rd).style.display = "block";
}

function changeLogo(action, numlogos) {
  var newlogo;
  if (action == 'next') {
   newlogo = actlogo+1;
   if (newlogo > numlogos) {
     newlogo = 1;
   }
  }
  if (action == 'prev') {
   newlogo = actlogo-1;
   if (newlogo < 1) {
     newlogo = numlogos;
   }
  }
  for (i=1; i<=numlogos; i++) {
    document.getElementById("logo"+i).style.display = "none";
  }
  document.getElementById("logo"+newlogo).style.display = "block";
  actlogo = newlogo;
}


actproduct = 1;

function changeProduct(action, numproducts) {
  var newproduct;
  if (action == 'next') {
   newproduct = actproduct+1;
   if (newproduct > numproducts) {
     newproduct = 1;
   }
  }
  if (action == 'prev') {
   newproduct = actproduct-1;
   if (newproduct < 1) {
     newproduct = numproducts;
   }
  }
  for (i=1; i<=numproducts; i++) {
    document.getElementById("product"+i).style.display = "none";
    document.getElementById("productname"+i).style.display = "none";
  }
  document.getElementById("product"+newproduct).style.display = "block";
  document.getElementById("productname"+newproduct).style.display = "block";
  actproduct = newproduct;
}



function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeMap(_pNrOn, _pNrOff) {
	var map_on = document.getElementById("map_" + _pNrOn);
	var map_off = document.getElementById("map_" + _pNrOff);

	var map_link_on = document.getElementById("map_link_" + _pNrOn);
	var map_link_off = document.getElementById("map_link_" + _pNrOff);

	var map_icon_on = document.getElementById("map_icon_" + _pNrOn);
	var map_icon_off = document.getElementById("map_icon_" + _pNrOff);
			
  var popuplink_on = document.getElementById("popuplink_" + _pNrOn);
  var popuplink_off = document.getElementById("popuplink_" + _pNrOff);
      
	map_on.style.display = "block";
	map_off.style.display = "none";
	
	map_link_on.className = "map_link_h";
	map_link_off.className = "map_link_l";	
	
	map_icon_on.src = "../_media/img/contact/" + _pNrOn + "_h.gif";
	map_icon_off.src = "../_media/img/contact/" + _pNrOff + "_l.gif";	

  popuplink_on.style.display = "block";
  popuplink_off.style.display = "none";
  
}


function showMapLayer(nr, xpos, ypos) {
  hideAllMapLayer();
  document.getElementById("maplayer"+nr).style.visibility = 'visible';
}

function hideMapLayer(nr) {
  document.getElementById("maplayer"+nr).style.visibility = 'hidden';
}

function hideAllMapLayer() {
  for (var i=1; i<=10; i++) {
    document.getElementById("maplayer"+i).style.visibility = 'hidden';
  }
}