// JavaScript Document
// Browser
var N4 = false; 
var IE = false; 
var W3C = false;
var init = false;
// Docname
var cSection = null;
var pn = document.location.pathname.substr(1);
var splittedPath = pn.split("/");
cDoc = splittedPath[splittedPath.length-1];
cName = cDoc.split(".");
cSection = cName[0];
if(cSection=='') cSection='index';

// activ
var oldmenuPt='';

function prep()
	{
	if(document.layers) N4=true;
	if(document.all) IE=true;
	if(document.getElementById("menu")) W3C=true;
	if(IE && W3C && !document.getElementById("menu")) W3C = false;
	else if(IE && W3C && document.getElementById("menu")) IE = false;
	chB(cSection);
	if(cSection=='fotos') 
		{
		preloadImg();
		}
	}

function chB(me)
	{
	if(!me)
		{
		if(oldmenuPt!=cSection) doBorder(oldmenuPt,0)
		}
	else
		{
		doBorder(me,1);
		oldmenuPt=me;
		}
	//alert(oldmenuPt+' _');
	}

function doBorder(box,rand)
	{
	if(document[box])
		{
		document[box].style.borderBottom =rand+"px solid #FFF";
		if(box==cSection) document[box].style.borderTop =rand+"px solid #FFF";
		}
	}
// Seite FOTO
// Pfad
var pfad='i/_content/Fotos_';
var ext='.jpg';
function preloadImg()
	{
	picArr=new Array();
	for(i=posi;i<=menge;i++)
		{
		picArr[i]=newImage(pfad+i+ext)
		}
	}
function newImage(arg) 
	{
	if (document.images) 
		{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
		}
	}
function nextPic(dir)
	{
	posi+=dir;
	if(posi>menge) posi=1;
	if(posi<1) posi=menge;
	document['picture'].src=pfad+posi+ext;
	}
