  
  function resetHeight(id,height)
  {

	var height=window.screen.availHeight-window.screenTop-height;
	document.getElementById(id).height=height;
  }
  function textLimiter (textarea,counter,limit)   {   
       if   (textarea.value.length > limit)  
        {   
          textarea.value=textarea.value.substring(0,limit);   
       } else {   
           var currLen=limit-textarea.value.length;   
             document.getElementById(counter).innerHTML = currLen.toString(); 
           
       }   
   }
  function textLimiter2 (objName,counter,limit)   {   
     var obj=document.all[objName];
       if   (obj.value.length > limit)  
        {   
          obj.value=obj.value.substring(0,limit);   
       } else {   
           var currLen=limit-obj.value.length;   
             document.getElementById(counter).innerHTML = currLen.toString(); 
           
       }   
   }
      
   function checkTextLen (name,textarea,limit)   {   
   	var obj=document.all[textarea];
   	var contents=obj.value;

   		  // ignore blank contents
 	 if (contents.toLowerCase() == '<p>&nbsp;</p>') 
 		{
 			obj.value="";
          alert(name+" 必须填写.");  
          return false;			
 		}
       else if (obj.value.length > limit)  
        {   
          alert(name+"长度不能超过"+limit+"字符.");  
          return false;
       } else {   
           return true; 
           
       }      
   }
     
  function showNumber(textarea,counter,limit)
  {   		
      var currLen=limit-textarea.value.length;  
      document.getElementById(counter).innerHTML = currLen.toString();   	
 }  

//make the status of cursor to wait
function setCursorWait(){
	for(var i=0;i<document.all.length;i++){
		document.all[i].org_cursor = document.all[i].style.cursor;
		document.all[i].style.cursor="wait";
	}
}

//resume the status of cursor with the appointed window
function waitEnd(obj){
	for(var i=0;i<obj.document.all.length;i++){
		if(obj.document.all[i].org_cursor!=null){
			obj.document.all[i].style.cursor=obj.document.all[i].org_cursor;
		}
	}
}

//set the wait hint, when loading page
var timeout = 0, waitTime = 0;
var nWinObj, nDocObj;
function setWaitHint(winObj, docObj){
	var stat = docObj.document.readyState;
	nWinObj = winObj;
	nDocObj = docObj;
	if (stat == "complete"){
		clearTimeout(timeout);
		winObj.document.all.waitHint.style.display = "none";
		waitEnd(winObj);
		docObj.style.display = "";
	}
	else{
		//waitTime = waitTime + 0.1;
		//winObj.document.all.waitTimeHint.innerHTML = "" + dataFormat(waitTime, 1) ;
		timeout = setTimeout("setWaitHint(nWinObj, nDocObj)", 100);
	}
}
