/****************************************************************************
* scripts.js
* Common JavaScript functions:
* author: oh@design-aspekt.com | date: 2005-06-07
*
* produced by design aspekt
* http://design-aspekt.com
***************************************************************************/

//______________________________________________________________________
// Cross-Browser Basis-Funktionenen für Bild- / Layer-Aktionen
function getLayer(layerID) { return (document.getElementById ? document.getElementById(layerID).style : document.all ? document.all[layerID].style : document.layers[layerID]); }


//______________________________________________________________________
// Layer
function layerOn() {
	for(i=0; i<arguments.length; i++) { getLayer(arguments[i]).visibility = "visible"; }
}
function layerOff() {
	for(i=0; i<arguments.length; i++) { getLayer(arguments[i]).visibility = "hidden"; }
}
function swapLayer(layerID) {
	obj = getLayer(layerID);
	if (obj.display == "block") { obj.display = "none"; }
	else if (obj.display == "none") { obj.display = "block"; }
}

//______________________________________________________________________
// Pop-Up Fenster
function openWin(id,seite) {
	var w = 700;
	var h = 600;
	var xpos = Math.round(screen.width/2) - Math.round(w/2);
	var ypos = Math.round(screen.height/2) - Math.round(h/2);
	url = seite + ".php?id=" + id;
	contentwin = window.open(url,'pubContents','toolbar=1,location=0,status=1,menubar=yes,scrollbars=1,width=' + w +',height=' +h +',resizable=0,left=' + xpos + ',top=' + ypos);
	contentwin.focus();
}

//______________________________________________________________________
// seite drucken
function printWin(url) {
	var w = 700;
	var h = 600;
	l = Math.round(screen.availWidth/2) - Math.round(w/2);
	t = Math.round(screen.availHeight/2) - Math.round(h/2);
	if (screen.availheight<h) { h = (screen.availHeight-80); }
	pwin = open(url+'?view=print','printPopup','toolbar=yes,location=no,menubar=yes,status=no,scrollbars=yes,resizable=no,width='+w+',height='+h+',top='+t+',left='+l);
	pwin.focus();
	pwin.setTimeout('print()', 1000);
}
