


function ES_Hint(type,obj,text,iTime)
{
	var o = event.srcElement;
	
	o = obj;

	if( o == undefined ) return
	
	var y = o.offsetTop;
	var x = o.offsetLeft;
	var w = o.offsetWidth;
	
	while( o = o.offsetParent ) 
    { 
        x+=o.offsetLeft; 
        y+=o.offsetTop; 
    } 

	

	var offsetX = 10;
	var offsetY = -5;
	
	var cHTML = '';

	var boxID = 'msgHintDiv';          //只有一个DIV
	//var boxID = obj.name+'Div'; //每提示一个DIV
	
	
	
	    
	    
	    
	var oDiv = document.getElementById( boxID )
	
	if( oDiv == null ){
	
		oDiv = document.createElement('div')
		oDiv.id = boxID;
		document.body.appendChild( oDiv );
	}
    

	//验证通过时显是勾，并去掉原来的提示
	if( type == 3 )
	{
	    document.getElementById( boxID ).style.display = "none";
	    boxID = obj.name + 'Div';
	}
	else
	{
	    var tempObj = obj.name+'Div';
	    if(document.getElementById( tempObj ) != null )
	        document.getElementById( tempObj ).style.display = "none";
	}

  
    //验证信息提示
	if( type == 1)
	{

	    obj.className = "inputerror";
	    obj.style.width = w - 6;
	    
		oDiv.className = "";
		oDiv.style.position = "absolute";
		
		cHTML = "<div class=\"l ml10\" >"+
				    "<div class=\"box\" >"+
				        "<div class=\"box-outer\">"+
				            "<div class=\"box-inner\">"+
				                "<p>"+ text +"</p>"+
				            "</div>"+
				        "</div>"+
				    "</div>"+
			    "</div>";

	}


    //边框提示 总的信息提示
	if( type == 2 )
	{
	    offsetX = 20;
	    offsetY = 5;
	    
		oDiv.className = "boxs";
		cHTML = text;
	}
	
   
    //通过检查提示
	if( type == 3 )
	{
		offsetY = 0;
		offsetX = 15;
        
        obj.className = "input";
        obj.style.width = w - 6;
        
		oDiv.className = '';
		oDiv.style.position = "absolute";

		cHTML = " <img src='/images/hint/right.gif' title=''> ";
		
	}
	
	//总提示信息
	if(type == 4 )
	{
	    oDiv.className = '';
		oDiv.style.position = "absolute";
		
		cHTML = "<div class=\"l ml10\" >"+
				    "<div class=\"box\" >"+
				        "<div class=\"box-outer\">"+
				            "<div class=\"box-inner\">"+
				                "<p>"+text+"</p>"+
				            "</div>"+
				        "</div>"+
				    "</div>"+
			    "</div>";
	}
	
	
	
	if( type == "5" )
	{
	    
	    offsetX = 10;
	    offsetY = 0;
	    
	    oDiv.style.position = "absolute";
	
        var cHTML =
             '<table style="FILTER:alpha(opacity=99) shadow(color=#bbbbbb,direction=135);" id=toolTipTalbe border=0><tr><td width="100%"><table class=tableBorder7 cellspacing="1" cellpadding="0" style="width:100%">'+
             '<tr><td "+attr+" class=tablebody7 style="padding-left:14px;padding-right:14px;padding-top: 6px;padding-bottom:6px;line-height:135%">'+text+'</td></tr>'+
             '</table></td></tr></table>';	
	}



	if(cHTML != "")
	{
		oDiv.style.display = '';
		oDiv.innerHTML = cHTML;
	}
	else
	{
		oDiv.style.display = 'none';
	}
    

	//显示控件的位置
	x = w + x + offsetX;
	y = y  + offsetY;
	
	oDiv.style.left	= x + 'px';
	oDiv.style.top 	= y + 'px';

    //自动隐藏
    if( type == "5" && iTime != null)
    {
        setTimeout(function(){oDiv.style.display = 'none'},iTime)
    }
	//ES_Alert(oDiv.innerHTML)

}

function setCookie(sName,sValue,expireHours) {
	var cookieString = sName + "=" + escape(sValue);
	if (expireHours>0) {
		 var date = new Date();
		 date.setTime(date.getTime + expireHours * 3600 * 1000);
		 cookieString = cookieString + "; expire=" + date.toGMTString();
	}
	
	cookieString = cookieString + " ; path=/"

	document.cookie = cookieString;
}
	

function getCookie(sName) {
  var aCookie = document.cookie.split("; ");
  for (var j=0; j < aCookie.length; j++){
	var aCrumb = aCookie[j].split("=");
	if (escape(sName) == aCrumb[0])
	  return unescape(aCrumb[1]);
  }
  return null;
}

function delCookie(sName)
{
	var date=new Date();
	date.setTime(date.getTime()-1000000);
	document.cookie=sName+"=n;expire="+date.toGMTString();

}
function ES_DataListHide()
{
	var boxID = 'msgHintDiv';

	var oDiv = document.getElementById( boxID )
	
	if( oDiv != null ){
	oDiv.style.display = 'none';
	}
	
}
function ES_DataList(type,obj,text)
{
	var o = event.srcElement;
	
	o = obj;

	if( o == undefined ) return
	
	var y = o.offsetTop;
	var x = o.offsetLeft;
	var w = o.offsetWidth;
	
	while( o = o.offsetParent ) 
    { 
        x+=o.offsetLeft; 
        y+=o.offsetTop; 
    } 

	

	var offsetX = 0;
	var offsetY = 0;
	
	var cHTML = '';

	var boxID = 'msgHintDiv';          //只有一个DIV
	
	var oDiv = document.getElementById( boxID )
	
	if( oDiv == null ){
	
		oDiv = document.createElement('div')
		oDiv.id = boxID;
		document.body.appendChild( oDiv );
	}
    


    //边框提示 总的信息提示
	if( type == 2 )
	{
	    offsetX = -135;
	    offsetY = 25;
	    
		oDiv.className = "Fboxs";
		cHTML = text;
	}
	
   

	if(cHTML != "")
	{
		oDiv.style.display = '';
		oDiv.innerHTML = cHTML;
	}
	else
	{
		oDiv.style.display = 'none';
	}
    

	//显示控件的位置
	x = w + x + offsetX;
	y = y  + offsetY;


	oDiv.style.left	= x + 'px';
	oDiv.style.top 	= y + 'px';

    //自动隐藏
    if( type == "5" && iTime != null)
    {
        setTimeout(function(){oDiv.style.display = 'none'},iTime)
    }
	//ES_Alert(oDiv.innerHTML)

}

