$(document).ready(function () {
	d = {name:"Nome",email:"E-mail",subject:"Assunto",msg:"Mensagem"};
	v = {name:"Informe o seu nome\.",email:"Informe o seu e-mail\.|Informe um e-mail v.lido\.",subject:"Informe o assunto\.",msg:"Voc. deve ter algo a dizer\."};
	for(c in d){
		co = $('#'+c);
		vco = RegExp(v[c]);
		if(vco.test(co.attr('value'))){ co.css('color','red').css('border','solid 1px red'); }
		co.focus(function(){
			vc = RegExp(v[$(this).attr('id')]);
			Id = $(this).attr('id');
			Vl = $(this).attr('value');
			if(Vl==d[Id] || vc.test(Vl)){ $(this).attr('value',""); $(this).css('color','black').css('border','solid 1px #ddd'); }
		});
		co.blur(function(){
			Id = $(this).attr('id');
			Vl = $(this).attr('value');
			if(Vl==""){ $(this).attr('value',d[Id]); }
		});
	}
});