Is Earning from Site Viewing and Referring People to View Same Site Permissible?

Respected scholars, as-salamu `alaykum.Paid-to-click sites can provide me with some extra income, where I am able to join the site for free and get paid for viewing several advertisements provided by the site. Most of the sites may have some advertisements of casinos, alcoholic beverages, or other things prohibited by our religion. My first question is, can I avoid those advertisements and still be able to earn from that site? Or do I have to avoid those sites which allow prohibited advertisements?Those sites give me a commission for referring other people to the site, and the site will give me a commission every time my referral (the person I referred to the site) views advertisements on the site (e.g. 5 percent of his views earnings; note that this percentage is not deducted from the referral's account but is given to me by the site). Of course this means that if my referral stops clicking at that site, I won't earn any more commission (as long as the referral clicks and earns, I can earn the commission.)These sites also offer upgrades where I pay a certain amount of money to increase my commission for a set period of time (e.g. US$20 to raise the 5 percent to 50 percent for a year) so that now the site will automatically award me 50% instead of the 5% for a year. Also note that this upgrade sometimes includes privileges for its buyer. Is this upgrade halal?One last thing is that these sites sometimes offer referrals for sale, where I can buy referrals who will be placed under me as if I had referred them to the site, so I will be taking commission from the newly bought referrals' views' earnings. Is buying the referrals halal?Jazakum Allahu khayran.