var bodyElement;

Event.observe(window, 'load', function (e)
{
	if (document.getElementsByTagName)
	{
		bodyElement = $$('body')[0];
	}
	else
	{
		if (document.getElementsByName)
		{
			bodyElement = $$('body')[0];
		}
	}
	
	if (bodyElement)
	{
		DeterminePrimaryPageFeatures();
	}
});

function AddClassToBody(primaryPageFeature)
{
	if (bodyElement)
	{
		if (bodyElement.addClassName)
		{
			bodyElement.addClassName(primaryPageFeature);
		}
	}
}

function DeterminePrimaryPageFeatures()
{
	var details4 = $('inventoryDetail4');
	if (details4)
	{
		AddClassToBody('InventoryDetail4');
	}

	var details5 = $('inventoryDetail5');
	if (details5)
	{
		AddClassToBody('InventoryDetail5');
	}
	
	var details1 = $('display0022');
	if (details1)
	{
		AddClassToBody('InventoryDetail1');
	}
	
	var newVehicleResearch = $$('.wmxcontrol')[0];
	if (newVehicleResearch)
	{
		AddClassToBody('NVR');
	}
	
	var nvrBrochure = $$('table.Brochure')[0];
	if (nvrBrochure)
	{
		AddClassToBody('NVRBrochure');
	}
	
	var ownerCircle = $$('.ownerCircle')[0];
	if (ownerCircle)
	{
		AddClassToBody('OwnerCircle');
	}
	
	var serviceScheduler = $$('.servicescheduler0001')[0];
	if (serviceScheduler)
	{
		AddClassToBody('ServiceScheduler');
	}
	
	var serviceRepairStatus = $$('.servicerepairstatus0001')[0];
	if (serviceRepairStatus)
	{
		AddClassToBody('ServiceRepairStatus');
	}
		
	var comparePage = $$('div.VehicleDetail')[0];
	if (comparePage)
	{
		AddClassToBody('ComparePage');
	}
	
	var directions = $('directions_container');
	if (directions)
	{
		AddClassToBody('Directions');
	}

	var inventoryList1 = $('inventoryList1');
	if (inventoryList1)
	{
		AddClassToBody('InventoryList1');
	}
	
	var inventoryList3 = $('dataView');
	if (inventoryList3)
	{
		AddClassToBody('InventoryList3');
	}
}
