public function getAttributeIdFromCode($attributeCode, $entityTypeId)
{
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($attributeCode)->setEntityTypeFilter($entityTypeId)->getFirstItem();
return $attributeInfo->getId();
}