function CrossBrowserSupport() 
{
	var ua = navigator.userAgent.toLowerCase();
	var sf = ua.indexOf("safari") > -1;

	if (sf)
	{
		// find all text-less buttons and add text to them...
			var inputs = document.getElementsByTagName("INPUT");

			for (var i = 0; i < inputs.length; i++)
			{
				if (inputs[i].type == "submit")
				{
					if (inputs[i].value == "" || inputs[i].value == " ")
					{
						inputs[i].value = inputs[i].id;
					}
				}
			}
	}
	
}

function AttachOnload(MyFunction) {
	if (window.attachEvent) { window.attachEvent("onload",MyFunction); }
	else if (window.addEventListener) { window.addEventListener("load",MyFunction,false); }
}

// Attaches a style to the page e.g. AttachStyle("#wrapper", "width:500px");
function AttachStyle(to, what) {

	// IE of course needs its own version
		if (document.createStyleSheet) {
			var obj = document.createStyleSheet();
			return obj.addRule(to, what);
		}

	// for the good browsers
		var head = document.getElementsByTagName("head")[0];
		var obj = document.createElement("STYLE");

		if (obj && head) {
			obj.setAttribute("type", "text/css");

			var entry = document.createTextNode(to + " { " + what + " }");

			if (obj.appendChild && head.appendChild) {
				obj.appendChild(entry);
				head.appendChild(obj);
			}
		}
}

// attaches a stylesheet to the page
function AttachStyleSheet(src) {

	var head = document.getElementsByTagName("head")[0];
	var obj = document.createElement("link");

	if (obj && head) {
		obj.setAttribute("type", "text/css");
		obj.setAttribute("rel", "stylesheet");
		obj.setAttribute("href", src);

		if (head.appendChild) head.appendChild(obj);
	}
}

