
// IE and Opera getElementById fix
if (/Explorer/.test(navigator.appName) || /Opera/.test(navigator.userAgent)) {
	document._getElementById = document.getElementById;
	document.getElementById = function (id)
	{
		var element = this._getElementById(id);
		if (element != null && element.id != id) {
			for (var i = 0; i < this.all.length; ++i) {
				if (this.all[i].id == id) {
					return this.all[i];
				}
			}
			return null;
		}
		return element;
	}
}

// Safari compatMode fix
if (/Safari/.test(navigator.userAgent) && !document.compatMode) {
	// while body is not loaded, this parameter
	// equivalent to zero in strict mode in this browser
	if (document.documentElement.offsetHeight) {
		document.compatMode = 'BackCompat';
	} else {
		document.compatMode = 'CSS1Compat';
	}
}
