/*-Fenster für Landtagswahl 2006 der Gemeinden (ohne Briefwahl in amtsangehörigen Gemeinden)  _*/
function ViewWahlen(bildtitel, ebene, wahlart, vorend, wahljahr)
{
var eigenschaften,sbreite,shoehe,fenster,b,h;

sbreite = 1024;
shoehe = 768;

x = (1024 - sbreite)/2;
y = (768 - shoehe)/2;;

eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+sbreite+",height="+shoehe+",menubar=no,toolbar=no,statusbar=0";

fenster=window.open("","",eigenschaften);
fenster.focus();
fenster.document.open();
with (fenster) {
  document.write('<html>');
  document.write('<head>');
  document.write('<title>'+ bildtitel +'</title>');
  document.write('</head>');
  document.write('<body  bgcolor="#ffffFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">');
  document.write('<p align="center">');
  document.write('<applet code="wahlen.class" codebase="/cms2/STAM_prod/STAM/_JavaApplet/lawa2006/" width='+sbreite+' height='+shoehe+'>');
  document.write('----------------------------------------------------------------------');
  document.write('<PARAM NAME=AUSWERTUNGSEBENE VALUE="'+ebene+'">');  
  document.write('<PARAM NAME=WAHLART VALUE="'+wahlart+'">');  
  document.write('<PARAM NAME=VOREND VALUE="'+vorend+'">');  
  document.write('<PARAM NAME=WAHLJAHR VALUE="'+wahljahr+'">');
  document.write('----------------------------------------------------------------------');
  document.write('<PARAM NAME=KLASSE_SPD_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_CDU_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_DIELINKE_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_FDP_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_GRUENE_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_NPD_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_SONSTIGE_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_WAHLBETEILIGUNG_AKTUELL VALUE="0">');
  document.write('----------------------------------------------------------------------');
  document.write('<PARAM NAME=KLASSE_SPD_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_CDU_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_DIELINKE_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_FDP_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_GRUENE_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_NPD_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_SONSTIGE_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_WAHLBETEILIGUNG_ALT VALUE="0">');
  document.write('----------------------------------------------------------------------');
  document.write('<H4> Ihr Browser versteht kein Java oder unter Optionen ist Java deaktiviert! </H4>');
  document.write('----------------------------------------------------------------------');
  document.write('</applet>');
  document.write('</p>');
  document.write('</body>');
  document.write('</html>');
  fenster.document.close();
}
}

/* Fenster für Wahlkreis- und Gemeindeergebnisse (kartografisch) */
function ViewBuWa(bildtitel, ebene)
{
var eigenschaften,sbreite,shoehe,fenster,b,h;

sbreite = 1024;
shoehe = 768;

x = (1024 - sbreite)/2;
y = (768 - shoehe)/2;;

eigenschaften="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+sbreite+",height="+shoehe+",menubar=no,toolbar=no,statusbar=0";

fenster=window.open("","",eigenschaften);
fenster.focus();
fenster.document.open();
with (fenster) {
  document.write('<html>');
  document.write('<head>');
  document.write('<title>'+ bildtitel +'</title>');
  document.write('</head>');
  document.write('<body  bgcolor="#ffffFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">');
  document.write('<p align="center">');
  document.write('<applet code="buwa2005.class" codebase="/cms2/STAM_prod/STAM/_JavaApplet/buwa2005/" width='+sbreite+' height='+shoehe+'>');
  document.write('----------------------------------------------------------------------');
  document.write('<PARAM NAME=AUSWERTUNGSEBENE VALUE="'+ebene+'">');
  document.write('----------------------------------------------------------------------');
  document.write('<PARAM NAME=KLASSE_SPD_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_CDU_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_DIELINKE_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_FDP_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_GRUENE_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_NPD_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_SONSTIGE_AKTUELL VALUE="0">');
  document.write('<PARAM NAME=KLASSE_WAHLBETEILIGUNG_AKTUELL VALUE="0">');
  document.write('----------------------------------------------------------------------');
  document.write('<PARAM NAME=KLASSE_SPD_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_CDU_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_DIELINKE_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_FDP_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_GRUENE_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_NPD_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_SONSTIGE_ALT VALUE="0">');
  document.write('<PARAM NAME=KLASSE_WAHLBETEILIGUNG_ALT VALUE="0">');
  document.write('----------------------------------------------------------------------');
  document.write('<H4> Ihr Browser versteht kein Java oder unter Optionen ist Java deaktiviert! </H4>');
  document.write('----------------------------------------------------------------------');
  document.write('</applet>');
  document.write('</p>');
  document.write('</body>');
  document.write('</html>');
  fenster.document.close();
}
}
/*Bild----------------------------------------------------*/

function zeigepublikationsbild(url,breite,hoehe)
{
   breite += 40;
   hoehe += 40;

   // ggf. an Bildschirm anpassen
   if (breite >= screen.width || hoehe >= screen.height)
   {
      breite = screen.width - 100;
      hoehe  = screen.height - 200;
   }

   var startposition_x = screen.width/2 - breite/2;
   var startposition_y = screen.height/2 - hoehe/2 - 30;

   rppubbild = window.open(url,"rppubbild","width="+breite+",height="+hoehe+",menubar=no,toolbar=no,locationbar=no,status=no,scrollbars=yes,resizable=yes,dependent=no,screenX="+startposition_x+",screenY="+startposition_y);
   //rppubbild.resizeTo(breite,hoehe);
   //rppubbild.moveTo(startposition_x,startposition_y);
   rppubbild.focus();
}

function zeigebild(url,breite,hoehe)
{
   if (breite > 0 && hoehe > 0)
   {
      // Mindestbreite
      if (breite < 440)
      {
         breite = 440;
      }
      // Rahmen vergroessern
      breite += 50;
      hoehe  += 125;
      // Serviceassistent-Bildergalerie benoetigt mehr Hoehe
      if (url.indexOf(/*VIPURL*/"http://www.statistik-mv.de/cms2/STAM_prod/STAM/_Vorlagen/de/JSP/bildansicht_galerie.jsp") > -1)
      {
         hoehe += 150;
      }
   }

   // ggf. an Bildschirm anpassen
   if (breite >= screen.width || hoehe >= screen.height || breite == 0 || hoehe == 0)
   {
      breite = screen.width - 100;
      hoehe  = screen.height - 200;
   }

   var startposition_x = screen.width/2 - breite/2;
   var startposition_y = screen.height/2 - hoehe/2 - 30;

   rpgalerie = window.open(url,"rpgalerie","width="+breite+",height="+hoehe+",menubar=no,toolbar=no,locationbar=no,status=no,scrollbars=yes,resizable=yes,dependent=no,screenX="+startposition_x+",screenY="+startposition_y);
   rpgalerie.resizeTo(breite,hoehe);
   rpgalerie.moveTo(startposition_x,startposition_y);
   rpgalerie.focus();
}

/*Organigramm----------------------------------------------------*/

function ReferateShowHide (obj, link){
	theObject = document.getElementById(obj);
	theLink = document.getElementById(link);
	if (theObject.style.display == "none"){
		theObject.style.display = "block";
		theLink.innerHTML = "Referate verbergen";
	} else if (theObject.style.display == "block"){
		theObject.style.display = "none";
		theLink.innerHTML = "Referate anzeigen";
	} else {
		theObject.style.display = "none";
		theLink.innerHTML = "Referate anzeigen";
	}
} 

function EbeneShowHide (obj, link){
	theObject = document.getElementById(obj);
	theLink = document.getElementById(link);
	if (theObject.style.display == "none"){
		theObject.style.display = "block";
		theLink.innerHTML = "Untergeordnete Ebenen verbergen";
	} else if (theObject.style.display == "block"){
		theObject.style.display = "none";
		theLink.innerHTML = "Untergeordnete Ebenen anzeigen";
	} else {
		theObject.style.display = "none";
		theLink.innerHTML = "Untergeordnete Ebenen anzeigen";
	}
}

function ReferateShowHideAll (bigLink){
	theBigLink = document.getElementById(bigLink);
	var a = 1;
	var m = 1;
	var s = 1;
	var b = 1;
	var z = 1;

	while(document.getElementById("abteilung"+a+"_refs")){ 
		theRefObject = document.getElementById("abteilung"+a+"_refs");
		theRefLink = document.getElementById("sh_abt"+a+"_refs");
		
		if(theBigLink.innerHTML == "Untergeordnete Ebenen verbergen"){
			theRefObject.style.display = "none";
			theRefLink.innerHTML = "Referate anzeigen";
		} else if (theBigLink.innerHTML == "Untergeordnete Ebenen anzeigen"){
			theRefObject.style.display = "block";
			theRefLink.innerHTML = "Referate verbergen";
		} else {
			theRefObject.style.display = "none";
			theRefLink.innerHTML = "Referate anzeigen";
		}
		a++;
	}

	
	while(document.getElementById("stab1"+b+"_refs")){ 
		theStabObject = document.getElementById("stab1"+b+"_refs");
		theStabLink = document.getElementById("sh_stab1"+b+"_refs");
		
		if(theBigLink.innerHTML == "Untergeordnete Ebenen verbergen"){
			theStabObject.style.display = "none";
			theStabLink.innerHTML = "Untergeordnete Ebenen anzeigen";
		} else if (theBigLink.innerHTML == "Untergeordnete Ebenen anzeigen"){
			theStabObject.style.display = "block";
			theStabLink.innerHTML = "Untergeordnete Ebenen verbergen";
		} else {
			theStabObject.style.display = "none";
			theStabLink.innerHTML = "Untergeordnete Ebenen anzeigen";
		}
		b++;
	}
	
	while(document.getElementById("staatssek"+s+"_refs")){ 
		theStaatsekObject = document.getElementById("staatssek"+s+"_refs");
		theStaatsekLink = document.getElementById("sh_staatssek"+s+"_refs");
		
		if(theBigLink.innerHTML == "Untergeordnete Ebenen verbergen"){
			theStaatsekObject.style.display = "none";
			theStaatsekLink.innerHTML = "Untergeordnete Ebenen anzeigen";
		} else if (theBigLink.innerHTML == "Untergeordnete Ebenen anzeigen"){
			theStaatsekObject.style.display = "block";
			theStaatsekLink.innerHTML = "Untergeordnete Ebenen verbergen";
		} else {
			theStaatsekObject.style.display = "none";
			theStaatsekLink.innerHTML = "Untergeordnete Ebenen anzeigen";
		}
		s++;
	}
	
	
	while(document.getElementById("minister"+m+"_refs")){ 
		theMinObject = document.getElementById("minister"+m+"_refs");
		theMinLink = document.getElementById("sh_minister"+m+"_refs");
		
		if(theBigLink.innerHTML == "Untergeordnete Ebenen verbergen"){
			theMinObject.style.display = "none";
			theMinLink.innerHTML = "Untergeordnete Ebenen anzeigen";
		} else if (theBigLink.innerHTML == "Untergeordnete Ebenen anzeigen"){
			theMinObject.style.display = "block";
			theMinLink.innerHTML = "Untergeordnete Ebenen verbergen";
		} else {
			theMinObject.style.display = "none";
			theMinLink.innerHTML = "Untergeordnete Ebenen anzeigen";
		}
		m++;
	}
	
	while(document.getElementById("zusatz"+z+"_refs")){ 
		theZObject = document.getElementById("zusatz"+z+"_refs");
		theZLink = document.getElementById("sh_z"+z+"_refs");
		
		if(theBigLink.innerHTML == "Untergeordnete Ebenen verbergen"){
			theZObject.style.display = "none";
			theZLink.innerHTML = "Referate anzeigen";
		} else if (theBigLink.innerHTML == "Untergeordnete Ebenen anzeigen"){
			theZObject.style.display = "block";
			theZLink.innerHTML = "Referate verbergen";
		} else {
			theZObject.style.display = "none";
			theZLink.innerHTML = "Referate anzeigen";
		}
		z++;
	}

}
