document.oncontextmenu=new Function("event.returnValue=false;");document.onselectstart=new Function("event.returnValue=false;");document.ondragstar=new Function("event.returnValue=false;");String.prototype.trim=function()
{return this.replace(/(^\s*)|(\s*$)/g,"");}
function checksearchform(i)
{if(document.sform.skeys.value.trim()==""||document.sform.skeys.value.trim()=="请输入商品搜索关键词")
{alert("请输入商品搜索关键词！");document.sform.skeys.focus();return false;}}
function AutoResizeImage(maxWidth,maxHeight,objImg){if(typeof(objImg)=='string'){objImg=$(objImg);}
var img=new Image();img.onload=function(){var hRatio;var wRatio;var Ratio=1;var w=img.width;var h=img.height;wRatio=maxWidth/w;hRatio=maxHeight/h;wRatio=wRatio>1?1:wRatio;hRatio=hRatio>1?1:hRatio;if(maxWidth==0&&maxHeight==0){Ratio=1;}else if(maxWidth==0){if(hRatio<1)Ratio=hRatio;}else if(maxHeight==0){if(wRatio<1)Ratio=wRatio;}else{Ratio=(wRatio<=hRatio?wRatio:hRatio);}
if(Ratio<1){w=w*Ratio;h=h*Ratio;}
objImg.height=h;objImg.width=w;this.onload=function(){}}
img.src=objImg.src;}


function getRadioBoxValue(radioName)  
  {  
        var obj=document.getElementsByName(radioName);             //这个是以标签的name来取控件 
            for(i=0;i<obj.length;i++)  
			{  
                  if(obj[i].checked) 
				  {  
                     return  obj[i].value;  
                  }  
              }          
             return "";        
  } 
  function IsURL(str_url){
     var strRegex = "^((https|http|ftp|rtsp|mms)?://)"  
         + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@  
         + "(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184  
         + "|" // 允许IP和DOMAIN（域名） 
         + "([0-9a-z_!~*'()-]+\.)*" // 域名- www.  
         + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." // 二级域名  
         + "[a-z]{2,6})" // first level domain- .com or .museum  
         + "(:[0-9]{1,4})?" // 端口- :80  
         + "((/?)|" // a slash isn't required if there is no file name  
         + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$"; 
	      var re=new RegExp(strRegex); 
     //re.test()
	      if (re.test(str_url)){
               return (true); 
           }else{ 
               return (false); 
           }
       }
