//<!--
//1@@m21

function EbayHTMLSelect(pParent,pName,pDisabled,pCfg)
{if(!this.objType)
this.objType="EbayHTMLSelect";this.base=EbayHTMLFormElem;this.base(pParent,pName,pDisabled,pCfg);this.iSelIndex=-1;this.createOption=ebHTMLSelectCreateOption;this.clearOptions=ebHTMLSelectClearOptions;this.getValueByIndex=ebHTMLSelectGetValueByIndex;this.getSelectedIndex=ebHTMLSelectGetSelectedIndex;this.getSelectedValue=ebHTMLSelectGetSelectedValue;this.getSelectedText=ebHTMLSelectGetSelectedText;this.getOptionsLength=ebHTMLSelectGetOptionsLength;this.setOption=ebHTMLSelectSetOption;this.insertOption=ebHTMLSelectInsertOption;this.deleteOption=ebHTMLSelectDeleteOption;this.selectByIndex=ebHTMLSelectSelectByIndex;this.selectByValue=ebHTMLSelectSelectByValue;this.selectByText=ebHTMLSelectSelectByText;this.doSelect=ebHTMLSelectDoSelect;this.getIndexByValue=ebHTMLSelectGetIndexByValue;this.getValue=this.getSelectedValue;this.setValue=this.selectByValue;this.subscribeEvents("onchange");}
function ebHTMLSelectClearOptions()
{var e=this.eElem;if(e)
{var opts=e.options;while(opts.length>0)
opts[opts.length-1]=null;}}
function ebHTMLSelectCreateOption(pName,pText)
{if(this.eElem)
{var nOpt=new Option(pText,pName,false,false),opts,lo,oC=ebay.oGlobals.oClient;opts=this.eElem.options;opts[opts.length]=nOpt;idx=opts.length-1;return idx;}}
function ebHTMLSelectGetValueByIndex(pIdx,pTextOnly)
{if(pIdx>-1)
{opt=this.eElem.options[pIdx];if(opt)
return pTextOnly?opt.text:opt.value;}
this.throwError("Invalid index","get");return"";}
function ebHTMLSelectGetSelectedIndex()
{return this.eElem.selectedIndex;}
function ebHTMLSelectGetSelectedValue()
{return this.getValueByIndex(this.eElem.selectedIndex);}
function ebHTMLSelectGetSelectedText()
{return this.getValueByIndex(this.eElem.selectedIndex,true);}
function ebHTMLSelectGetOptionsLength()
{return this.eElem.options.length;}
function ebHTMLSelectSelectByIndex(pIndex)
{this.eElem.selectedIndex=this.iSelIndex=pIndex;}
function ebHTMLSelectDoSelect(pVal,pIsText)
{if(this.eElem)
{var e=this.eElem,o,rv=false,opts=e.options,len=opts.length;for(var i=0;i<len&&!rv;i++)
{o=opts[i];if(((pIsText||(o.value==""))&&(pVal==o.text))||(!pIsText&&(o.value==pVal)))
{e.selectedIndex=this.iSelIndex=i;rv=true;}}}
else
this.throwWarning("HTML element '"+this.name+"' not found","selectByValue");return rv;}
function ebHTMLSelectSelectByValue(pVal)
{return this.doSelect(pVal);}
function ebHTMLSelectSelectByText(pVal)
{return this.doSelect(pVal,true);}
function ebHTMLSelectSetOption(pVal,pText,pInd)
{if(this.eElem)
{if((pInd!=null)&&(pInd>-1))
{var o=this.eElem.options[pInd];o.value=pVal;o.text=pText;}
else
this.createOption(pVal,pText);}
else
this.throwWarning("HTML element '"+this.name+"' not found","selectByValue");}
function ebHTMLSelectInsertOption(pVal,pText,pInd)
{with(this)
{var e=eElem,opts=e.options,len=opts.length;var inOpt=new Array(pText,pVal),tmpOpt=new Array(2);var sel=getSelectedValue();len++;if(pInd>=len)
return;for(i=pInd;i<len;i++)
{if(i<len-1)
tmpOpt=[e.options[i].text,e.options[i].value];opts[i]=new Option(inOpt[0],inOpt[1]);inOpt=tmpOpt;}
selectByValue(sel);}}
function ebHTMLSelectDeleteOption(pInd)
{if(typeof(pInd)!='undefined')
{var opts=this.eElem.options;if(opts[pInd])
opts[pInd]=null;}}
function ebHTMLSelectGetIndexByValue(pVal,pIsText)
{var opts=this.eElem.options,len=opts.length,i=0;for(;i<len;i++)
{o=opts[i];if((o.value==pVal)||(pIsText&&(o.text==pVal)))
return i;}
return-1;}

//2@@m10

function EbayHTMLText(pParent,pName,pDisabled,pCfg,bHidden)
{if(!this.objType)
this.objType="EbayHTMLText";this.base=EbayHTMLFormElem;this.base(pParent,pName,pDisabled,pCfg);this.value=ebHTMLTextValue;this.getValue=ebHTMLTextGetValue;this.setValue=ebHTMLTextSetValue;this.select=ebHTMLTextSelect;if(bHidden!=true)
this.subscribeEvents("onchange","onblur","onfocus","onkeydown","onkeyup");}
function ebHTMLTextValue(pVal)
{var e=this.eElem;if(e)
{if(typeof(pVal)=="undefined")
return e.value;else
e.value=pVal;}}
function ebHTMLTextGetValue()
{return this.value();}
function ebHTMLTextSetValue(pVal)
{return this.value(pVal);}
function ebHTMLTextSelect()
{var e=this.eElem;if(e)
e.select();}

//3@@m1

function EbayUtilsAlphaNumeric(pParent,pName)
{if(!this.objType)
this.objType="EbayUtilsAlphaNumeric";this.base=EbayObject;this.base(pParent,pName);this.sUpperChars='ABCDEFGHIJKLMNOPQRSTUVWXYZ';this.sLowerChars='abcdefghijklmnopqrstuvwxyz';this.sNumbers='0123456789';this.isUpper=function(pStr)
{return this.doCompare(pStr,this.sUpperChars);}
this.isLower=function(pStr)
{return this.doCompare(pStr,this.sLowerChars);}
this.isAlpha=function(pStr)
{with(this)
return doCompare(pStr,sUpperChars+sLowerChars);}
this.isNumeric=function(pStr)
{return this.doCompare(pStr,this.sNumbers);}
this.isAlphaNumeric=function(pStr,pExceptions)
{var ex=pExceptions||"";with(this)
return doCompare(pStr,sUpperChars+sLowerChars+sNumbers+ex);}
this.doCompare=function(pStr,pChars)
{var len=pStr.length,rv=true;for(var i=0;i<len&&rv;i++)
rv=pChars.has(pStr.charAt(i));return rv;}}
ebay.oUtils.oAlphaNumeric=new EbayUtilsAlphaNumeric(ebay.oUtils,"Alpha Numeric Functions");

//4@@m1

ebay.oDocument.oPage.onBeforeLoad=function()
{var oP=this.parent;var oC=oP.getConfig("Motors.ProductSearch");var oTxt=new EbayHTMLText(this,oC.sText);var oTxtTo=new EbayHTMLText(this,oC.sTextTo);var oMake=new EbayHTMLSelect(this,oC.sMake);var oModel=new EbayHTMLSelect(this,oC.sModel);oTxt.onblur=function(){this.parent.onBlur(this);}
oTxtTo.onblur=function(){this.parent.onBlur(this);}
var dt,yr,val;oMake.oChild=oModel;oMake.aChildArray=oC.aArray;oMake.onchange=function()
{with(this)
{oChild.clearOptions();var aChild=aChildArray[getSelectedText()];for(var elem in aChild)
oChild.createOption(aChild[elem],elem);}}
this.onBlur=function(pObj)
{var sTxt=pObj.getValue();var bN=this.oUtils.oAlphaNumeric.isNumeric(sTxt);if(!bN||sTxt.length!=2)
return;dt=new Date();yr=String(dt.getFullYear());yr=yr.substring(2);val=(sTxt>yr)?('19'+sTxt):('20'+sTxt);pObj.setValue(val);}}
// b=8396787 -->