	
		//取代輸入空白及'字元為空(textbox & textarea)
			function TrimForm(o){			 
				for (var i=0;i < o.elements.length;i++ )
					with ( o.elements[i] ) {
						switch( type ){
							case 'text'		:
								value = value.replace(/(^\s*)|(\s*$)/g,"").replace(/(^[　]*)|([　]*$)/g,"").replace(/('*)/g,"");
								break;
							case 'textarea'	:
								value = value.replace(/(\s*$)/g,"").replace(/(\[　]*$)/g,"").replace(/\s*\n/g,"\n").replace(/[　]+\n/g,"\n").replace(/('*)/g,"");
								break;
						}
					}
			}
	
	
	//取代輸入空白及'字元為空(只限textbox)
			function TrimForm_text(o){			 
				for (var i=0;i < o.elements.length;i++ )
					with ( o.elements[i] ) {
						switch( type ){
							case 'text'		:
								value = value.replace(/(^\s*)|(\s*$)/g,"").replace(/(^[　]*)|([　]*$)/g,"").replace(/('*)/g,"");
								break;							
						}
					}
			}
			
			
	// 輸入值必須為數字 
	function Checknum(){ 
		if ((event.keyCode < 45) || (event.keyCode > 57))
			{event.keyCode = 0;}
	}


    //下載文件(點數不足)
    function no_point()
    {
        alert('您的尚未購買e點或點數不足，請購買後再進行使用!!謝謝!!');
    }
    
    //下載文件
    //function dlfile(filename, seq, type,id,content,dpoint,allpoint)
    //{
    //    if( Number(allpoint) < Number(dpoint))
    //    {
    //        alert('您的點數不足無法下載此文件，請購買後再進行使用!!謝謝!!');
    //    }
    //    else
    //    {
     //       if (confirm('是否要下載此文件?')) {              
     //         //location.href='downfile.ashx?seq='+seq+'&file='+filename+'&type='+type+'&id='+id+'&content='+content+'&dpoint='+dpoint;
     //         location.href='downfile_handle.aspx?seq='+seq+'&file='+filename+'&type='+type+'&id='+id+'&content='+content+'&dpoint='+dpoint;
     //       }
     //   }
   // }
    
    
    //下載文件
    function dlfile(seq, type,id,dpoint,allpoint)
    {
        if( Number(allpoint) < Number(dpoint))
        {
            alert('您的點數不足無法下載此文件，請購買後再進行使用!!謝謝!!');
        }
        else
        {
            if (confirm('是否要下載此文件?')) {              
              //location.href='downfile.ashx?seq='+seq+'&file='+filename+'&type='+type+'&id='+id+'&content='+content+'&dpoint='+dpoint;
              //location.href='downfile_handle.aspx?seq='+seq+'&type='+type+'&id='+id+'&dpoint='+dpoint;
              window.open('downfile_handle.aspx?seq='+seq+'&type='+type+'&id='+id+'&dpoint='+dpoint,'','location=no,resizable=no,status=no,menubar=no');
              //window.open('downfile_handle.aspx?seq='+seq+'&file='+filename+'&type='+type+'&id='+id+'&content='+content+'&dpoint='+dpoint);
            }
        }
    }
    
    

    function choiceDate(fieldClientID)
    {
        window.open('../calendar.aspx?fieldClientID='+fieldClientID.id,'','width=100,height=200','');
    }