/* main.js 11/05 Lindsay McLennan
 * changes:
 */
function addLoadEvent(func){
var oldonload = window.onload;
if (typeof window.onload != 'function'){window.onload = func;}
else{window.onload = function(){oldonload();func();};}
}

function deframe(){if (top.location != location) top.location.href = document.location.href;}

function pop(url){
p = window.open(url,'popeye','height=500,width=650,top=40,left=40,resizable=yes,scrollbars=no');
if (window.focus){p.focus()}
}

addLoadEvent(deframe);

if (document.getElementById && document.createTextNode) {
	addLoadEvent(function() {
		var nodes = document.getElementById("content").getElementsByTagName("INPUT");
		for (var i=0; i<nodes.length; i++) {
			if (nodes[i].type == "text") {
				nodes[i].onfocus = function() {
					this.className += " textboxon";
					if (!this.newText) {
						this.value = '';
						this.newText = true;
					}
				}
				nodes[i].onblur = function() {
					this.className = this.className.replace(new RegExp(" textboxon\\b"), "");
				}
			}
		}
	});
}
