stixmaster / Chaturbate Enhanced

// ==UserScript==
// @name        Chaturbate Enhanced
// @locale      en
// @version     5.2.2
// @author      stix
// @description No Ads, Change Colors, Add Fav. Model Tab, Remove Profile Spam & Annoying Chat Tip GIFs, Deletes Exhibitionist Cams & More...
// @icon        http://deplist.weebly.com/uploads/6/1/9/1/61911901/want.png
// @include     https://chaturbate.com/*
// @include     https://*.chaturbate.com/*
// @exclude     https://chaturbate.com/emoticons/*
// @exclude     https://chaturbate.com/accounts/*
// @exclude     https://chaturbate.com/apps/*
// @exclude     https://chaturbate.com/photo_videos/*
// @namespace   https://openuserjs.org/scripts/stixmaster/Chaturbate_Enhanced
// @homepageURL https://openuserjs.org/scripts/stixmaster/Chaturbate_Enhanced
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js
// @require     https://greasyfork.org/scripts/19017-jscolor/code/jscolor.js?version=121257
// @license     GPL-3.0-or-later; http://www.gnu.org/licenses/gpl-3.0.txt
// @grant	    none
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

if (window.location.protocol != 'https:') {
    window.location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
}
//===============================================Inserts holder for color selector and hide for now
var jsColorBox = ('<div id="jsDiv"></div><input class="jscolor {onFineChange:"update(this)", width:101, padding:0, shadow:true,borderWidth:1, backgroundColor:"transparent", insetColor:"#000"}" value="80bfff" style="position:absolute; top:93px; left:555px;  z-index:1002;" >');
$('#nav').append(jsColorBox);
$('.jscolor').hide();
function update(jscolor) {
    // 'jscolor' instance can be used as a string
    var jsClass = $('#lightColor');
    jsClass.text('#' + jscolor);
}
//=============================================== Configure proper UTC values for setting cookies
var later = new Date();
var laterDate = later.setUTCFullYear('2099');
var now = new Date();
var time = now.getTime();
time += 21600000;
now.setTime(time);
//=============================================== Set the cookies to make sure these values are always set
document.cookie = 'noads=1; expires=' + now.toUTCString() + '; path=/';
document.cookie = 'agreeterms=1; expires=' + later.toUTCString() + '; path=/';
document.cookie = 'np3=1; expires=' + later.toUTCString() + '; path=/';
//===============================================
//DELETE EXHIBITIONIST CAMS-THEY ARE SCARY SOMETIMES IF NOT OBSCENE
//OR SOME SCAMMER SPAMMING CHAT OFFERING SKYPE SHOWS FOR MONEY
//===============================================
function myTimer() {
    var basura = $(".thumbnail_label_exhibitionist"); //Delete Exhibitionist Cams, always spam or very disgusting
    if (basura) {
        basura.parent().remove();
    }
    var cams = $(".details"); //Put thin border around cam preview thumbnails
    if (cams) {
        cams.parent().css({'color': "black", "border": "1px ridge black"});
    }
    var DOM = document.getElementsByClassName("list");
    var noSissies = $( "a:contains('sissy')" );
    if (noSissies) {
        noSissies.parentsUntil(DOM, "li").remove();
    myFollowedTab();
    }
}
function myFollowedTab() {
    var followedTab = document.getElementById('followed_tab');
	if (followedTab) { followedTab.style.position=""; }
}
//===============================================
//========= Call removeElementByPath Function====
//===============================================
//removeEBP();
//===============================================
function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') c = c.substring(1);
        if (c.indexOf(name) != -1) {
            return c.substring(name.length, c.length);
        }}
    return "";
}

var color1 = getCookie('cb-color1');
var color2 = getCookie('cb-color2');

if ((color1 === "") || (color2 === "")) {
    var color = ["80bfff", "000000"];
} else {
    var color = [color1, color2];
}
var color3 = getCookie('cb-color3');
var color4 = getCookie('cb-color4');

var chkbx = getCookie('cb-chkbx');
if (chkbx == 'locked') {
    var varCheck = 'true';
    var posi = 'fixed';
}
else {
    var varCheck = 'false';
    var posi = 'absolute';
}

var chkbx2 = getCookie('cb-chkbx-2');
if (chkbx2 == 'locked') {
    var varCheck2 = 'true';
    jQuery('document').ready(function($) {
        var nav = $('.nav-bar');
        $(window).scroll(function() {
            if ($(this).scrollTop() > 85) {
                nav.addClass('fixnav');
            }
            else {
                nav.removeClass('fixnav');
            }
        });
    });
}
else {
    jQuery('document').ready(function($) {
        var nav = $('.nav-bar');
        $(window).scroll(function() {
            if ($(this).scrollTop() < 0) {
                nav.addClass('fixnav');
            }
            else {
                nav.removeClass('fixnav');
            }
        });
    });
}
//===================================================== Creates the SETTINGS Link On Top of Page
function quickCheck() {
    $(document).ready(function(){
        var vnumber = '5.2.2';
        var version = 'Chaturbate Enhanced - Version ' + vnumber;
        var vernum = document.createElement('INS');
        var txt = document.createTextNode(version);
        vernum.setAttribute('id', 'verText');
        vernum.setAttribute('style', 'position:absolute; top:36px; left:300px; color:#181818; font-family:arial; font-size:0.875em; font-weight:normal; text-decoration:none; z-index:1000;');
        vernum.appendChild(txt);
        document.body.appendChild(vernum);
        var verCheck = document.createElement('INS');
        var verTxt = document.createTextNode('');
        verCheck.setAttribute('id', 'verText');
        verCheck.setAttribute('style', 'display:none;');
        verCheck.appendChild(verTxt);
        document.body.appendChild(verCheck);
        var edit = document.createElement('A');
        var editTxt = document.createTextNode('Settings');
        edit.setAttribute('id', 'editBut');
        edit.setAttribute('style', 'position:absolute; top:18px; left:298px; font-family:arial; font-size:1.125em; font-weight:bold; text-decoration:none; z-index:1000;');
        edit.setAttribute('href', '#');
        edit.onclick = function() {
            $('.jscolor').show();
            var makeForm = document.createElement('FORM');
            makeForm.setAttribute('id', 'colorForm');
            makeForm.setAttribute('style', 'position:absolute; top:0; left:150px; width:278px; height:340px; background-color:#ffffff; border:1px solid #cbcbcb; border-radius:0px 1px 4px 0; z-index:1001;');
            document.body.appendChild(makeForm);
            //===================================================== Choose a light hexadecimal color label
            var pick1 = document.createElement('INS');
            var pickLight = document.createTextNode('Choose a light hexadecimal color');
            pick1.setAttribute('style', 'position:absolute; top:10px; left:170px; text-decoration:none; z-index:1002;');
            pick1.setAttribute('id', 'pick1Label');
            pick1.appendChild(pickLight);
            document.body.appendChild(pick1);
            //===================================================== Choose a light hexadecimal color input box
            var light = document.createElement('INPUT');
            light.setAttribute('id', 'lightColor');
            light.setAttribute('type', 'text');
            light.setAttribute('value', color[0]);
            light.setAttribute('style', 'position:absolute; top:20px; left:20px; text-decoration:none; z-index:1002;');
            document.getElementById('colorForm').appendChild(light);
            //===================================================== Choose a dark hexadecimal color
            var pick2 = document.createElement('INS');
            var pickDark = document.createTextNode('Choose a dark hexadecimal color');
            pick2.setAttribute('style', 'position:absolute; top:60px; left:170px; text-decoration:none; z-index:1002;');
            pick2.appendChild(pickDark);
            document.body.appendChild(pick2);
            //===================================================== Choose a dark hexadecimal input box
            var dark = document.createElement('INPUT');
            dark.setAttribute('id', 'darkColor');
            dark.setAttribute('type', 'text');
            dark.setAttribute('value', color[1]);
            dark.setAttribute('style', 'position:absolute; top:70px; left:20px; text-decoration:none; z-index:1002;');
            document.getElementById('colorForm').appendChild(dark);
            //===================================================== Favorite Model Label for Input Box
            var pick3 = document.createElement('INS');
            var pickName = document.createTextNode('Choose a favorite model.');
            pick3.setAttribute('style', 'position:absolute; top:110px; left:170px; text-decoration:none; z-index:1002;');
            pick3.appendChild(pickName);
            document.body.appendChild(pick3);
            //===================================================== Favorite Model Input Box
            var modelName = document.createElement('INPUT');
            modelName.setAttribute('id', 'modelNameBox');
            modelName.setAttribute('type', 'text');
            modelName.setAttribute('value', color3);
            modelName.setAttribute('style', 'position:absolute; top:120px; left:20px; text-decoration:none; z-index:1002;');
            document.getElementById('colorForm').appendChild(modelName);
            //===================================================== Font Name Label for Input Box
            var pick4 = document.createElement('INS');
            var pickFontName = document.createTextNode('Change Font Type');
            pick4.setAttribute('style', 'position:absolute; top:155px; left:170px; text-decoration:none; z-index:1002;');
            pick4.appendChild(pickFontName);
            document.body.appendChild(pick4);
            //===================================================== Font Name Combo Box
            var pickFont = document.createElement('SELECT');
            pickFont.setAttribute('style', 'position:absolute;top: 170px;left:20px;text-decoration:none;z-index:1002;');
            pickFont.setAttribute('id', 'fontNameBox');
            pickFont.setAttribute('type', 'option');
            pickFont.setAttribute('elementtype', 'combobox');
            pickFont.setAttribute('size', '1');
            var pickOption = document.createElement('OPTION');
            var pickOpt1 = document.createTextNode('Rockwell');//=====FIRST OPTION
            pickOption.setAttribute('value', '1');
            pickOption.appendChild(pickOpt1);
            pickFont.appendChild(pickOption);

            var pickOption2 = document.createElement('OPTION');
            var pickOpt2 = document.createTextNode('Tw Cen MT');//=====SECOND OPTION
            pickOption2.setAttribute('value', '2');
            pickOption2.appendChild(pickOpt2);
            pickFont.appendChild(pickOption2);

            var pickOption3 = document.createElement('OPTION');
            var pickOpt3 = document.createTextNode('Verdana');//=====THIRD OPTION
            pickOption3.setAttribute('value', '3');
            pickOption3.appendChild(pickOpt3);
            pickFont.appendChild(pickOption3);

            document.getElementById('colorForm').appendChild(pickFont);
            //===================================================== First checkbox label
            var scroll = document.createElement('INS');
            var scrollCheck = document.createTextNode('Lock room image in place.');
            scroll.setAttribute('style', 'position:absolute; top:205px; left:170px; text-decoration:none; z-index:1002;');
            scroll.appendChild(scrollCheck);
            document.body.appendChild(scroll);
            //===================================================== Checkbox
            var chbox = document.createElement('INPUT');
            if (varCheck == 'true') {
                chbox.setAttribute('id', 'checkBox');
                chbox.setAttribute('type', 'checkbox');
                chbox.setAttribute('checked', 'true');
                chbox.setAttribute('style', 'position:absolute; top:220px; left:20px; text-decoration:none; z-index:1002;');
            }
            else {
                chbox.setAttribute('id', 'checkBox');
                chbox.setAttribute('type', 'checkbox');
                chbox.setAttribute('style', 'position:absolute; top:220px; left:20px; text-decoration:none; z-index:1002;');
            }
            document.getElementById('colorForm').appendChild(chbox);
            //===================================================== Second checkbox label & Checkbox
            var scroll2 = document.createElement('INS');
            var scrollCheck2 = document.createTextNode('Lock navigation bar in place.');
            scroll2.setAttribute('style', 'position:absolute; top:245px; left:170px; text-decoration:none; z-index:1002;');
            scroll2.appendChild(scrollCheck2);
            document.body.appendChild(scroll2);
            var chbox2 = document.createElement('INPUT');
            if (varCheck2 == 'true') {
                chbox2.setAttribute('id', 'checkBox2');
                chbox2.setAttribute('type', 'checkbox');
                chbox2.setAttribute('checked', 'true');
                chbox2.setAttribute('style', 'position:absolute; top:260px; left:20px; text-decoration:none; z-index:1002;');
            }
            else {
                chbox2.setAttribute('id', 'checkBox2');
                chbox2.setAttribute('type', 'checkbox');
                chbox2.setAttribute('style', 'position:absolute; top:260px; left:20px; text-decoration:none; z-index:1002;');
            }
            document.getElementById('colorForm').appendChild(chbox2);
            //===================================================== Insert Close and Save buttons on bottom
            var save = document.createElement('A');
            var close = document.createElement('A');
            var saveTxt = document.createTextNode('Save');
            var closeTxt = document.createTextNode('Close');
            save.setAttribute('id', 'saveBut');
            close.setAttribute('id', 'closeBut');
            save.setAttribute('style', 'position:absolute; top:290px; left:364px; background-color:#ffffff; border:1px solid #181818; border-radius:4px; padding:2px 6px; z-index:1002;');
            close.setAttribute('style', 'position:absolute; top:290px; left:314px; background-color:#ffffff; border:1px solid #181818; border-radius:4px; padding:2px 6px; z-index:1002;');
            save.setAttribute('href', '#');
            close.setAttribute('href', '#');
            close.onclick = function() {
                $('.jscolor').hide();
                location.reload();
            };
            save.onclick = function() {
                $('.jscolor').hide();
                var color1 = document.getElementById('lightColor').value;
                var color2 = document.getElementById('darkColor').value;
                var color3 = document.getElementById('modelNameBox').value;
                var color4 = document.getElementById('fontNameBox').value;
                //===================================================== Check first checkbox from cookie
                var varCheck = document.getElementById('checkBox').checked;
                if (varCheck === true) {
                    document.cookie = 'cb-chkbx=locked; expires=' + later.toUTCString() + '; path=/';
                }
                else {
                    document.cookie = 'cb-chkbx=unlocked; expires=' + later.toUTCString() + '; path=/';
                }
                //===================================================== Check second checkbox from cookie
                var varCheck2 = document.getElementById('checkBox2').checked;
                if (varCheck2 === true) {
                    document.cookie = 'cb-chkbx-2=locked; expires=' + later.toUTCString() + '; path=/';
                }
                else {
                    document.cookie = 'cb-chkbx-2=unlocked; expires=' + later.toUTCString() + '; path=/';
                }
                //===================================================== Set color hex values in cookies
                document.cookie = 'cb-color1=' + color1 + '; expires=' + later.toUTCString() + '; path=/';
                document.cookie = 'cb-color2=' + color2 + '; expires=' + later.toUTCString() + '; path=/';
                document.cookie = 'cb-color3=' + color3 + '; expires=' + later.toUTCString() + '; path=/';
                if (color4 == 1) {
                    document.cookie = 'cb-color4=' + "Rockwell" + '; expires=' + later.toUTCString() + '; path=/';
                } else if (color4 == 2) {
                    document.cookie = 'cb-color4=' + "Tw Cen MT" + '; expires=' + later.toUTCString() + '; path=/';
                } else if (color4 == 3){
                    document.cookie = 'cb-color4=' + "Verdana" + '; expires=' + later.toUTCString() + '; path=/';
                }

                location.reload();
            };
            close.appendChild(closeTxt);
            save.appendChild(saveTxt);
            document.body.appendChild(close);
            document.body.appendChild(save);
        };
        edit.appendChild(editTxt);
        document.body.appendChild(edit);
    });
}
//===================================================== Creates the SETTINGS Link only on these pages
var versionTxt = document.URL;
var locPathName = location.pathname;
var chtBox = $('.chat-box');
if ((locPathName === '/trans-cams/') || (locPathName === '/') || (versionTxt === 'https://chaturbate.com/')) {
    var myGarbageCollector = setInterval(myTimer, 1000);
    quickCheck();
} else if (chtBox) {
    var myGarbageCollector2 = setInterval(chatGraphics, 50000);//Chatbox exists, add timer to clean chat spam
    var tTip = $('#tooltip-subject');
    if (tTip) { tTip.remove(); }  //Remove the Room Subject Tooltip that sometimes gets stuck open
    var nextcam = $( ".nextcam" );
    if (nextcam) { nextcam.remove(); } //Remove SCAN cams and NEXT CAM tabs
	myFollowedTab(); //corrects the Followed tab's alignment in nav bar
	setHighestQualityVideo(); //check video qualities available and swith from Auto to highest quality found

}
//===================================================== Function to scan available video qualities and select the highest quality
function setHighestQualityVideo() {
$(document).ready(function(){
    var className = "vjs-menu-item"
    var matchingItems = [];
    var allElements = document.getElementsByTagName("*");

    for(var i=0; i < allElements.length; i++)
    {
        if(allElements [i].className == className)
        {
            matchingItems.push(allElements[i].innerText);
        }
    }
    var highestVideoQuality = matchingItems[0];
    var AutoSelectClass = $( "li:contains('auto')" );
    var hvqcElement = $( "li:contains('" + highestVideoQuality + "')" );
        hvqcElement.addClass('vjs-selected');
        AutoSelectClass.removeClass('vjs-selected');
        hvqcElement.attr( "aria-checked", "true");
        AutoSelectClass.attr( "aria-checked", "false");
}
)}
//===================================================== Function to find annoying chat graphics
//===================================================== and remove them so you dont have to look at them in chat
function chatGraphics () {
var strTitle = [":notips", ":comeontipguys", ":tip", ":tokens", ":tipifyoulike", ":tipguyz", ":motivation" +
				":moretipsgreatshow", ":moreme", ":mmmh", ":tipguys", ":notipnoshow", ":plssendtip01" +
				":moretipmoreshow2", ":tipsshow", ":plsfollow01", ":transfrot", ":moretips1", ":150" +
				":tipsee", ":tokensforreqests", ":showtip", ":suckingdeep", ":xcwblowjob", ":bjzs02" +
				":ilovedeepthroat2", ":fucklatina01", ":xcwsex2", ":fuckhard1", ":TipsGuys", ":100"];
    for (var j=0;j<strTitle.length;j++){
        var imageString = $('img[title="' + strTitle[j] + '"]');
        if (imageString) {
            imageString.remove();
        }
    }
}

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('#header .ad {display:none!important;}' +
    '.logo {background:url(\'https://greasyfork.org/system/screenshots/screenshots/000/003/216/thumb/logo-standard.png\') no-repeat!important;}' +
    '#main .ad {display:none!important;}' +
    '#botright {display:none!important;}' +
    '#main .banner {display:none!important;}' +
    '#close_entrance_terms {background-color:#' + color[0] + '!important;}' +
    '#close_broadcast_terms {background-color:#' + color[0] + '!important;}' +
    'a {color:#' + color[1] + '!important; outline-style:none!important; text-decoration:none!important;}' +
    'a:hover {color:#777777!important;cursor:pointer;}' +
    'body {background-color:#000000!important;}' +
    '#header {background-image:http://deplist.weebly.com/uploads/6/1/9/1/61911901/7467455_orig.png!important; background-color:#' + color[0] + '!important;}' +
    '#header .section {background-color:#' + color[0] + '!important;}' +
    '#main .top-section p{margin:0 0 1px!important;}' +
    '#main .top-section {border-bottom:1px solid #000000!important; border-bottom-width: thin!important; border-bottom-style: double!important; box-shadow: 0 5px 1px 6px #000000!important; padding:0px 19px 0 19px!important;}' +
    '.sub-nav {display:inline-block;top:0.5px;left:38%!important;min-width:275px;list-style:none;margin:0;padding:0;height:1%;overflow:hidden;font-family:\'Nyala\'!important;cursor:pointer;}' +
    '#main .top-section .sub-nav {background-image:none!important;}' +
    '#main .content {background-color:#' + color[0] + '!important; padding:5px 0px 14px 0!important;}' +
    '#header .nav-bar {background-color:#' + color[1] + '!important; border-color:#cbcbcb!important;}' +
    '#nav {font-family:Tw Cen MT!important; padding-bottom:5px!important;}' +
    '#nav li a {color:#eeeeee!important;}' +
    '#nav li a:hover {color:#' + color[0] + '!important;}' +
    '#header .creat {font-family:\'Nyala\'!important; color:#cbcbcb!important; background-color:#FFFFFF!important; background-image:none!important; padding-left:2px!important; padding-bottom:5px!important; border-radius:0!important;}' +
    '#main .top-section .sub-nav a {font-family:' + color4 + '!important; top:0px!important; left:38%!important; color:#003366!important; border-color:#000000!important; background-color:#ffffff!important; border-style: groove!important; border-width: 2px!important; text-shadow: .6px .3px 1px #000000!important; padding:2px 15px 1px!important;}' +
    '#main .top-section .sub-nav a:hover {color:#e60000!important; top:0px!important; left:38%!important; background-color:#ffffff!important;cursor: pointer; }' +
    '#main .top-section .sub-nav .active a {color:#FF0000!important; top:0px!important; left:38%!important; background-color:#ffffff!important; }' +
    '#main .top-section .actions li a {padding-left:10px!important; background-color:#' + color[0] + '!important; background-image:none!important; border-color:#888888!important;}' +
    'strong {color:#131313!important;}' +
    'h1, h2, h3 {color:#' + color[1] + '!important;}' +
    '#main .content .endless_page_template {width:100%!important; margin:0 10px 0 32px!important;}' +
    '.thumbnail_label_c {background-color:#181818!important;}' +
    '.thumbnail_label_c_hd {background-color:#' + color[1] + '!important;}' +
    '.thumbnail_label_transsexual {background-color:#ff0000!important;}' +
    '.thumbnail_label_c_new {background-color:#545454!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-p {color:#be6aff!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-l {color:#804baa!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-o {color:#dc5500!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-m {color:#dc0000!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-f {color:#00cf00!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-tr {color:#000099!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-t {color:#6699aa!important;}' +
    '#defchat .section .chat-holder .chat-box .users-list .text .color-g {color:#666666!important;}' +
    '#defchat .section .chat-holder .chat-box .chat-list .roommessagelabel {color:#' + color[1] + '!important;}' +
    '.users-list, .settings-list, .chat-list {padding:0 11px 0 11px!important; width: auto!important;}' +
    '#main .content .c-1 {width:100%!important; margin-right:0px!important; margin:6px!important;}' +
    '.paging li a {background-color:#ffffff!important; border-color:#' + color[1] + '!important; background-image:none!important;}' +
    '.paging li a:hover {background-color:#ffffff!important;}' +
    '.paging .prev {border-radius:30px 0 0 30px!important;}' +
    '.paging .next {border-radius:0 30px 30px 0!important;}' +
    '.paging .endless_page_link {color:#181818!important;}' +
    '.paging .active .endless_page_link {color:#' + color[1] + '!important; background-color:#ffffff!important;}' +
    '#main .content .featured_blog_posts .blog_post .title_shell {background-image:none!important;}' +
    '#main .content .featured_blog_posts .blog_post .title_shell .title {background-color:transparent!important;}' +
    '.footer-holder {background-color:#eeeeee!important; background-image:none!important; border-top:2px solid #cbcbcb!important;}' +
    '#jscontext .jscontextBtn {color:#' + color[1] + '!important;}' +
    '#jscontext .jscontextBtn:hover {color:#eeeeee!important;}' +
    '#defchat .section .chat-holder .chat-box .chat-form .row .button_send {background-color:#888888!important; background-image:none!important; border-radius:4px 4px 4px 4px!important;}' +
    '#defchat .section .chat-holder .chat-box .chat-form .row .button_send a {color:#eeeeee!important; background-image:none!important; text-shadow:none!important;}' +
    '#defchat .section .chat-holder .chat-box .chat-form .row .button_send a:hover {color:#ffffff!important;}' +
    '#defchat .section .chat-holder .chat-box .chat-form {margin-right:12px!important;}' +
    '#defchat .info-user .headline .socials .button_share {background-color:#eeeeee!important; background-image:none!important; border-radius:4px 4px 4px 4px!important;}' +
    '#defchat .info-user .headline .socials .button_share a {background-image:none!important; text-shadow:none!important;}' +
    '#defchat .info-user .headline .socials .button_follow {background-color:#eeeeee!important; background-image:none!important; border-radius:4px 4px 4px 4px!important;}' +
    '#defchat .info-user .headline .socials .button_follow a {background-image:none!important; text-shadow:none!important;}' +
    '#defchat .info-user .headline .socials .button_unfollow {background-color:#eeeeee!important; background-image:none!important; border-radius:4px 4px 4px 4px!important;}' +
    '#defchat .info-user .headline .socials .button_unfollow a {background-image:none!important; text-shadow:none!important;}' +
    '#defchat .section .video-box .tip_shell .green_button_tip {background-color:#777777!important; background-image:none!important; border-radius:4px 4px 4px 4px!important;}' +
    '#defchat .section .video-box .tip_shell .green_button_tip .tip_button {color:#eeeeee!important; background-image:none!important; text-shadow:none!important;}' +
    '#defchat .section .video-box .tip_shell .green_button_tip .tip_button:hover {color:#ffffff!important;}' +
    '#defchat .offline_tipping .green_button_tip_offline {background-color:#777777!important; background-image:none!important; border-radius:4px 4px 4px 4px!important;}' +
    '#defchat .offline_tipping .green_button_tip_offline .tip_button {color:#eeeeee!important; background-image:none!important; text-shadow:none!important;}' +
    '#defchat .offline_tipping .green_button_tip_offline .tip_button:hover {color:#ffffff!important;}' +
    '#defchat .section .video-box .tip_shell .goal_display .goal_display_table .dark_blue {background-color:#' + color[0] + '!important;}' +
    '.follow_tooltip, .share_tooltip, #rate_tooltip, #rated_tooltip, #rate_dim_tooltip, #broadcaster_rating_tooltip {background-color:#eeeeee!important; border-color:#777777!important;}' +
    '.follow_tooltip img, .share_tooltip img, #rate_tooltip img, #rated_tooltip img, #rate_dim_tooltip img, #broadcaster_rating_tooltip img {display:none!important;}' +
    '#tabs_content_container dl dt {color:#' + color[1] + '!important;}' +
    '#tabs_content_container .pics-description .photo_list .user_upload .thumbnail_label_tokens {background-color:#181818!important;}' +
    '#body_border .user_uploads .user_upload .thumbnail_label_tokens {background-color:#181818!important;}' +
    '#filter_search_form .button {background-color:#' + color[1] + '!important; background-image:none!important; padding-left:28px!important;}' +
    '#filter_search_form .button:hover {text-decoration:none!important;}' +
    '#defchat {width:auto!important;}' +
    '.section {width:100%!important;}' +
    '.block {margin-right:12px!important; border:1px ridge #000000!important; padding: 4px!important;}' +
    '#login-box {border-color:#777777!important; z-index:2001!important;}' +
    '#login-box .pagename {position:relative!important; top:-4px!important; left:-2px!important; font-family:\'trebuchet ms\'!important; color:#' + color[1] + '!important;}' +
    '#login-box .button {padding-left:14px!important; color:#454545!important; background-color:#cbcbcb!important; background-image:none!important;}' +
    '#login-box .button:hover {color:#eeeeee!important; background-color:#888888!important; text-decoration:none!important;}' +
    '#user_information .top {background-color:#' + color[1] + '!important; border-radius:2px 2px 0 0!important; padding:5px 3px 4px 5px!important;}' +
    '#user_information .top .username{display:inline-block;font:14px; font-family:\'Nyala\'!important;overflow:hidden;margin:0 12px 0 5px;max-width:125px;text-overflow:ellipsis;white-space:nowrap;position:relative;top:3px;}' +
    '#user_information {position:absolute!important; top:-9px!important; right:0!important;}' +
    '#user_information .top a {color:#eeeeee!important;}' +
    '#user_information .top a:hover {color:#cbcbcb!important;}' +
    '#user_information .tokencountlink {font-size:11px!important;}' +
    '#user_information .bottom {border-color:#' + color[1] + '!important;}' +
    '#apps_and_bots_table tr legend {color:#' + color[1] + '!important;}' +
    '#leaderboard .number {color:#181818!important;}' +
    '#leaderboard .position_1 {color:#' + color[1] + '!important;}' +
    '#tag_table {border-color:#' + color[1] + '!important;}' +
    '#tag_table .headers {background-color:#' + color[1] + '!important;}' +
    '#tag_table .tag_row:nth-child(2n+1) {background-color:#' + color[0] + '!important;}' +
    '#broadcaster_settings legend {color:#' + color[1] + '!important;}' +
    '.button {color:#' + color[1] + '!important; text-decoration:none!important; background-color:#eeeeee!important; background-image:none!important; border-radius:4px 4px 4px 4px!important; padding:0 15px 2px 15px!important;}' +
    '.button:hover {color:#131313!important;}' +
    '#filter_search_form p .button {color:#cbcbcb!important; padding:2px 6px!important;}' +
    '#filter_search_form p .button:hover {color:#e6e6e6!important;}' +
    '#suggest_app img {display:none!important;}' +
    'a.user_upload_preview {color:#181818!important;}' +
    'a.user_upload_preview:hover {color:#777777!important;}' +
    '.overlay_popup .formborder {border:2px solid #' + color[1] + '!important; border-radius:4px!important;}' +
    '.overlay_popup .divider {display:none!important;}' +
    '.overlay_popup .title {color:#' + color[1] + '!important;}' +
    '.app_launch a {background-color:#cbcbcb!important;}' +
    '.proposal_votes {background-color:#cbcbcb!important;}' +
    '.related {color:#' + color[1] + '!important;}' +
    '.document, .related {background-color:#' + color[0] + '!important;}' +
    '.sphinxsidebar ul, .sphinxsidebar h4, .sphinxsidebar p, .footer {color:#777777!important;}' +
    '.datatable, .datatable th {background-color:#' + color[1] + '!important;}' +
    '.code {color:#' + color[1] + '!important;}' +
    '.fixnav {position:fixed!important; left:0!important; top:0!important; width:100%!important; height:auto!important; z-index:999!important;}' +
    '#login-overlay {z-index:2000!important;}' +
    '#overlay {z-index:1001!important;}' +
    '#entrance_terms, #broadcast_terms {z-index:1002!important;}' +
    '.tip_popup img {display:none!important;}' +
    '.tabs {background-color:#e6e6e6!important;}' +
    '#app_title {color:#' + color[1] + '!important;}' +
    'legend {color:#' + color[1] + '!important;}' +
    '.share {background-color:#e6e6e6!important;}' +
    '.blue, .ourtitle, .choiceclear {color:#' + color[1] + '!important;}');
//===============================================
//===============================================
var getName = location.pathname;
var latest = getName.slice(1,-1);

if (latest == 'tags') {
    latest = '';
}

var prof = latest.search('p/');
if (prof === 0) {
    latest = latest.replace('p/', '');
}

var broad = latest.search('b/');
if (broad === 0) {
    latest = latest.replace('b/', '');
}

var app = latest.search('app');
if (app === 0) {
    document.getElementById('verText').innerHTML = '';
    document.getElementById('editBut').innerHTML = '';
}

var apps = latest.search('apps');
if (apps === 0) {
    latest = latest.replace('apps', '');
    document.getElementById('verText').innerHTML = '';
    document.getElementById('editBut').innerHTML = '';
}

var affiliates = latest.search('affiliates/api/onlinerooms');
if (affiliates === 0) {
    latest = latest.replace('affiliates/api/onlinerooms', '');
    document.getElementById('verText').innerHTML = '';
    document.getElementById('editBut').innerHTML = '';
}

var feeds = latest.search('feed/latest');
if (feeds === 0) {
    latest = latest.replace('feed/latest', '');
    document.getElementById('verText').innerHTML = '';
    document.getElementById('editBut').innerHTML = '';
}

var photovid = latest.search('photo_videos/');
var tipping = latest.search('tipping/');
var emoticons = latest.search('emoticons');
if ((photovid === 0) || (tipping === 0) || (emoticons === 0)) {
    document.getElementById('verText').innerHTML = '';
    document.getElementById('editBut').innerHTML = '';
}

var pic = document.createElement('IMG');
pic.setAttribute('id', 'newImage');
pic.setAttribute('src', 'https://roomimg.stream.highwebmedia.com/ri/' + latest + '.jpg');
pic.setAttribute('style', 'position:' + posi + '; top:0; right:268px; border:1px solid #' + color[1] + '; width:95px; height:78px; z-index:1000;');
pic.onload = function() {
    if ((latest != '/propose_app') && (latest != '/proposals') && (latest != '/upload_app') && (latest != '/search') && (latest != 'emoticons')) {
        document.body.appendChild(pic);
    }
};
pic.onerror = function() {
    pic.setAttribute('style', 'display:none;');
};

var link = document.getElementsByTagName('a');
for (i = 0; i < link.length; i++) {
    if (link[i].href.indexOf('?url=') != -1) {
        linkhref = unescape(link[i].href);
        newlinkhref = linkhref.substring(linkhref.indexOf("?url=") + 5, linkhref.indexOf("&domain"));
        link[i].href = newlinkhref;
    }
}

var broadcasting = '/b/' + latest + '/';

var onCheck = document.createElement('INS');
var onTxt = document.createTextNode('');
onCheck.setAttribute('id', 'checkOn');
onCheck.setAttribute('style', 'display:none;');
onCheck.appendChild(onTxt);
document.body.appendChild(onCheck);

$('#checkOn').load('https://chaturbate.com/' + latest + '#defchat p strong');

setTimeout(function() {
    var getOn = document.getElementById('checkOn').textContent;
    var stripTags = getOn.search('Room is currently offline');
    if (stripTags !== 0) {
        return;
    }
    else {
        setInterval(function() {
            $('#checkOn').load('https://chaturbate.com/' + latest + '#defchat p strong');
            setTimeout(function() {
                var reCheck = document.getElementById('checkOn').textContent;
                var reStrip = reCheck.search('Room is currently offline');
                if (reStrip === 0) {
                    return;
                }
                else if (getName == broadcasting) {
                    return;
                }
                else {
                    location.reload();
                }
            }, 5000);
        }, 5000);
    }
}, 5000);

// =============================================================================
// === Remove Thumbnail Preview Lock Icon to make Preview more Visible =========
// =============================================================================
var pictures = document.getElementsByClassName('preview');
if (pictures) {
    for (i = 0; i < pictures.length; i++) {
        if (pictures[i].getAttribute("alt") == "Locked") {
            pictures[i].parentNode.removeChild(pictures[i]);
        }
    }
}
// =============================================================================
// === Create Favorite Model Cam ===============================================
// =============================================================================
if (color3 !== '') {
    if (latest == 'transsexual-cams') {
        var chgAct = document.getElementsByClassName('sub-nav')[0].innerHTML;
        var exCheck = chgAct.search('<li class="active">');
        if (exCheck) {
            chgAct = chgAct.replace('<li class="active">', '<li>');
        }
        var newEx = chgAct + '<li class="active"><a href="/' + color3 + '/">' + color3 + '</a></li>';
        document.getElementsByClassName('sub-nav')[0].innerHTML = newEx;
    } else if (getName == broadcasting) {
        console.log('Broadcasting Interface Detected');
    } else {
        var getSub = document.getElementsByClassName('sub-nav')[0].innerHTML;
        var addEx = getSub + '<li><a href="/' + color3 + '/">' + color3 + '</a></li>';
        document.getElementsByClassName('sub-nav')[0].innerHTML = addEx;
    }
}
var getSubAgain = document.getElementsByClassName('sub-nav')[0].innerHTML;
var addExAgain = getSubAgain + '<li><a href="' + document.URL + '">' + 'REFRESH' + '</a></li>';
document.getElementsByClassName('sub-nav')[0].innerHTML = addExAgain;
myFollowedTab();
// =============================================================================
if (color4 === ''){
    color4 = "Tw Cen MT";
}
// =============================================================================
// === Remove Sections =========================================================
// =============================================================================
function removeEBP() {
    MV_removeElementsByPath("//img[contains(@src, 'postimg.org')]");
    MV_removeElementsByPath("//img[contains(@src, 'www.dmca.com/App_Themes/')]");
    MV_removeElementsByPath("//img[contains(@src, 'http://s06.flagcounter.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'http://s09.flagcounter.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'http://25.media.tumblr.com')]");
    MV_removeElementsByPath("//img[contains(@src, '4.bp.blogspot.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'https://3.bp.blogspot.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'https://2.bp.blogspot.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'https://1.bp.blogspot.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'ig-badge-48.png')]");
    MV_removeElementsByPath("//img[contains(@src, 'dmca_protected')]");
    MV_removeElementsByPath("//img[contains(@src, 'imgur')]");
    MV_removeElementsByPath("//img[contains(@src, 'www.camfolk.info/')]");
    MV_removeElementsByPath("//img[contains(@src, 'http://www.asocea.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'tinypic.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'photobucket.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'imageshack.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'ecx.images-amazon.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'dresden-stollen.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'hatchnorfolk.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'icons.iconarchive.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'googleusercontent.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'server.myspace-shack.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'images.dmca.com/Badges/')]");
    MV_removeElementsByPath("//img[contains(@src, 'DMCA_logo-grn-btn100w.png')]");
    MV_removeElementsByPath("//img[contains(@src, 'DMCA_logo-std-btn140w.png')]");
    MV_removeElementsByPath("//img[contains(@src, 'dmca_normal.png')]");
    MV_removeElementsByPath("//img[contains(@src, 'DMCA_logo-200w_a_zpsf5mn8hoq.png')]");
    MV_removeElementsByPath("//img[contains(@src, '_dmca_premi_badge_2.png')]");
    MV_removeElementsByPath("//img[contains(@src, 'amazon_jk.png')]");
    MV_removeElementsByPath("//img[contains(@src, 'https://45.media.tumblr.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'picasion.com')]");
    MV_removeElementsByPath("//img[contains(@src, 'glitterfy.com')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:400px; height:400px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:100px; height:100px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:64px; height:64px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:62px; height:62px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:60px; height:60px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:55px; height:55px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:50px; height:50px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:50px; height:57px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:48px; height:48px')]");
    MV_removeElementsByPath("//img[contains(@style, 'width:43px; height:43px')]");
    MV_removeElementsByPath("//a[contains(@href, 'width:50px; height:50px')]");
    MV_removeElementsByPath("//a[contains(@href, 'http://i.imgur.com')]");
    MV_removeElementsByPath("//a[contains(@href, 'http://imgur.com')]");
    MV_removeElementsByPath("//a[contains(@href, 'amateurmatch')]");
    MV_removeElementsByPath("//a[contains(@href, 'amazon')]");
    MV_removeElementsByPath("//a[contains(@href, '/tags/')]");
    MV_removeElementsByPath("//a[contains(@href, 'https://twitter.com/')]");
    MV_removeElementsByPath("//a[contains(@href, 'instagram.com/')]");
    MV_removeElementsByPath("//a[@href='/contest/details/']");
    //MV_removeElementsByPath("//a[@href='/male-cams/']");
    //MV_removeElementsByPath("//a[@href='/female-cams/']");
    MV_removeElementsByPath("//a[@href='/couple-cams/']");
    //MV_removeElementsByPath("//a[@href='/spy-on-cams/']");
    MV_removeElementsByPath("//div[@class='nav-bar']//li/a[@href='/tipping/free_tokens/']");
    MV_removeElementsByPath("//div[@class='c-1 endless_page_template']//div[@class='thumbnail_label thumbnail_label_c']");
    MV_removeElementsByPath("//div[@class='nav-bar']//li/a[@href='http://blog.chaturbate.com/']");
    MV_removeElementsByPath("//div[@class='top-section']//li/a[@href='/']");
    MV_removeElementsByPath("//div[@class='featured_text']");
    MV_removeElementsByPath("//div[@class='footer-holder']");
    MV_removeElementsByPath("//div[@class='featured_blog_posts']");
    MV_removeElementsByPath("//div[contains(@class, 'thumbnail_label thumbnail_label_c')]");
    MV_removeElementsByPath("//div[contains(@class, 'thumbnail_label thumbnail_label_tokens')]");
    var headerAD = $('.ad');
    if (headerAD) { headerAD.remove(); } //Remove AD sections hidden inside the page Header
// =============================================================================
    var scriptTest = $('script[src="https://cdn.exoticads.com/xads.js"]');
    if (scriptTest) { scriptTest.remove(); } //Remove the garbage AD script
// =============================================================================
    var scriptTest2 = $('script[src="https://ssl.google-analytics.com/ga.js"]');
    if (scriptTest2) { scriptTest2.remove(); } //Remove the google analytics tracking script
// =============================================================================
    var removeGAQ = $('script[id="gaq"]');
    if (removeGAQ) { removeGAQ.remove(); } //Remove the google tracking script
	}
// =============================================================================
// === Functions================================================================
// =============================================================================
// Include start [domUtil.js]
function MV_removeElementsByPath(pPath) {
    var pathResult = document.evaluate(pPath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    if(pathResult.snapshotLength > 0) {
        for(var i=0; i < pathResult.snapshotLength; i++) {
            var pathNode = pathResult.snapshotItem(i);
            pathNode.parentNode.removeChild(pathNode);
        }
    }
}
// =============================================================================
// === Get Elements By Path ====================================================
// =============================================================================
function MV_getElementByPath(pPath, pRoot) {
    var pathResult = document.evaluate(pPath, pRoot === null ? document : pRoot, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    return pathResult.snapshotLength <= 0 ? null : pathResult.snapshotItem(0);
}
// =============================================================================
// === Create Button ===========================================================
// =============================================================================
function MV_createButton(pAttributes, pClickListener) {
    pAttributes.type = "button";
    var resultElement = MV_createElement("input", pAttributes);
    if(pClickListener !== null) {
        resultElement.addEventListener("click", pClickListener, true);
    }
    return resultElement;
}
// =============================================================================
// === Create Element ==========================================================
// =============================================================================
function MV_createElement(pElementName, pAttributes, pInnerHtml) {
    var resultElement = document.createElement(pElementName);
    for(var attributeName in pAttributes) {
        resultElement.setAttribute(attributeName, pAttributes[attributeName]);
    }
    if(pInnerHtml !== null) {
        resultElement.innerHTML = pInnerHtml;
    }
    return resultElement;
}

var passCheck = document.createElement('INS');
var passTxt = document.createTextNode('');
passCheck.setAttribute('id', 'checkPass');
passCheck.setAttribute('style', 'display:none;');
passCheck.appendChild(passTxt);
document.body.appendChild(passCheck);

$('#checkPass').load('https://chaturbate.com/' + latest + '#main .content .c-1 .block h1');

setTimeout(function() {
    var getPass = document.getElementById('checkPass').textContent;
    var stripPtags = getPass.search('This room requires a password.');
    if (stripPtags !== 0) {
        return;
    }
    else {
        setInterval(function() {
            var newLatest = latest.replace('roomlogin/', '');
            $('#checkPass').load('https://chaturbate.com/' + newLatest + '#main .content .c-1 .block h1');
            setTimeout(function() {
                var rePcheck = document.getElementById('checkPass').textContent;
                var rePstrip = rePcheck.search('This room requires a password.');
                if (rePstrip === 0) {
                    return;
                }
                else {
                    window.location = 'https://chaturbate.com/' + newLatest;
                }
            }, 5000);
        }, 5000);
    }
}, 5000);