﻿var Portale = new Array();
Portale[0] = { id: "ludwigslust", name: "Landkreis Ludwigslust", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Ludwigslust/index.jsp" };
Portale[1] = { id: "boizenburg_land", name: "Amt Boizenburg-Land", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Boizenburg-Land/index.jsp" };
Portale[2] = { id: "doemitz_malliss", name: "Amt Dömitz-Malliß", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Doemitz-Malliss/index.jsp" };
Portale[3] = { id: "hagenow_land", name: "Amt Hagenow-Land", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Hagenow-Land/index.jsp" };
Portale[4] = { id: "stralendorf", name: "Amt Stralendorf", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Stralendorf/index.jsp" };
Portale[5] = { id: "wittenburg", name: "Amt Wittenburg", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Wittenburg/index.jsp" };
Portale[6] = { id: "zarrentin", name: "Amt Zarrentin", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Zarrentin/index.jsp" };
Portale[7] = { id: "boizenburg", name: "Stadt Boizenburg/Elbe", url: /*VIPURL*/"http://www.kreis-lwl.de/cms2/LWL_prod/LWL/Boizenburg_Elbe/index.jsp" };

function displayPortalBox(Portal) {
  try {
    var psa = document.getElementById("portalselectarea");
    psa.innerHTML = getPortalBox(Portal);
  } catch (ex) {}
}
function getPortalBox(PortalID) {
  var box = "<select id=\"portalselect\" name=\"portalswitch\" onchange=\"openPortal(this.options[this.selectedIndex].value)\">";
  for (var i = 0; i < Portale.length; i++) {
    var portal = Portale[i];
    box += "<option value=\""+ portal.url +"\""+ (PortalID == portal.id ? "selected=\"selected\"" : "") +">" + portal.name + "</option>";
  }
  box += "</select>";
  return box;
}
function openPortal(PortalLocation) {
  var Prod = PortalLocation.match(/prod/);
  if (Prod) {
    //document.location = "http://lwl.mvnet.de/" + PortalLocation.substr(38);
    document.location = "http://www.kreis-lwl.de/cms2/LWL_prod".substr(0,"http://www.kreis-lwl.de/cms2/LWL_prod".indexOf("/",10)+1) + PortalLocation.substr("http://www.kreis-lwl.de/cms2/LWL_prod/LWL/".length);
  } else {
    document.location = PortalLocation;
  }
}