var TimeoutParam = new Array();
Object.extend = function(dest, source, init) {
	var destination = null;
	if (typeof(dest) == "string") destination = document.getElementById(dest);
	else 
	if (typeof(dest) == "object") destination = dest;
	
	if (!destination) throw "Unknown object"
	
	for (var property in source) {
    	destination[property] = source[property];
  	}
	if (init) destination.Init();
	return destination;
}
var Log = new Array();
Log._push = Log.push;
Object.extend(Log, {
	push : function(element)
	{
		this._push(element);
		if (document.getElementById('log'))
		{ 
			document.getElementById('log').innerHTML+= element+"<br />";
			document.getElementById('log').style.display = "block";
		}
	},
	assert : function (question, message)
	{
		if (question) this.push(message);
	}
});
Object.extend(String.prototype, {
	toLog : function() {
		if (document.getElementById('log')) 
		document.getElementById('log').innerHTML+= this+"<br />";
	}
})