/* for jquery use 
 $(document).ready(function(){
   // Startseite #b20 
	$("#b20 .csc-textpic-text").after('<div class="clearer"></div>');
	$("#b20 .csc-textpic:first").css({"margin":"0", "padding":"0", "border":"none"});
 });
*/

//Dem Fenster einen Namen geben
self.name="bioland";
rootPath = "http://www.bioland.de/";

/* script history fuction */
zurueck = -1;


//Layout vorladen:::
logo = new Image();
logo.src = "bilder/grafiken/bioland.gif";
oben = new Image();
oben.src = "bilder/menue/menue_back.gif";
layout = new Image();
layout.src = rootPath +"bilder/layout/spacer.gif";
layout_ = new Image();
layout_.src = rootPath +"bilder/layout/trans.gif";



//Netscape 4.* reload Bug
function reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.pgW=innerWidth; document.pgH=innerHeight; onresize=reloadPage; }}
  else if (innerWidth!=document.pgW || innerHeight!=document.pgH) location.reload();
}
reloadPage(true);

// Text ein und ausblenden, wenn Javascript eingeschaltet ist **********************************

/*
<script language="JavaScript" type="text/javascript"><!--  
document.write(textLink("neu")); //--> </script>
*/

// 1. Styleangabe zum Ausblenden
if (document.getElementById){
var style = '<style type="text/css">.mehrtext,.hide{display:none;}</style>';
           document.write(style);}
// 2. Link [mehr] - nur wenn Javascript eingeschaltet ist		   
function textLink(id,a_text,css_style){
	if (document.getElementById){
 		var textLink = "<a href=\"javascript:showText(\'"+id+"\')\" class=\""+css_style+"\">["+a_text+"]</a>";
		   return textLink;}
}		    

// 3. Text anzeigen lassen		   
var action,lastClick="";		   
function showText(id){
	action = (id==lastClick) ? "none" : "block";	
	document.getElementById(id).style.display = action;
	lastClick = (action=="none" )? "" :  id;
}	

//Ähnliche Funktion - Link ist nach dem Klicken nicht mehr sichtbar
function hideLink(id,a_text,css_style){
	if (document.getElementById){
 		var textLink = "<a href=\"javascript:showInfo(\'"+id+"\')\" class=\""+css_style+"\" onclick=\"this.style.display='none';\" target=\"_self\">"+a_text+"</a>";
		   return textLink;}  
}
function showId(id){	
	document.getElementById(id).style.display = "block";
}
function hideId(id){
	document.getElementById(id).style.display = "none";
}	
//*******************************************************************************************

//neues_fenster Pop-Up-Fenster
var neues_fenster=null;
var scroll="no";
var hoehe;
var hoeheMax = eval(screen.availHeight-50);
var winPosY = 10;
var zu;

//neues_fenster wird beim Schliessen des Hauptfensters geschlossen
function zu(){
   if (neues_fenster != null){
     if (!neues_fenster.closed)
       neues_fenster.close();
	   }
}

//neues_fenster OEFFNEN
function fenster(URL, x, y) {



// wenn es das Zusatzfenster schon gibt
// weiterverwenden - ggf. die Groesse aendern
	if(neues_fenster!= null && !neues_fenster.closed)
    { 	if(x==breiteX && y==hoeheY){
       	neues_fenster.location.href= URL;
       	window.setTimeout("neues_fenster.focus();",500);
       	return false;
		}
       	else{
		neues_fenster.close();		
       	}
    }

//Aktuelle Fenstergroesse merken
var breiteX=x;
var hoeheY=y;



//Fenstergroesse an Screengroesse anpassen
	if (hoeheMax>y)hoehe=y;
	else {
       hoehe=hoeheMax;
	   if (w < 815)x=parseInt(x*0.85);
	 	 }
//Fenster oeffnen
var parameter="";
/*  Popup-Fenster mit Menü, Toolbar und Adressleiste
   Pressemitteilungen und andere alleinstehende Dateien
   in den Unterverzeichnissen:
   - pm 
   - download 
   - aktuell                                        */
if(URL.search(/\S*\/pm\/\S*/)!= -1 || URL.search(/\S*\/download\/\S*/)!= -1 || URL.search(/\S*\/aktuell\/\S*/)!= -1 || URL.search(/\S*fragen\/\S*/)!= -1 || URL.search(/\S*\/portraits\/\S*/)!= -1){
	parameter ='menubar=yes, toolbar=yes, location=yes, ';
	hoehe=eval(hoehe-130);
	}
	
// Fenster soll Ausdrucken ermöglichen
if(URL.search(/\S*themen\S*/)!= -1 ||URL.search(/\S*bioland_ziele.html/)!= -1 ||URL.search(/\S*geschaeftsbedingungen.html/)!= -1){
	parameter ='menubar=yes, ';
	}	
	
if(URL.search(/\S*biotiere_nav.html/)!= -1 ) winPosY=screen.availWidth - 370;	
	
parameter = parameter + 'scrollbars=yes,resizable=yes,WIDTH='+x+',HEIGHT='+hoehe+',screenX=10,screenY=10';


neues_fenster = window.open("","Information",parameter);
neues_fenster.moveTo(winPosY,10);
neues_fenster.location.href= URL;
neues_fenster.focus();
return true;
}

//Breite des Fensters messen - body.clientWidth steht erst nach dem Laden der Seite fest 
function FensterBreite(){
                    if (w>815){
                    if(window.innerWidth)w=window.innerWidth;
					else if(document.body.clientWidth)w=document.body.clientWidth;
					}
				}
				
				
				
function popup(URL){
if(popup!= null && !popup.closed)
    {  popup.location.href= URL;
       popup.focus();
       return true;
       	}else{
		
var hoehe = eval(screen.availHeight-50);
var parameter = 'scrollbars=yes,resizable=yes,WIDTH=600,HEIGHT='+hoehe+',screenX=10,screenY=10';

var popup= window.open(URL,"Information",parameter);
popup.focus();
return true;
}
}	


function go(myForm,thisSelectBox){
thisIndex= parseInt(myForm[thisSelectBox].selectedIndex);
ziel = myForm[thisSelectBox].options[thisIndex].value;
//alert(ziel);
if (ziel!="")window.location.href = "adressen/"+ziel+".html";
}



// resizes Iframe according to content
function resizeMe(name){ 
 var  height = eval(screen.availHeight-220);
 var x = getObj(name);
 x.height = height + 'px'
 } 
 
function getObj(name)
{
  if (document.getElementById)
  {
    return document.getElementById(name).style;
  }
  else if (document.all)
  {
    return document.all[name].style;
  }
  else if (document.layers)
  {
    return document.layers[name];
  }
  else return false;
} 

