
function cutFilename(filename) {
	// only the real filename withour path and parameters!
	var test = filename.indexOf('?');
	if (test>0)
		filename=filename.substr(0,test);
	test = filename.lastIndexOf('/');
	if (test>0)
		filename=filename.substr(test+1,filename.length);
	return filename;
} // cutFilename
	
function imgSwap(imgName, imgSrc, docObj) {
	if (document.images && docObj) {
        if (imgName != docObj.setMenuName) {
			if (docObj.document.images[imgName])
				docObj.document.images[imgName].src = imgSrc;
		}
	}
} // imgSwap

function setMenuImg(docObj, menuImgName) {
	if (document.images && docObj && docObj.loaded) {
		// alle Menuepunkte deaktivieren
		for (i=0; i < docObj.menuArray.length; i++) {
			if (docObj.document.images[docObj.menuArray[i]]) {
				docObj.document.images[docObj.menuArray[i]].src = '../docwp/' + docObj.menuArray[i] + '_off.gif';
			}
		}
		docObj.setMenuName = '';
		// auch ein eventuelles flash probieren...:-)
		setFlashMenu(menuImgName);
		// neuen Menuepunkt aktivieren
		if (docObj.document.images[menuImgName]) {
			docObj.document.images[menuImgName].src = '../docwp/' + menuImgName + '_on.gif';
		}
		docObj.setImg = true;
		docObj.setMenuName = menuImgName;
	}
    return true;
} // setMenuImg
	
function preloadImg(imgArray) {
	if (document.images) {
		var imgObj = new Object();
		Arraylen = imgArray.length;
		imgObj.length = Arraylen;
		for (loop=0; loop < Arraylen; loop++) {
			imgObj[loop+1] = new Image();
			imgObj[loop+1].src = '../docwp/' + imgArray[loop];
		}
	}
} // preloadImg
	
function scrollWin(winObj,xPos,yPos,speed) {
	if (winObj) {
		winObj.scrollTo(xPos,yPos);
	}
} // scrollWin

function getWinPos() {
    if (window.screenX) {
        posX = self.screenX;
           posY = self.screenY;
	}
	else {
		posX = 0;
		posY = 0;
	}
} // getWinPos

function openWin(pURL, winName, wX, wY, menubar, toolbar, scrollbar) {
	getWinPos();
	var wPosX = posX + 170;
	var wPosY = posY + 10;
	var wParameters = 'width=' + wX + ',height=' + wY;
	if (menubar) {
		wParameters += ',menubar';
	}
	if (toolbar) {
		wParameters += ',toolbar';
	}
	if (scrollbar) {
		wParameters += ',scrollbars,resizable';
	}
	myWindow = open(pURL, winName, wParameters);
	if (myWindow) {
		//myWindow.moveTo(wPosX,wPosY);
		myWindow.focus();
	}
} // openWin