<!--    
    var hideCol=1;  
    var specValueNumber=0; 
    var autoSpecValueData=new Array(     
        '<input name="specValueName" value="_SpecValueName" onblur="checkIsName(this);" maxlength="30" size="30" /><input type="hidden" value="_SpecValueID" name="specValueId" />',           
        '<img src="_SpecValueImage" id="specValueImg_SpecValueNumber" alt="" width="30px" height="30px" class="spec_pic" />&nbsp;<span style="cursor:pointer;" onclick="BrowseServer(SpecValueNumber);">选择图片</span><input type="hidden" name="specValueImage" value="_SpecValueImage" id="imgUrl_SpecValueNumber" />',
        '排序：<input type="text" size="4" maxlength="4" value="_SpecValueOrder" name="specValueOrder" onblur="checkIsNumber(this);"/>',
        '<span onclick="deleteSpecValue(this,_SpecDeleteable);" style="cursor:pointer;">删除</span>'
    );     
    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 checkIsNameExists(txtName,name)
    {
        var objs=getTagElements('input','name',txtName);
        var rValue=false;
        if(objs!=null)
        {
            for(var i=0;i<objs.length;i++)
            {
                if(objs[i].value==name)
                {
                    rValue=true;
                    break;
                }
            }
        }
        return rValue;
    }
    function checkIsNumber(obj)
    {
        if(obj!=null && obj.type=="text")
        {
            var r=/[^-\d]*([-]?[\d]*)[\D]*/; 
            var value=obj.value;
            var P=value.match(r);
            obj.value=(P[1]==null || P[1]=='-' || P[1]=='')?'0':P[1];
        }
    }
    function checkIsName(obj)
    {
        if(obj!=null && obj.type=="text")
        {
            var value=obj.value;
            obj.value='';
            if(value!=null)
            {                
                //允许数字，26英文字母，下划线，单引号，空格的英文编码字符，和其他所有双字节字符
                value=value.replace(/[\x00-\x1f\x21-\x26\x28-\x2f\x3a-\x40\x5b-\x60\x7b-\xff]{1,30}/g,'');
                value=value.replace(/(^\s*)|(\s*$)/g,'');
                value=value.length>30?value.substr(0,30):value;    
                if(value!='' && (checkIsNameExists('specValueName',value)))
                {
                    value='';
                }          
            }
            obj.value=value;
        }
    }  
    function checkSpecValues()
    {
        var objs=getTagElements('input','name','specValueName');
        var rValue=true;
        if(objs!=null)
        {
            for(var i=0;i<objs.length;i++)
            {
                if(objs[i].value.replace(/(^\s*)|(\s*$)/g,'')=='')
                {
                    rValue=false;
                    alert('规格值名称不能为空值');
                    objs[i].focus();
                    objs[i].select();
                    break;
                }
            }
        }
        return rValue;
    }
    function deleteSpecValue(obj,deleteable)
    {
        if (deleteable==false || deleteable=='false' || deleteable==0){
            alert('该规格已经被货品绑定，不允许删除！');
            return false;
        }
        else{        
            var objTable=document.getElementById("specValueTable");
            var objTR=obj.parentNode.parentNode;
            if(objTable!=null && objTR!=null)
            {
                if(confirm("删除规格值之后将不能恢复，确认要删除吗？"))
                {
                    var rowIndex=objTR.rowIndex;
                    if(rowIndex!=-1)
                    {
                        objTable.deleteRow(rowIndex);   
                    }
                }
            }   
        }     
    }    
    function addSpecValue()
    {
        var objTable=document.getElementById("specValueTable");
       
        if(objTable!=null)
        {
            specValueNumber++;
            var objTR=objTable.insertRow(objTable.rows.length);  
            for(var i=0;i<autoSpecValueData.length;i++){   
                objTD=objTR.insertCell(-1); 
                objTD.align='center';                
                var innerHtml=autoSpecValueData[i].replace(/SpecValueNumber/g,objTR.rowIndex);
                innerHtml=innerHtml.replace(/_SpecValueID/g,0);
                innerHtml=innerHtml.replace(/_SpecValueName/g,'');
                innerHtml=innerHtml.replace(/_SpecValueImage/g,'/CustomAction/Images/specNone.gif');
                innerHtml=innerHtml.replace(/_SpecValueOrder/g,0); 
                innerHtml=innerHtml.replace(/_SpecDeleteable/g,'true');                   
                objTD.innerHTML=innerHtml;
                if(i==hideCol){
                    objTD.style.display='none';  
                }
            }              
        }        
    } 
    function appendSpecValue(id,name,image,order,deleteable)
    {
        var objTable=document.getElementById("specValueTable");
       
        if(objTable!=null)
        {
            specValueNumber++;
            var objTR=objTable.insertRow(objTable.rows.length);  
            for(var i=0;i<autoSpecValueData.length;i++){   
                objTD=objTR.insertCell(-1); 
                objTD.align='center';                 
                var innerHtml=autoSpecValueData[i].replace(/SpecValueNumber/g,specValueNumber);
                innerHtml=innerHtml.replace(/_SpecValueID/g,id);
                innerHtml=innerHtml.replace(/_SpecValueName/g,name);
                innerHtml=innerHtml.replace(/_SpecValueImage/g,image || '/CustomAction/Images/specNone.gif');
                innerHtml=innerHtml.replace(/_SpecValueOrder/g,order); 
                innerHtml=innerHtml.replace(/_SpecDeleteable/g,deleteable);                   
                objTD.innerHTML=innerHtml;                              
                if(i==hideCol){
                    objTD.style.display='none';  
                }
            } 
        }        
    } 
-->
