/***********************************
 *                                 *
 *  Squares Class                   *
 *  control behavior of squares    *
 *                                 *
 *  © 2007 Timo Besenreuther       *
 *         EZdesign (ezdesign.de)  *
 *                                 *
 *  Developed for DEBEOS GmbH      *
 *                                 *
 ***********************************
 
*/


var Squares = {
	
	/**
	 * called, when mouse enters square
	 */
	
	squareOver: function(square, newColor, text, highlight) {
		if (highlight) {
			this.highlight(square, newColor);
		}
		this.displayText(square, text);
	},
	
	
	/**
	 * called, when mouse leaves square
	 */
	
	squareOut: function(square, dehighlight) {
		if (dehighlight) {
			this.dehighlight(square);
		}
		this.removeText();
	},
	
	
	/**
	 * called, when mosue enters colorful navi link
	 */
	
	naviOver: function(color) {
		this.highlight(document.getElementById('square_'+color), color);
	},
	
	
	/**
	 * called, when mosue leaves colorful navi link
	 */
	
	naviOut: function(color) {
		this.dehighlight(document.getElementById('square_'+color), color);
	},
	
	
	/**
	 * highlight neutral square
	 */
	
	highlight: function(square, color) {
		square.className = 'square_'+color;
	},
	
	
	/**
	 * dehighlight colorful square
	 */
	
	dehighlight: function(square) {
		square.className = 'square_white';
	},
	
	
	/**
	 * displays alt text
	 */
	
	displayText: function(square, text) {
		document.getElementById('squares_text').innerHTML = text;
	},
	
	
	/**
	 * removes alt text
	 */
	
	removeText: function() {
		document.getElementById('squares_text').innerHTML = '';
	}
	
};
