<!--      
    function $(id)
    {
        return (document.all ? document.all[id] : document.getElementById(id)) || false;
    }     
    var deliveryAreaCount=0;
    function appendAreaListItem(daId,daList,iprice,aprice){
        var obj=$('deliveryAreaList');
        if(obj){           
            var li=document.createElement("li");
            if(li){
                deliveryAreaCount++; 
                li.id='deliveryArea_'+deliveryAreaCount;
                var html = "<div>";
                html += "<input type=\"hidden\" name=\"deliveryAreaId\" value=\""+(daId||0)+"\" />";                
                html += "<input type=\"hidden\" name=\"areaIdList\" id=\"areaIdList_"+deliveryAreaCount+"\" value=\""+(daList!=null&&daList.idList!=null?daList.idList:'')+"\" />";			    
			    html += "<i onclick=\"deleteDeliveryArea('deliveryArea_"+deliveryAreaCount+"');\"><img src=\"/Admin/Images/div_ico2.jpg\" alt=\"删除\" title=\"删除\" width=\"7px\" height=\"7px\" /></i>";
			    html += "<p>配送地区 <input class=\"arealist\" id=\"areaNameList_"+deliveryAreaCount+"\" onclick=\"openAreaListForSelect('areaIdList_"+deliveryAreaCount+"','areaNameList_"+deliveryAreaCount+"');\" value=\""+(daList!=null&&daList.name!=null?daList.name:'')+"\" type=\"text\" readonly=\"true\" />";
                html += "<img alt=\"\" src=\"/Admin/Images/div_ico1.jpg\" onclick=\"openAreaListForSelect('areaIdList_"+deliveryAreaCount+"','areaNameList_"+deliveryAreaCount+"');\" width=\"16px\" height=\"16px\" align=\"absmiddle\" />";
                html += "</p>";
                html += "<p>首重费用 <input name=\"initialPrice\" onfocus=\"this.select();\" onblur=\"checkIsMoney(this,"+(iprice||0)+");\" class=\"price\" type=\"text\" value=\""+(iprice||'')+"\" />";
                html += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                html += "续重费用 <input name=\"additionalPrice\" onfocus=\"this.select();\" onblur=\"checkIsMoney(this,"+(aprice||0)+");\" class=\"price\" type=\"text\" value=\""+(aprice||'')+"\" />";                         
                html += "</p>";
                html += "</div>";                
                li.innerHTML=html;
                obj.appendChild(li);
            }
        }        
	}
	function deleteDeliveryArea(id){
	    var obj=$(id);
	    if(obj && obj.parentNode){
	        if(confirm('删除配送地区将不能被恢复，确定要删除吗？'))
	        obj.parentNode.removeChild(obj);
	    }
	}
	function trimSpace(value){
	     return value.replace(/(^\s*)|(\s*$)/g,'').replace(/,/g,'');
	}
	function setDefaultValueList(name,value){
	    var objs=getTagElements('input','name',name);
	    if(objs!=null && objs.length>0){
	        for(var i=0;i<objs.length;i++){
	            if(trimSpace(objs[i].value)==''){
	                objs[i].value=value;
	            }
	        }
	    }
	}
	function checkDeliveryAreaList(){	  
	    setDefaultValueList('deliveryAreaId','0');
	    setDefaultValueList('areaIdList','|');
	    setDefaultValueList('initialPrice','0.000');
	    setDefaultValueList('additionalPrice','0.000');	
	    return true;    
	}
    function getTagElements(tag, name, value)
    {   
        var arr = new Array(); 
        var elem = document.getElementsByTagName(tag);
        if(elem!=null)
        {   
            if(name!='')
            {
                for(i = 0,iarr = 0; i < elem.length; i++) {
                    var att = elem[i].getAttribute(name);
                    if(att!=null && att == value) {
                         arr[iarr] = elem[i];
                         iarr++;
                    }
                }
            }
            else
            {
                arr=elem;
            }
        }
        return arr;
    }
    function checkIsMoney(obj,defValue)
    {
        if(obj!=null && obj.type=="text")
        {
            var r=/[^\d]*([\d]{1,15})([.][\d]{1,3})?/; 
            var value=obj.value;
            var P=value.match(r);                 
            if(P==null|| ((P[1]==null || P[1]=='') && (P[2]==null || P[2]==''))){  
                value=(defValue!=null&&typeof(defValue)=='number')?defValue:'0.000';
            }else{
                value=((P[1]==null||P[1]=='')?'0':P[1])+((P[2]==null||P[2]=='')?'.000':P[2]);
            }
            try{               
                if(!isNaN(parseFloat(value)) && value>0 && value<=922337203685477.5807){
                    obj.value=value;
                }else{
                    obj.value='0.000';
                }
            }catch(e){
                obj.value='0.000';
            }
        }
    }
-->
