/*******************************************************************************

FILE: mud_Scripts.js
REQUIRES: mud_API.js
AUTHOR: Takashi Okamoto mud(tm) - http://www.mudcorp.com/
VERSION: 1.0 - initial public release
DATE: 09/14/2005

--------------------------------------------------------------------------------

This file is part of MudTextFlow.

	MudTextFlow is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
	
	MudTextFlow is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.
	
	You should have received a copy of the GNU General Public License
	along with Foobar; if not, write to the Free Software
	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*******************************************************************************/

////////////////////////////////////////////////////////////////////////////////
// GLOBAL VARS

var containers = new Array("column-0", "column-1", "column-2", "column-3", "column-4");
var textflow;

////////////////////////////////////////////////////////////////////////////////
// FUNCTIONS

////////////////////////////////////////////////////////////////////////////////
// MOUSE EVENTS

function onWindowResize() {
	textflow.update();
}

////////////////////////////////////////////////////////////////////////////////
// INIT

function mudInit() {
	initDHTMLAPI();
	textflow = new MudTextFlow(getRawObject('content-text').innerHTML, containers);
	textflow.update();
	//window.onresize = onWindowResize;
}

// events
// gecko, safari, konqueror and generic
if (typeof window.addEventListener != 'undefined') {
	window.addEventListener('load', mudInit, false);
}
// opera 7
else if (typeof document.addEventListener != 'undefined') {
	document.addEventListener('load', mudInit, false);
}
// win/ie
else if (typeof window.attachEvent != 'undefined') {
	window.attachEvent("onload", mudInit);
}
// rest
else {
	window.onload = mudInit;
}
