var cPath = (window.getRelativeWebRoot ? window.getRelativeWebRoot() : '') + 'js/';
document.write ('<SCR' + 'IPT LANGUAGE="JavaScript1.2" SRC="'+ cPath +'Lib/BPage.js" TYPE="text/javascript"><\/SCR' + 'IPT>');

var cLastIsland = '';
function moIsland (cIsland, cStatus) {
	if (!cStatus) cStatus = '';
	if (!cIsland) cIsland = '00';
	if (cLastIsland > '' && cLastIsland != cIsland) {
		var oPfeil = getDocumentImage ('pf' + cLastIsland);
		if (oPfeil) oPfeil.src = oPfeil.src.replace ('_1.gif', '.gif');
	}
	var oIsland = getDocumentImage ('IslandMap');
	if (oIsland) {
		var cSrc = oIsland.src;
		var cSrc = cSrc.substr(0, cSrc.length - 6) + cIsland + '.gif';
		oIsland.src = cSrc;

		if (cIsland != '00') {
			var oPfeil = getDocumentImage ('pf' + cIsland);
			if (oPfeil) oPfeil.src = oPfeil.src.replace ('.gif', '_1.gif');
			else alert ('image ' + 'pf' + cIsland  + ' not found!');
			cLastIsland = cIsland;
		}
	}
	window.status = cStatus;
	return (true);
}


var bFileCardVisible = false;
function FileCard (bShow) {
	if (FileCard.arguments.length ==0) bShow = !bFileCardVisible;
	var oL = getLayer ('FileCard');
	if (oL) oL.set ('visibility', bShow);
	bFileCardVisible = bShow;
}

function callAdditor (PageID, LangID) {
	openAdditor (SID, LangID, PageID, null, null);
}

function PageInTour (nPageID) {
	var bInTour = false;
	var cCookies = window.document.cookie;
	var aFound = cCookies.match(/MyTour=([0-9\-]*)/);
	if (aFound) {
		cCookie = '-' + aFound[0].substr(7) + '-'; 
		bInTour = (cCookie.indexOf ('-' + nPageID + '-') >= 0);
	}
	return (bInTour);
}

function openShop() {
	var oWin = window.open ('img/leer.gif', 'Shop', 'resizable=no,scrollbars=yes,width=640,height=480,menubar=no,status=no');
	if (oWin && oWin.focus) oWin.focus();
	return (false);
}

function moAGB (bOver, cStatus) {
	var oL = getLayer ('legende');
	oL.replaceContent(cStatus);
	oL.set ('visibility', bOver);
	
	return mo ('agb', bOver, cStatus);
}

function openPda (SID) {
	if (!SID) SID='';
	cURL = CONFIG['General']['WebRoot'] + 'pda/Page' + PageID + (window.location.pathname.indexOf('.page') ? '.page' : '.html');
	oPdaWin = window.open (cURL, 'PDA', 'resizable=no,scrollbars=no,width=350,height=550,menubar=no,status=no');
	if (oPdaWin && oPdaWin.focus) oPdaWin.focus();
	return (1);
}


