| 13. Warrants (Details Narrative) - USD ($) | 9 Months Ended | 12 Months Ended | 
|---|---|---|
| Sep. 30, 2018 | Dec. 31, 2017 | |
| Private Transaction [Member] | ||
| Gross proceeds from exercise of warrants | $ 3,866,573 | |
| Fair value of warrants issued | $ 1,402,174 | |
| Direct Offering [Member] | ||
| Stock issued new, shares | 1,647,691 | |
| Gross proceeds from sale of equity | $ 6,425,995 | |
| January 2018 Private Placement [Member] | ||
| Warrants issued | 685,000 | |
| Stock issued new, shares | 1,647,691 | |
| Chardan [Member] | Private Transaction [Member] | ||
| Payment of stock issuance costs | $ 363,617 | |
| Warrant [Member] | ||
| Warrants outstanding | 5,899,389 | 3,414,389 | 
| Reload Warrants [Member] | ||
| Warrants issued | 799,991 | |
| Market Price Warrants [Member] | ||
| Warrants issued | 371,699 | |
| New Warrants [Member] | Chardan [Member] | Private Transaction [Member] | ||
| Warrants issued | 115,000 | 
| X | ||||||||||
| 
- Definition Gross proceeds from sale of equity No definition available. 
 | 
| X | ||||||||||
| 
- Definition Proceeds from exercise of warrants, gross No definition available. 
 | 
| X | ||||||||||
| 
- Definition Warrants issued No definition available. 
 | 
| X | ||||||||||
| 
- Definition Number of warrants or rights outstanding. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount of expense (income) related to adjustment to fair value of warrant liability. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition The cash outflow for cost incurred directly with the issuance of an equity security. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Number of new stock issued during the period. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |