function resetFields(whichform) {

	var url = window.location.href;

	if(url.indexOf("do=send")<0) {

		for (var i=0; i<whichform.elements.length; i++) {
			var element = whichform.elements[i];

			if(element.type == "submit") continue;
			if(element.type == "radio") continue;
			if(element.type == "checkbox") continue;
			if(!element.defaultValue) continue;

			element.onfocus = function() {
				if(this.value == this.defaultValue) this.value = "";
			}
			element.onblur = function() {
				if(this.value == "") this.value = this.defaultValue;
			}
		}
	}
}

function prepareForms() {
	for(var i=0; i<document.forms.length; i++) {
		resetFields(document.forms[i])
	}
}

function defeatFocusRects() {
	a = document.getElementsByTagName("a");
	al = a.length;
	while(al--) {
		a[al].onfocus = function() {
			this.blur();
		}
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
addLoadEvent(prepareForms);
addLoadEvent(defeatFocusRects);

$(document).ready(function() {
	$('iframe').load(function()
	    {
	        this.style.height =
	        this.contentWindow.document.body.offsetHeight + 'px';
	    }
	);
});

