 //@author xiewei  
  function check(url){
    var Img=new Image();
    var txtfile=document.all("txtfile");
    Img.onload = function(){if(this.width>900 || this.height>500){alert('width>900 or height>600');txtfile.outerHTML=txtfile.outerHTML;}else{document.all('browPic').src=txtfile.value;}}
    Img.onerror = function(){alert('error');txtfile.outerHTML=txtfile.outerHTML;}
    Img.src = url;
}
  function checkbig(url){
    var Img=new Image();
    var txtfile_big=document.all("txtfile_big");
    Img.onload = function(){if(this.width>800 || this.height>600){alert('width>800 or height>600');txtfile_big.outerHTML=txtfile_big.outerHTML;}else{document.all('browPic_big').src=txtfile_big.value;}}
    Img.onerror = function(){alert('error');txtfile_big.outerHTML=txtfile_big.outerHTML;}
    Img.src = url;
}
  function checksmall(url){
    var Img=new Image();
    var txtfile_small=document.all("txtfile_small");
    Img.onload = function(){if(this.width>400 || this.height>300){alert('width>400 or height>300');txtfile_small.outerHTML=txtfile_small.outerHTML;}else{document.all('browPic_small').src=txtfile_small.value;}}
    Img.onerror = function(){alert('error');txtfile_small.outerHTML=txtfile_small.outerHTML;}
    Img.src = url;
}  
  function checkcluga(url){
    var Img=new Image();
    var txtfile_big=document.all("txtfile_picture");
    Img.onload = function(){if(this.width>800 || this.height>600){alert('width>800 or height>600');txtfile_big.outerHTML=txtfile_big.outerHTML;}else{document.all('browPic_big').src=txtfile_big.value;}}
    Img.onerror = function(){alert('error');txtfile_big.outerHTML=txtfile_big.outerHTML;}
    Img.src = url;
}
function newopen(url){   
	 
	 window.showModalDialog(url,window,"top:1;status:1;help:0;resizable:1;dialogheight:20;dialogwidth:30");
 }

function addAccessoryId(filename,id)
{
   document.all("accessorylist").innerHTML+=filename+" <input type='hidden' name='aid' value='"+id+"'>";  
}
function addAccessory()
{
   window.open("accessory_add.jsp", null,"resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no,directories=no,top=100,left=200,width=500,height=250,scrollbars=no"); 
} 
function getVLength(str)
{
   var length=str.length;
   var vlength=0;
   for(var i=0;i<length;i++)
     {
       if(str.charCodeAt(i)>256)
           vlength+=2;
       else 
           vlength+=1;
     }
   return vlength;
} 
function getNVLength(str)
{
  return str.length;
} 
function  trim_space(str)
{
   return trim_R_space(trim_L_space(str));
} 
function trim_L_space(str)
{
    var length=str.length;
    for(var i=0;i<length;i++)
    {
       if(str.charCodeAt(i)!=32)
           break;
    }
    return str.substring(i);
} 
function trim_R_space(str)
{
    var length=str.length;
    for(var i=length-1;i>=0;i++)
    {
       if(str.charCodeAt(i)!=32)
           break;
    }
    return str.substring(0,i+1);
} 
function isNullStringValue(str)
{
    if(str==null)
       return true;
    else if(trim_space(str)=="")
       return true;
    else 
       return false;
}
function setSelected(name,value)
{
   var options=document.all(name).options;
   for(var i=0;i<options.length;i++)
   {
        if(options[i].value==value)
          {
            options[i].selected=true;
            break;
           }
   }
}