//From MooTools, http://www.mootools.net
if (window.ActiveXObject) window.ie = window[window.XMLHttpRequest ? 'ie7' : 'ie6'] = true;

//http://dean.edwards.name/weblog/2006/06/again/?full#comment5338
// Dean Edwards/Matthias Miller/John Resig

function init() {
	// quit if this function has already been called
	if (arguments.callee.done) { return; }
	
	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;
	
	// kill the timer
	if (_timer) { clearInterval(_timer); }
	
	if(!window.ie6 && document.body.className == "startpage") {
		if (!document.getElementById || !document.createElement || !document.appendChild) { return false; }
		var paragraphs = document.getElementById('content-right').getElementsByTagName('p');
		var p;
		// inspired by Roger Johansson, http://www.456bereastreet.com/
		for(var i=0,n=paragraphs.length;i<n-1;i++) {
			p = paragraphs[i];
			p.className = "glowed";
			var span = document.createElement("span");
			span.innerHTML = p.innerHTML;
			p.innerHTML = "";
			
			var bt = document.createElement("span");
			bt.appendChild(document.createElement("span"));
			bt.className = "bt";
			p.appendChild(bt);
			var i1 = document.createElement("span");
			i1.className = "i1";
			var i2 = document.createElement("span");
			i2.className = "i2";
			var i3 = document.createElement("span");
			i3.className = "i3";
			i3.appendChild(span);
			i2.appendChild(i3);
			i1.appendChild(i2);
			p.appendChild(i1);
			var bb = document.createElement("span");
			bb.appendChild(document.createElement("span"));
			bb.className = "bb";
			p.appendChild(bb);
		}
	}
}

/* for Mozilla/Opera9 */
if (document.addEventListener) {
	document.addEventListener("DOMContentLoaded", init, false);
}

/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
	if (this.readyState == "complete") {
		init(); // call the onload handler
	}
};
/*@end @*/

/* for Safari */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			init(); // call the onload handler
		}
	}, 10);
}

/* for other browsers */
window.onload = init;