g_sDefaultLink = 'default.aspx';
g_sImagePath = "/images/research/compare/";
function Default_onClickRemove(nVehIndex, sURL)
{
	ModifyVehicleQString(nVehIndex, "", "");
	if (g_nCurrentVehicle > 0)
		g_nCurrentVehicle = g_nCurrentVehicle - 1;	
	ModifyProperties('g_nCurrentVehicle', g_nCurrentVehicle);
	SubmitCompare(sURL, '');
}
function Default_onChangeDetail(nDisplayDetail)
{
	ModifyProperties('g_nDisplayDetail', nDisplayDetail);
	SubmitCompare(g_sDefaultLink, '');
}
function Default_onClickTrim(oDropDown)
{
	oDropDown.style.width = 125;
}
function Default_onChangeTrim(nVehIndex, sVehID, sURL)
{
	ModifyVehicleQString(nVehIndex, sVehID, "t");
	SubmitCompare(sURL, '');
}
function Default_onSubmitZipCode()
{
	SubmitCompare(g_sDefaultLink, '&tmv=1');
}
function Default_NextPrev(nDirection, sURL)
{
	if (nDirection == 'next')
	{
		if ((g_nCurrentVehicle + g_nDisplayNumber) >= (g_nVehicleTotalCnt - g_nDisplayNumber))
			g_nCurrentVehicle = g_nVehicleTotalCnt - g_nDisplayNumber;
		else
			g_nCurrentVehicle = g_nCurrentVehicle + g_nDisplayNumber;
	}
	else
	{
		if((g_nCurrentVehicle - g_nDisplayNumber) > (0))
			g_nCurrentVehicle = g_nCurrentVehicle - g_nDisplayNumber;
		else
			g_nCurrentVehicle = 0;
	}

	ModifyProperties('g_nCurrentVehicle', g_nCurrentVehicle);
	SubmitCompare(sURL, '');
}
function Default_PhotoClick(sTrimID, sLink, nNoPopup)
{
	ModifyProperties('g_nPhotoCompareVehicle1', 't' + sTrimID);
	ModifyProperties('g_nPhotoCompareVehicle2', 't0');
	if (nNoPopup == 1)
		SubmitCompare(sLink, '');
	else
		PopUpCompare(sLink);
}
function Default_onChangeButtomImage(oButton, sState, sDirection)
{
	switch(sState)
	{
		case "up":
			oButton.src = g_sImagePath + "Arrow_" + sDirection + "_u.gif";
		break;
		case "down":
			oButton.src = g_sImagePath + "Arrow_" + sDirection + "_d.gif";
		break;
		case "hover":
			oButton.src = g_sImagePath + "Arrow_" + sDirection + "_r.gif"; 
		break;
		default:
			oButton.src = g_sImagePath + "Arrow_" + sDirection + "_u.gif";
		break;
	}
}

