var last_kap_nr=new Array(2,0,0,0);
var hauptkap_merk=0;
var xpath;
var nav_merky=0;
var swf_id=Math.floor(Math.random()*100000);

dc=document.cookie;
i=dc.indexOf("last_kap_nr=");
if (i!=-1) {
	x=dc.substring(i+12);
	x=x.split("&")[0];	
	x=x.split(";")[0];	
	last_kap_nr=x.split("_");
    }

i=dc.indexOf("hauptkap_merk=");
if (i!=-1) {
	x=dc.substring(i+14);
	x=x.split("&")[0];	
	x=x.split(";")[0];	
	hauptkap_merk=x-0;
    }

i=dc.indexOf("nav_merky=");
if (i!=-1) {
	x=dc.substring(i+10);
	x=x.split("&")[0];	
	x=x.split(";")[0];	
	nav_merky=x;
    }

if (typeof rpath!="undefined") {
   i=rpath.toLowerCase().lastIndexOf("daten/")+6;
   path=rpath.substring(0,i).toLowerCase();
   relpath=rpath.substring(i)+"/"+datei_name;
   xpath="x-s8:///"+path;   
   if (path.substring(0,2)=="//") path="file://"+path;
   }
else { // für Intranet-Version
   x=document.getElementsByTagName("link")[0].href;
   u=""+document.URL;
   u=u.replace(/\\/g, "/");

   if (x.substring(0,2)=="..") {  // für IE: ../../daten.css
       ebene=1;ep="";
       for(i=0;i<x.length;i++) if (x.charAt(i)=='/' || x.charAt(i)=='//') {ebene++;ep+="../";}
       while (u.indexOf('//')!=-1) u=u.replace('//','/');
       i=u.length;
       for(j=0; j<ebene; j++) i=u.lastIndexOf('/',i-1);
       u=u.replace(':/','://');
       path=ep;
       //alert("IEPath="+path+";x="+x);
       } 
   else {
   	   i=x.lastIndexOf("/"); // für Netscape6: file:///xxx/x/x/daten.css
       path=u.substring(0,i+1);
   	   }   
   relpath=u.substring(i+1);
   relpath=relpath.toLowerCase();
   if (relpath.charAt(0)=='/') relpath=relpath.substring(1);
   xpath=path;
}
relpath1=relpath.substring(0,relpath.lastIndexOf("/"));

pf=new Array(); z=0;
document.write('<script type="text/javascript" src="'+path+'pfade.js"></script>');
document.write('<script type="text/javascript" src="'+path+'buttons_inc.js"></script>');
document.write('<script type="text/javascript" src="'+path+'js/swfobject.js"></script>');
document.write('<script type="text/javascript" src="'+path+'funktionen.js"></script>');

function getClientHeight()
{
   if (top.innerHeight) // all except Explorer
	return top.innerHeight;
   else if (document.documentElement && document.documentElement.clientHeight)	// Explorer 6 Strict Mode
	return document.documentElement.clientHeight;
   else if (document.body) // other Explorers
        return document.body.clientHeight;
   return 0;	
}

function getClientWidth()
{
   if (top.innerWidth) // all except Explorer
	return top.innerWidth;
   else if (document.documentElement && document.documentElement.clientWidth)	// Explorer 6 Strict Mode
	return document.documentElement.clientWidth;
   else if (document.body) // other Explorers
        return document.body.clientWidth;
   return 0;	
}

function set_target(obj)
{
   if (typeof rpath!="undefined") obj.target='_self';
   else  obj.target='_blank';
}

function s_drucken()
{
   if (window.print) window.print();
   else alert("Bitte klicken Sie auf die Druckfunktion Ihres Browsers.");
}

function cb_onload(seite) {

// initialisiert die Checkboxen mit den zugehörigen Werten aus dem Cookie

   dc=document.cookie;
   i=dc.indexOf(seite+"=");
   if (i!=-1) {
	   dcsub=dc.substring(i);
	   if (dcsub.indexOf('&')!=-1) 
	   dcsub=dcsub.split("&")[0];	
	   dcsub=dcsub.split("=")[1];	
	
	   var index=0;
	
	   if (document.form)
	   for(i=0; i<document.form.length; i++) {
	       if (document.form.elements[i].type=="checkbox" && index<dcsub.length) {
	       	   fd_val=dcsub.charAt(index++);
	           document.form.elements[i].checked=(fd_val=="1");
			}
	   }  
   }
}    

function cb_onunload(seite) {
   s1='';
   if (document.form)
   for(i=0; i<document.form.length; i++) {
       if (document.form.elements[i].type=="checkbox") {
        	  val=document.form.elements[i].checked?"1":"0";
        	  s1+=val;
       }
	   document.cookie=""+seite+"="+s1;
   }
}   	 

