/* Thomas Kessler - www.kessler-design.com */
var sEmpty = "";
function checkUrl(url) {
	return (url != sEmpty);
}
function userInput(inp) {
	if (inp.value == this.location.href) {
		inp.value = sEmpty;
		setCaretToEnd(inp);
	}
}
function userLeaves(inp) {
	if (inp.value == sEmpty) {
		inp.value = this.location.href;
	}
}
function setCaretToEnd(el) {
	if (el.createTextRange) {
		var r = el.createTextRange();
		r.moveStart('character', el.value.length);
		r.select();
	} else {
		el.focus();
	}
}

function initForms() {
	if (document.getElementById) {
		var i = document.getElementById("xhtml_url");
		if (i) i.value = this.location.href;
		var i = document.getElementById("css_url");
		if (i) i.value = this.location.href;
	}
}

function isDefined(obj) {
	return (typeof(obj) == 'undefined')? false : true;
}

if (isDefined(window.addEventListener)) {
	window.addEventListener("load", initForms, false);
	window.addEventListener("pageshow", initForms, false);
} else if (isDefined(window.attachEvent)) {
	window.attachEvent("onload", initForms);
}