/** 
 * class: Hider for Prototype 1.6.0
 **/

var Hider = Class.create();

Hider.prototype = {

	REQUIRED_PROTOTYPE: '1.6.0',
	
	initialize: function(id, period) {

		this.PROTOTYPE_CHECK();
		this.per = period * 1000;
		
		if(!$(id))
			throw("Hider requires an element id to initialize");
		
		setTimeout(function(){$(id).hide()}, this.per);

	},

	convertVersionString: function (versionString){
		var r = versionString.split('.');
		return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
	}, 

	PROTOTYPE_CHECK: function() {
		if((typeof Prototype=='undefined') || (typeof Element == 'undefined') || (typeof Element.Methods=='undefined') || (this.convertVersionString(Prototype.Version) < this.convertVersionString(this.REQUIRED_PROTOTYPE)))
			throw("Hider requires the Prototype JavaScript framework >= " + this.REQUIRED_PROTOTYPE);
	}
	
};