function make_tip(id, df, coff, con, nofunc) {
	var q = document.getElementById(id);
	if (!q) return;
	
	q.df = df;
	q.coff = coff;
	q.con = con;
	
	if (q.value.length < 1) {
		q.style.color = coff;
		q.value = df;
		q._qd = false;
	}
	else {
		q.style.color = con;
		q._qd = true;
	}
	
	if (!nofunc) {
		q.onfocus = function() { if (!this._qd) { this.style.color = this.con; this.value = ''; this._qd = true; } }
		q.onblur = function() { if (this.value == '') { this.style.color = this.coff; this.value = this.df; this._qd = false; } }
	}
}

function make_tip_submit(f) {
	if (typeof f != 'object' || !f.action) return;
	var form_el = null;
	for (var i = 0; i < f.elements.length; i++) {
		form_el = f.elements[i];
		if (!form_el.name || form_el.name.length < 1) continue;
		if ('_qd' in form_el && !form_el._qd) form_el.value = '';
	}
}