basket_ns4=(document.layers)?true:false;
basket_ie4=(document.all)?true:false;

function centerWindowV (winHeight, menubar, status, directories, toolbar, location) {
	if (basket_ns4 || basket_ie4)	scrHeight = screen.availHeight;
	else			scrHeight = 600;
	titlesize		= 31;
	menubarsize		= 48;
	statussize		= 20;
	directoriessize	= 29;
	toolbarsize		= 29;
	locationsize	= 29;
	winHeight += titlesize;
	if (menubar)		winHeight += menubarsize;
	if (status)			winHeight += statussize;
	if (directories)	winHeight += directoriessize;
	if (toolbar)		winHeight += toolbarsize;
	if (location)		winHeight += locationsize;
	winTop	= ((scrHeight-winHeight)/2);
	return winTop;
}

function centerWindowH (winWidth) {
	if (basket_ns4 || basket_ie4)	scrWidth  = screen.availWidth;
	else			scrWidth  = 800;
	windowBorders	=  12;
	winWidth		+= windowBorders;
	winLeft 		=  ((scrWidth-winWidth)/2);
	return winLeft;
}

function oCenterWin(url,title,winWidth,winHeight,menubar,status,directories,toolbar,location,scrollbars,resizable) {
	winTop	= centerWindowV (winHeight,menubar,status,directories,toolbar,location);
	winLeft = centerWindowH (winWidth);
	winHandle=top.open(url,title,'location='+(location?'yes':'no')+',toolbar='+(toolbar?'yes':'no')+',directories='+(directories?'yes':'no')+',status='+(status?'yes':'no')+',scrollbars='+(scrollbars?'yes':'no')+',menubar='+(menubar?'yes':'no')+',resizable='+(resizable?'yes':'no')+',width='+winWidth+',height='+winHeight+',height='+winHeight+',top='+winTop+',left='+winLeft);
	winHandle.focus();
	//	if(navigator.appVersion.indexOf("MSIE 3",0)==-1) id = setTimeout('winHandle.focus()',1000);
}

function oLeftTopWin(url,title,winWidth,winHeight,menubar,status,directories,toolbar,location,scrollbars,resizable) {
	winTop	= 0;
	winLeft = 0;
	winHandle=top.open(url,title,'location='+(location?'yes':'no')+',toolbar='+(toolbar?'yes':'no')+',directories='+(directories?'yes':'no')+',status='+(status?'yes':'no')+',scrollbars='+(scrollbars?'yes':'no')+',menubar='+(menubar?'yes':'no')+',resizable='+(resizable?'yes':'no')+',width='+winWidth+',height='+winHeight+',height='+winHeight+',top='+winTop+',left='+winLeft);
	winHandle.focus();
	//if(navigator.appVersion.indexOf("MSIE 3",0)==-1) id = setTimeout('winHandle.focus()',1000);
}

function openSavePrintWindow(url) {
	oLeftTopWin(url,'SavePrintBasket',700,570,true,false,false,false,false,true,true);
}

function openSaveWindow(url,zip) {
	if (zip)
		oCenterWin(url+'?mode=zip','ZIPBasket',700,280,true,false,false,false,false,true,true);
	else
		openSavePrintWindow(url+'?mode=html');
}

function openPageBasketURL(url) {
	oCenterWin(url,'PageBasket',640,440,false,false,false,false,false,false,false);
}

function savePageBasket(languageID){ 
	if (basket_ie4) { 
		window.document.execCommand("SaveAs");
	} else { 
		if (languageID==2)
			notsupportedMessage = 'This function is not supported by your browser!\nPlease you use the save as function\nof the file menu of your browser!';
		else
			notsupportedMessage = 'Diese Funktion wird von Ihrem Browser nicht unterstützt!\nBitte benutzen Sie die Speichernfunktion des File- bzw.\nDatei-Menus Ihrers Browsers!';
		alert(notsupportedMessage);
	} 
} 

function setPoint2(Cell, PointCol2){
	Cell.style.backgroundColor = PointCol2;
}
