/*************************************************************************
Electro Automation Javascript File

Created:	01/09/2006.
Updated:	12/09/2006.

Methods:
********
addLoadEvent	=> Adds as many onload events as needed. 
				[func] argument is a reference to the function to be loaded
showHidePopup	=> Does exactly what it says on the tim. 
				[] no arguments
init			=> Everything here will be initializes onLoad
				[] no arguments
*************************************************************************/

var EA = {
	/* Properties
	*************************/

	popup : '',
	popupLink : '',

	/* Methods
	*************************/

	addLoadEvent : function(func) {
		var oldonload = window.onload;
		if (typeof window.onload != 'function') {
			window.onload = func;
		} else {
			window.onload = function() {
			oldonload();
			func();
			}
		}
	},
	showHidePopup : function() {
		this.popup		= $('popup');
		this.popupLink	= $('showPopup');
		
		// On Click Event
		EA.popupLink.onclick = function() {
			EA.popup.show();
			return false;
		}
		// On Mouse Over Event
		EA.popupLink.onmouseover = function() {
			EA.popup.show();
		}
		// On Mouse Out Event
		EA.popupLink.onmouseout = function() {
			EA.popup.hide();
		}
	},
	init : function() {
		EA.showHidePopup();
	}
}

EA.addLoadEvent(EA.init);// JavaScript Document
