function ChangeMake()
{
    mmChangeMakeEx(document.getElementById('findacar'), (document.getElementById('findacar').mmType[0].checked ? 'true' : 'false'), 'Model:', true);
    with (document.getElementById('findacar'))
    {
        if (mmMakes.options[mmMakes.selectedIndex].value != 0)
        {
            addElementAtPos(mmModels, 1, '(All Models)', '-1');
            mmModels.options[1].style.fontWeight = 'bold';
        }
    }
}

function ChangeNewUsed(v)
{
    var f = document.getElementById('findacar');
    mmInitializeEx(f, f.mmMakes.options[f.mmMakes.selectedIndex].text, f.mmModels.options[f.mmModels.selectedIndex].text, 'Make:', 'Model:', v, true);
}

function GotoVIP(oForm, sGLinkTemplate, bDebug)
{
    var sMake = oForm.mmMakes.options[oForm.mmMakes.selectedIndex].value;
    var sModel = oForm.mmModels.options[oForm.mmModels.selectedIndex].value;
    var sNew = oForm.mmType[0].checked ? 'true' : 'false';
    var sLink = '';

    if (!CheckNames(oForm, sMake, sModel)) return;

    if (sModel == '-1')
    {
        sLink = 'http://autos.msn.com/browse/' + LNMakeSafeName(sMake) + '.aspx';
    }
    else if (sNew == 'true')
    {
        sLink = 'http://g.msn.com/1CPLIVE/301' + sGLinkTemplate.replace(/\[LNK\]/, '?state=new&make=' + LNMakeSafeName(sMake) + '&model=' + LNMakeSafeName(sModel)).replace('%5bCE%5d', 'New VIP');
    }
    else if (sNew == 'false')
    {
        sLink =  'http://g.msn.com/1CPLIVE/303' + sGLinkTemplate.replace(/\[LNK\]/, '?make=' + LNMakeSafeName(sMake) + '&model=' + LNMakeSafeName(sModel)).replace('%5bCE%5d', 'Used VIP') + '#used';
    }
	
    window.open(sLink, "_top");
	
}

function GotoCategory()
{
    var sPage = 'http://g.msn.com/1CPLIVE/151';
    with (document.getElementById('findacar'))
    {
        var CatDropIndex = FindByCategory.selectedIndex;
        switch(CatDropIndex)
        {
            case 1:
                sPage = 'http://g.msn.com/1CPLIVE/151';
                break;
            case 2:
                sPage = 'http://g.msn.com/1CPLIVE/152';
                break;
            case 3:
                sPage = 'http://g.msn.com/1CPLIVE/153';
                break;
            case 4:
                sPage = 'http://g.msn.com/1CPLIVE/154';
                break;
            case 5:
                sPage = 'http://g.msn.com/1CPLIVE/155';
                break;
            case 6:
                sPage = 'http://g.msn.com/1CPLIVE/156';
                break;
            case 7:
                sPage = 'http://g.msn.com/1CPLIVE/482';
                break;
        }
        var sGLink = sPage;
        if (FindByCategory.selectedIndex != 0)
            window.open(sGLink, '_top');
    }
}

function ncbsGo(par)
{
    if (ncbsValid.validate(ncbsValidItems))
    {
        var strMake = par.mmMakes.options[par.mmMakes.selectedIndex].value;
        var strModel = par.mmModels.options[par.mmModels.selectedIndex].value;
        var strZip = par.QBZip.value;
        var strHREF = "";
        strHREF = "http://autos.msn.com/newcar/default.aspx?src=articles&make=" + escape(strMake) + "&model=" + escape(strModel) + "&zip=" + strZip;
        window.parent.location.href = decodeURI(strHREF);
    }
        return false;
}

function ucmGo(par)
{
    if (ucmValid.validate(ucmValidItems))
    {
        var strMake = par.make.options[par.make.selectedIndex].value;
        var strModel = par.model.options[par.model.selectedIndex].value;
        var strZip = par.QBZip.value;
        var strHREF = "";
        var lnxCode = "MSNATARTICLEWIDGET";
        if (strModel == -1) 
            strModel = 0;
        strHREF = "http://autos.msn.com/classifieds/listings/default.aspx?year=&make=" + escape(strMake) + "&model=&zip=" + strZip + "&type=both&LNX=" + lnxCode;
        window.parent.location.href = strHREF;
    }
    return false;
}