Compounds of formula wherein R 1 is alkyl, haloalkyl, substituted cycloalkyl, substituted cycloalkylalkyl, substituted phenyl, substituted phenylalkyl, substituted phenoxyalkyl, substituted phenylalkoxy, substituted phenylcycloalkyl, substituted phenylalkenyl, substituted phenylalkynyl, substituted pyridinyl, substituted pyridinylalkyl, substituted pyridinylalkenyl, substituted pyridinylalkynyl, substituted thiophenyl, substituted thiophenylalkyl, substituted thiophenylalkenyl, substituted thiophenylalkynyl, substituted 2,3-dihydro-1H-isoindol-2-yl, substituted 1H-indol-2-yl or substituted benzofuran-2-yl, wherein substituted cycloalkyl, substituted cycloalkylalkyl, substituted phenyl, substituted phenylalkyl, substituted phenoxyalkyl, substituted phenylalkoxy, substituted phenylcycloalkyl, substituted phenylalkenyl, substituted phenylalkynyl, substituted pyridinyl, substituted pyridinylalkyl, substituted pyridinylalkenyl, substituted pyridinylalkynyl, substituted thiophenyl, substituted thiophenylalkyl, substituted thiophenylalkenyl, substituted thiophenylalkynyl, substituted 2,3-dihydro-1H-isoindol-2-yl, substituted 1H-indol-2-yl and substituted benzofuran-2-yl are substituted with R 3, R 4 and R 5; A 1 is -N- or -CR 7 -; A 2 is -N- or -CR 8 - and at least one of A 1 and A 2 is -N-; R 2 is selected from the ring systems A, B, C, D, E, F, G, H, I, K and L. R 3, R 4 and R 5 are independently selected from H, alkyl, hydroxyalkyl, haloalkyl, hydroxyhaloalkyl, cycloalkyl, cycloalkylalkyl, cycloalkylalkoxy, cycloalkoxy, cycloalkoxyalkyl, cycloalkylalkoxyalkyl, alkoxy, alkoxyalkyl, haloalkoxy, alkoxyhaloalkyl, alkoxyalkoxy, alkoxyalkoxyalkyl, heterocycloalkylalkoxy, phenyl, substituted phenyl, pyridinyl, substituted pyridinyl, halogen, hydroxy, cyano, alkylsulfanyl, haloalkylsulfanyl, cycloalkylsulfanyl, alkylsulfinyl, haloalkylsulfinyl, cycloalkylsulfinyl, alkylsulfonyl, haloalkylsulfonyl, cycloalkylsulfonyl, alkylcarbonylamino, substituted aminosulfonyl, substituted amino and substituted aminoalkyl, wherein substituted aminosulfonyl, substituted amino and substituted aminoalkyl are substituted on the nitrogen atom with one to two substituents independently selected from H, alkyl, cycloalkyl, cycloalkylalkyl, hydroxyalkyl, alkoxyalkyl, alkylcarbonyl and cycloalkylcarbonyl, and wherein substituted phenyl and substituted pyridinyl are optionally substituted with one to three substituents independently selected from alkyl, halogen, haloalkyl, alkoxy and haloalkoxy; R 6 is H, alkyl, haloalkyl or cycloalkyl; R 7 and R 8 are independently selected from H, alkyl, haloalkyl or cycloalkyl; or pharmaceutically acceptable salts. R 1 is alkyl, haloalkyl, substituted cycloalkyl, substituted cycloalkylalkyl, substituted phenyl, substituted phenylalkyl, substituted phenoxyalkyl, substituted phenylalkoxy, substituted phenylcycloalkyl, substituted phenylalkenyl, substituted phenylalkynyl, substituted pyridinyl, substituted pyridinylalkyl, substituted pyridinylalkenyl, substituted pyridinylalkynyl, substituted thiophenyl, substituted thiophenylalkyl, substituted thiophenylalkenyl, substituted thiophenylalkynyl, substituted 2,3-dihydro-1H-isoindol-2-yl, substituted 1H-indol-2-yl or substituted benzofuran-2-yl, wherein substituted cycloalkyl, substituted cycloalkylalkyl, substituted phenyl, substituted phenylalkyl, substituted phenoxyalkyl, substituted phenylalkoxy, substituted phenylcycloalkyl, substituted phenylalkenyl, substituted phenylalkynyl, substituted pyridinyl, substituted pyridinylalkyl, substituted pyridinylalkenyl, substituted pyridinylalkynyl, substituted thiophenyl, substituted thiophenylalkyl, substituted thiophenylalkenyl, substituted thiophenylalkynyl, substituted 2,3-dihydro-1H-isoindol-2-yl, substituted 1H-indol-2-yl and substituted benzofuran-2-yl are substituted with R 3, R 4 and R 5; A 1 is -N- or -CR 7 -; A 2 is -N- or -CR 8 - and at least one of A 1 and A 2 is -N-; R 2 is selected from the ring systems A, B, C, D, E, F, G, H, I, K and L. R 3, R 4 and R 5 are independently selected from H, alkyl, hydroxyalkyl, haloalkyl, hydroxyhaloalkyl, cycloalkyl, cycloalkylalkyl, cycloalkylalkoxy, cycloalkoxy, cycloalkoxyalkyl, cycloalkylalkoxyalkyl, alkoxy, alkoxyalkyl, haloalkoxy, alkoxyhaloalkyl, alkoxyalkoxy, alkoxyalkoxyalkyl, heterocycloalkylalkoxy, phenyl, substituted phenyl, pyridinyl, substituted pyridinyl, halogen, hydroxy, cyano, alkylsulfanyl, haloalkylsulfanyl, cycloalkylsulfanyl, alkylsulfinyl, haloalkylsulfinyl, cycloalkylsulfinyl, alkylsulfonyl, haloalkylsulfonyl, cycloalkylsulfonyl, alkylcarbonylamino, substituted aminosulfonyl, substituted amino and substituted aminoalkyl, wherein substituted aminosulfonyl, substituted amino and substituted aminoalkyl are substituted on the nitrogen atom with one to two substituents independently selected from H, alkyl, cycloalkyl, cycloalkylalkyl, hydroxyalkyl, alkoxyalkyl, alkylcarbonyl and cycloalkylcarbonyl, and wherein substituted phenyl and substituted pyridinyl are optionally substituted with one to three substituents independently selected from alkyl, halogen, haloalkyl, alkoxy and haloalkoxy; R 6 is H, alkyl, haloalkyl or cycloalkyl; R 7 and R 8 are independently selected from H, alkyl, haloalkyl or cycloalkyl;