
//create home link in the sub-sections
function createHomeLink() {
	var theURL=window.location.href;
	var existIndex=theURL.lastIndexOf('index.html');
	var lastCharacter=theURL.substring(theURL.length-1,theURL.length);

	if ((existIndex != -1) || (lastCharacter.equals('/'))) {
		return '';
	} else {
		return 'Home';
	}
}



var objName;

//Functions for layers
function showSection(layName) {
	objName=layName;
	// IE 5.x und NN 6
	if (document.getElementById) {
		document.getElementById(objName).style.visibility="visible";
	}
	// NN 4.x
	if (document.layers) {
		document.layers[objName].visibility="visible";
	}
	// IE 4
	if (document.all && !document.getElementById) {
		document.all[objName].style.visibility="visible";
	}
}

function hideSection(layName) {
	objName=layName;
	if (document.getElementById) {
		document.getElementById(objName).style.visibility="hidden";
	}
	if (document.layers) {
		document.layers[objName].visibility="hidden";
	}
	if (document.all && !document.getElementById) {
		document.all[objName].style.visibility="hidden";
	}
}

function doNothing() {
	//
}
//end layer func

//counter and roll-over functions
function showMeMore() {
	if (counter >= bilderReihe.length-1) {
		counter=0;
	} else {
		counter++;
	}
	showMe(counter);
}
function showMeLess() {
	if (counter == 0) {
		counter=bilderReihe.length-1;
	} else {
		counter--;
	}
	showMe(counter);
}

function showMe(whichOne) {
	document.getElementById('show').src=bilderReihe[whichOne];
}

function initImg() {

	for (i=0; i<bilderReihe.length; i++) {
		tempImg = new Image();
		tempImg.src = bilderReihe[i];
	}
	if (bilderReihe.length>1) {
		showSection('plus');
		showSection('minus');
	}
}
//end counter + roll-over func.


/*
* open a popup-window
* where: url
* winWidth,winHeight: window size 
*/
function showRegister(where,winWidth,winHeight) {

//	winWidth = screen.availWidth - 1;
//	winHeight = screen.availHeight - 18;

	wndProps = "top=200,left=400,width="+winWidth+",height="+winHeight+",dependant=yes,scrollbars=no";
	myWnd = window.open(where,"popupwindow",wndProps);
	myWnd.resizeTo(winWidth,winHeight);
}



/*
* forwards into a new window and checks the existing language
* by examin the URL-String.
* targetURL 	-	the basic url to which it links without 
* 						an ending slash
* targetFile 	-	will assemble to targetURL (should be "main", 
* 						but sometimes can be different like >error.html<)
* anchorName	-	will append to targetFile should include (#)
* 
*/
function forwardTo(targetURL, targetFile, anchorName) {
	var langParam = ",lang=";
	var appendix = ".html" + anchorName;
	var theLang = "en"; 				//default language - will might be overwritten!!
	var rootURL = targetURL;

	var theURL=window.location.href;
	var positionLang=window.location.href.lastIndexOf(langParam);

	if (positionLang != -1) {
		//search for language-string
		theLang=theURL.substring((positionLang+langParam.length),(positionLang+langParam.length+2));
	} 

	m=window.open();
	m.location.href=rootURL + targetFile + langParam + theLang + appendix;
}


