/**
* AlertMessage
*
* $Id:: alert_message.js 436 2007-03-05 13:33:21Z sdehaan                  $:  Version Id of this document in the repository
* $Rev:: 436                                                               $:  Revision of last commit
* $Author:: sdehaan                                                        $:  Author of last commit
* $Date:: 2007-03-05 14:33:21 +0100 (ma, 05 mrt 2007)                      $:  Date of last commit
* 
* $HeadURL: svn://svn.eight.nl/reedbusiness/bouw_en_infra/trunk/src/bouwkosten/httpdocs/static/js/alert_message.js $:
* 
* GEBRUIKT VOOR KOSTENTABEL DETAIL SCHERM "Waarom zijn de prijzen vervangen door x-jes?"
**/
AlertMessage = Class.create();
AlertMessage.prototype = {
	initialize: function(el) {
		this.element = el;
		
		this.summary = el.getElementsByClassName('summary')[0];
		this.summary.show();
		// Oud, werkt niet in Firefox:
		//this.summary.getElementsByClassName('display_full').each(function(item) {
		//	Event.observe(item,'click', this.onDisplayFullClick.bindAsEventListener(this));
		//}.bind(this));
		// Nieuw
		alertmessage1 = $$('a.display_full');
		alertmessage1.each(function(item) {
			Event.observe(item,'click', this.onDisplayFullClick.bindAsEventListener(this));
		}.bind(this));
		// Nieuw einde
		
		this.full = el.getElementsByClassName('full')[0];
		this.full.hide();
		// Oud, werkt niet in Firefox:
		//this.full.getElementsByClassName('hide_full').each(function(item) {
		//	Event.observe(item,'click', this.onHideFullClick.bindAsEventListener(this));
		//}.bind(this));
		// Nieuw
		alertmessage2 = $$('a.hide_full');
		alertmessage2.each(function(item) {
			Event.observe(item,'click', this.onHideFullClick.bindAsEventListener(this));
		}.bind(this));
		// Nieuw einde

	},
	
	onDisplayFullClick: function(event) {
		this.full.show();
		this.summary.hide();
		Event.stop(event);
	},
	
	onHideFullClick: function(event) {
		this.full.hide();
		this.summary.show();
		Event.stop(event);
	}
}
