/**
 * basic.js
 * 
 * This file contains the basic Javascript functions for the website.
 *
 * Copyright (c) 2006 WE DO communication GmbH, Germany
 * 
 * @author	Lars Stolze <stolze@wedo-berlin.de>
 */

// Function that does the initialization calls during the loading of the
// website
function init() {
	checkFrameset();
	checkMessages();
}

// Functions that ensures that the website can not be included in an external
// frameset
function checkFrameset() {
	if (self != top) {
		top.location = self.location;
	}
}

// Check if messages exist and display them
function checkMessages() {
	// Possible IDs
    var elements = new Array('errorBox', 'successBox');
    
    // Check for messages
	for (var i=0; i<elements.length; i++) {
        if (document.getElementById(elements[i]) &&
		       document.getElementById(elements[i]).style.display == 'none') {
			new Effect.Appear(document.getElementById(elements[i]),
			                  { duration:0.9 });
		}
    }
}