function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

function searchkeyword(obj)
{
document.all.Search1_keyword.value='';
}

 function   checkdate(val)   
  {         if (val!='')
            {
                var   bb=val   
                if(bb.length==4&(parseInt(val )%2==0|parseInt(val)%2==1))   
                {   
                return true;   
                }   
                else   
                {   
                  return false; 
                }  }
				else return true;
  }   
    //-->
  String.prototype.trim=function(){
        return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.ltrim=function(){
        return this.replace(/(^\s*)/g,"");
}
String.prototype.rtrim=function(){
        return this.replace(/(\s*$)/g,"");
}  
    
	function SmilpSearchclass(val)
{
	window.location.href='/Power_Main/2CarInfor/2CarInforLst.aspx?keyword='+escape(val);
}


   function selectSupplyType()
{
  var temp=document.getElementsByName("SupplyType"); 
   for (i=0;i<temp.length;i++)
    {   
    if(temp[i].checked)  
	    {
		return (temp[i].value);  
		 } 
	  }
  }
		//改变：Select width			
      function    SelectWidth(obj,width){ 
   
      obj.style.width=width; 
 
      } 
      		


function Search1()
{
if (document.all.SupplyType.options.selectedIndex<=0)
{
	alert('请选择信息类型!')
	document.all.SupplyType.focus();
	return false;
}
if (document.myform.Search11_factoryId.selectedIndex>0)
{
if (document.myform.Search11_ClassId.selectedIndex<=0)
{
 alert('请选择厂商下的品牌!')
 document.myform.Search11_ClassId.focus();
 return false;	
}
}

if (!checkdate(document.all.UploadDate1.value))
{
	alert('年份格式错误!')
	document.all.UploadDate1.focus();
	return false;
	}
if (!checkdate(document.all.UploadDate2.value))
{
	alert('年份格式错误!')
	document.all.UploadDate2.focus();
	return false;
	}
var clss =0;
var url="";

 clss=document.all.SupplyType.options[document.all.SupplyType.options.selectedIndex].value;

 switch(clss)
 {
 case "1":
   url='/Power_Main/2CarInfor/2CarInforLst.aspx';
  break;
 case "2":
  url='/Power_Main/2carBuy/2carBuyLst.aspx';
  break;
 case "3" :
  url='/Power_Main/2CarInfor/2CarInforLst.aspx';
  break; 
 }
 ProductAddress=document.all.Search11_productId.options[document.all.Search11_productId.options.selectedIndex].value
 switch(ProductAddress)
  {
	  case "1":
          ProductAddress='进口'	  
	    break;
	case "0":
	ProductAddress='国产'
	  break;
		default :
		ProductAddress=''
	  }
window.location.href=url+'?id='+document.all.ID.value.trim()+'&Typeid='+document.all.Search11_Typeid.options[document.all.Search11_Typeid.options.selectedIndex].value.trim()+'&ClassId='+document.all.Search11_ClassId.options[document.all.Search11_ClassId.options.selectedIndex].value.trim()+'&dangwei='+escape(document.all.dangwei.options[document.all.dangwei.options.selectedIndex].value.trim())+'&Red='+escape(document.all.Red.options[document.all.Red.options.selectedIndex].value.trim())+'&UploadDate1='+document.all.UploadDate1.value+'&UploadDate2='+document.all.UploadDate2.value+'&SupplyType='+clss+'&BusinessAddress='+escape(document.all.BusinessAddress.value.trim())+'&HopePrice='+document.all.HopePrice.value.trim()+'&ProductAddress='+escape(ProductAddress);

<!--
}
	function Search2()
{
	
	if (document.myform.Search21_factoryId.selectedIndex>0)
{
if (document.myform.Search21_ClassId.selectedIndex<=0)
{
 alert('请选择厂商下的品牌!')
 document.myform.Search21_ClassId.focus();
 return false;	
}
}
if (!checkdate(document.all.UploadDate1.value))
{
	alert('年份格式错误!')
	document.all.UploadDate1.focus();
	return false;
	}
if (!checkdate(document.all.UploadDate2.value))
{
	alert('年份格式错误!')
	document.all.UploadDate2.focus();
	return false;
	}
var clss =0;
var url="";
clss=selectSupplyType();
 switch(clss)
 {
 case "1":
   url='/Power_Main/2CarInfor/2CarInforLst.aspx';
  break;
 case "2":
  url='/Power_Main/2carBuy/2carBuyLst.aspx';
  break;
 case "3" :
  url='/Power_Main/2CarInfor/2CarInforLst.aspx';
  break; 
 }
  ProductAddress=document.all.Search21_productId.options[document.all.Search21_productId.options.selectedIndex].value
 switch(ProductAddress)
  {
	  case "1":
          ProductAddress='进口'	  
	    break;
	case "0":
	ProductAddress='国产'
	  break;
		default :
		ProductAddress=''
	  }
window.location.href=url+'?id='+document.all.ID.value+'&Typeid='+document.all.Search21_Typeid.options[document.all.Search21_Typeid.options.selectedIndex].value+'&ClassId='+document.all.Search21_ClassId.options[document.all.Search21_ClassId.options.selectedIndex].value+'&dangwei='+escape(document.all.dangwei.options[document.all.dangwei.options.selectedIndex].value)+'&Red='+escape(document.all.Red.options[document.all.Red.options.selectedIndex].value)+'&UploadDate1='+document.all.UploadDate1.value+'&UploadDate2='+document.all.UploadDate2.value+'&SupplyType='+clss+'&BusinessAddress='+escape(document.all.BusinessAddress.value)+'&HopePrice='+document.all.HopePrice.value+'&ProductAddress='+escape(ProductAddress);

<!--
}
    
	
	
 function Search3()
{
	
if (document.myform.Search31_factoryId.selectedIndex>0)
{
if (document.myform.Search31_ClassId.selectedIndex<=0)
{
 alert('请选择厂商下的品牌!')
 document.myform.Search31_ClassId.focus();
 return false;	
}
}

if (!checkdate(document.all.UploadDate1.value))
{
	alert('年份格式错误!')
	document.all.UploadDate1.focus();
	return false;
	}
if (!checkdate(document.all.UploadDate2.value))
{
	alert('年份格式错误!')
	document.all.UploadDate2.focus();
	return false;
}
var clss =0;
var url="";
clss=selectSupplyType();
 switch(clss)
 {
 case "1":
   url='/Power_Main/2CarInfor/2CarInforLst.aspx';
  break;
 case "2":
  url='/Power_Main/2carBuy/2carBuyLst.aspx';
  break;
 case "3" :
  url='/Power_Main/2CarInfor/2CarInforLst.aspx';
  break; 
 }
 ProductAddress=document.all.Search31_productId.options[document.all.Search31_productId.options.selectedIndex].value
 switch(ProductAddress)
  {
	  case "1":
          ProductAddress='进口'	  
	    break;
	case "0":
	ProductAddress='国产'
	  break;
		default :
		ProductAddress=''
	  }
 
window.location.href=url+'?id='+document.all.ID.value+'&Typeid='+document.all.Search31_Typeid.options[document.all.Search31_Typeid.options.selectedIndex].value+'&ClassId='+document.all.Search31_ClassId.options[document.all.Search31_ClassId.options.selectedIndex].value+'&dangwei='+escape(document.all.dangwei.options[document.all.dangwei.options.selectedIndex].value)+'&Red='+escape(document.all.Red.options[document.all.Red.options.selectedIndex].value)+'&UploadDate1='+document.all.UploadDate1.value+'&UploadDate2='+document.all.UploadDate2.value+'&SupplyType='+clss+'&BusinessAddress='+escape(document.all.BusinessAddress.value)+'&ProductAddress='+escape(ProductAddress)+'&HopePrice='+document.all.HopePrice.value;

<!--
}
 


function SmilpSearch()
{
	window.location.href='/Power_Main/2CarInfor/2CarInforLst.aspx?keyword='+escape(document.all.Top1_SmilpSearch1_inkeyword.value);
}
  //核对是4位数字
 