	function bmh(id) { return document.getElementById(id);}
	
	function addWatermark(id, txt, color) {
		var dom = bmh(id);
		if(dom.value.length > 0) {
			return;
		}
		dom.value = txt;
		dom.style.color = color;
		dom.onfocus = function() {
			this.style.color= '#000';
			if(this.value == txt) {
				this.value = "";
			}
		}
		dom.onblur = function() {
			if(this.value.length == 0) {
				this.style.color= color;
				this.value = txt;
			}
		}
		
	}

	function hookValidation(name, regs) {
		dom = bmh(name);
		dom.onsubmit = function() {
			for(x in regs) {
				if(!bmh(x).value.match(regs[x][1]) || bmh(x).value == watermarks[x])
				{
					alert(regs[x][0] +" is invalid");
					return false;
				}
			}
			return true;
		}
	}
