/**
* 此为hoverTip.js效果的模仿，推荐用此来替换hoverTip.js 但是由此产生的问题是表单默认总是有值 因此字段检查时要过滤
* 此JS也是基于JQuery
* 使用方法：给需要此效果的input增加一个hover属性
* 例如：<input type="text" hover="yyyy-mm-dd"/>
*/

//写入必要的样式
document.write("<style type='text/css'>");
document.write(".hover-tip{color:#666666;}");
document.write("</style>");

$(function(){
	hoverClew();
});
		
function hoverClew()
{
	$("input").each(function(i){
				var def=this.getAttribute("hover");
				var hoverMark=this.hoverMark;
				if(def && !hoverMark)
				{
					this.hoverMark=true;
					$(this).focus(function(e){
						$(this).removeClass("hover-tip");
						if(this.value==def || this.value.indexOf('请选择')!=-1 || this.value.indexOf('不能')!=-1)
						{
							$(this).val("");
						}
					}).blur(function(e){
						if(this.value==""||this.value==def)
						{
							$(this).addClass("hover-tip").val(def);
						}
					}).trigger("blur");
				}	
			});
}
