// Utility functions

function framer(pageName) {
        if ( top.location == self.location ) {
                top.location='/?page=' + pageName;
        }
}

function autoframer() {
        if ( top.location == self.location ) {
                top.location='/?page=' + self.location.pathname;
        }
}
var topLocation;
var locationLength = 0;


function isUndefined(el) {
	return typeof(el) == 'undefined';
}

function getDOMId(idname) {
	var el = null;
	if ( document.getElementById ) {
		el = document.getElementById(idname);
		if ( isUndefined(el) ) {
			el = null;
		}
		return el;
	} 
	if ( document.all ) {
		el = document.all[idname];
		if ( isUndefined(el) ) {
			el = null;
		}
		return el;
	}
	if ( document.layers) {
		el = document.layers[name];
		if ( isUndefined(el) ) {
			el = null;
		}
		return el;
	}

	return el;
}
