function openwindow(winname,breite,hoehe) {
	var links=screen.width/2-breite/2;
	var oben=screen.height/2-hoehe/2;
	NewWin = window.open(winname, "titel", "width="+breite+",height="+hoehe+",top="+oben+",left="+links+", toolbars=no, scrollbars=yes, resizable=yes");
}

function openPicWindow(picurl, picwidth, picheight)
{
	var picleft=screen.width/2-picwidth/2;
	var pictop=screen.height/2-picheight/2;
	
    var newWindow = window.open("Image", "Image", 
        "toolbars=no, scrollbars=no, location=no, directories=no, fullscreen=no, menubar=no, status=no, width=" + picwidth + ", height=" + picheight + ", top="+pictop+",left="+picleft);
    newWindow.document.writeln("<html>");
    newWindow.document.writeln("<body style='margin: 0 0 0 0;'>");
    newWindow.document.writeln("<a href='javascript:window.close();'>");
    newWindow.document.writeln("<img src='" + picurl + "' alt='Click to close' id='bigImage' style='border:0;'/>");
    newWindow.document.writeln("</a>");
    newWindow.document.writeln("</body></html>");
    newWindow.document.close();
}

function toggle( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // standards
	elem = document.getElementById( whichLayer );
  else if( document.all ) // old MS-IE
	  elem = document.all[whichLayer];
  else if( document.layers ) // nn4
	elem = document.layers[whichLayer];
  vis = elem.style;
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

// Hightlight table rows using mootools
var tableHighlighter = new Class({	
	
	options: {
			rowColourClass: 'highlighted',
			rowHoverColourClass: 'hoverHighlighted',
			highlightRow: 'even',
			everyOther: 0
	},
	
	initialize: function( id, options ) {		
		this.setOptions( options );
		
		if( this.options.highlightRow == 'odd' ){
			this.options.everyOther = 1;
		}	
		this.rows = $(id).getElementsByTagName('tr');
		this.rowsLength = this.rows.length;		
		this.addHighlighting();				
	},
	
	addHighlighting: function(){		
		var hoverClass = this.options.rowHoverColourClass;			
		for( var i = 0; i < this.rowsLength; i++ ){
			$( this.rows[i] ).addEvents({
				'mouseover': function(){ this.addClass( hoverClass ); },
				'focus': function(){ this.addClass( hoverClass ); },
				'mouseout': function(){ this.removeClass( hoverClass ); },
				'blur': function(){ this.removeClass( hoverClass ); }
			});		
			if( this.options.everyOther != 0 ){
				this.rows[i].addClass( this.options.rowColourClass );
				this.options.everyOther = -1;
			}			
			this.options.everyOther++;			
		}		
	}	
});
tableHighlighter.implement(new Options);