
/**
  * winOpen:			Erstellt ein Popup 'ohne' Scrollbalken
  *
  * @param      url		URL die geöffnet werden soll
  * @param      name	Name des Popups
  * @param      breite	Breite des Popups
  * @param      hoehe	Höhe des Popups
  */
function winOpen(url, name, breite, hoehe) {
	links = (screen.width/2)-(breite/2);
	oben = (screen.height/2)-(hoehe/2);
	window.open(url, name,"height="+hoehe+",width="+breite+",status = no,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars = no,fullscreen = no,top ="+oben+",left ="+links);
}


/**
  * winOpenScroll:		Erstellt ein Popup 'mit' Scrollbalken
  *
  * @param      url		URL die geöffnet werden soll
  * @param      name	Name des Popups
  * @param      breite	Breite des Popups
  * @param      hoehe	Höhe des Popups
  */
function winOpenScroll(url, name, breite, hoehe) {
	links = (screen.width/2)-(breite/2);
	oben = (screen.height/2)-(hoehe/2);
	window.open(url, name,"height="+hoehe+",width="+breite+",status = no,toolbar = no,menubar = no,location = no,resizable = no,titlebar = no,scrollbars = yes,fullscreen = no,top ="+oben+",left ="+links);
}


/**
  * findObj:			Findet ein Objekt mit dem gegebenen Namen
  *
  * @param      theObj	Name des zu suchenden Objekts	
  */
function findObj(theObj, theDoc){
	  var p, i, foundObj;
	
	  if(!theDoc) theDoc = document;
	
	  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
	  {
		theDoc = parent.frames[theObj.substring(p+1)].document;
		theObj = theObj.substring(0,p);
	  }
	
	  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
	
	  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
		foundObj = theDoc.forms[i][theObj];
	
	  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
		foundObj = findObj(theObj,theDoc.layers[i].document);
	
	  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
	
	  return foundObj;
	}


//Show-Hide-Funktion für Solarrechner unter Energiespartechnik
var subs_array = new Array("aachen","berlin","dresden","freiburg","hamburg","kassel","muenchen","stuttgart","wuerzburg");// Put the id's of your hidden divs in this array

function displaySubs(the_sub){
	 if (document.getElementById(the_sub).style.display==""){
	   document.getElementById(the_sub).style.display = "none";return
  }
  for (i=0;i<subs_array.length;i++){
	   var my_sub = document.getElementById(subs_array[i]);
	   my_sub.style.display = "none";
	 }
  document.getElementById(the_sub).style.display = "";
}

