var customStyle = `

.TeamPage_newsHolder a, .TeamPage_newsHolder a:link, .TeamPage_newsHolder a:visited {
  color: CustomBackgroundColor;
}

a, a:visited {
  color: CustomBackgroundColor;
}

.sWebTheme_Actions a.sWebTheme_ActionsLinks:hover span, .sWebTheme_Actions a.sWebTheme_ActionsLinks:focus span, .sWebTheme_Actions a.sWebTheme_ActionsLinks:active span {
  background: CustomBackgroundColor;
  color: CustomFontColor;
}

#sWebHome_ActionsBar .sWebTheme_showSettings:hover {
  background-color: CustomBackgroundColor;
  color: CustomFontColor;
}

/*inner page*/
.dtContainer h2.dtHead,
.dtContainer .dtTitle {
  background-color: CustomBackgroundColor;
}

::-webkit-scrollbar-thumb {
  background-color: CustomBackgroundColor;
}

.skLogin a.skBtn:hover, .skLogin a.skBtn:focus, .skLogin a.skBtn:active {
  color: CustomBackgroundColor;
}

.skTopBar .google-translater:hover #Layer_1 {
  fill: CustomBackgroundColor;
}

.skNav {
  background-color: CustomBackgroundColor;
}

#dnnStandardMenu .root.sel .roottxt,
#dnnStandardMenu .root.exp .roottxt,
#dnnStandardMenu .roottxt:hover {
  background-color: #fff;
  color: CustomBackgroundColor;
}

#dnnStandardMenu .mi1 .txt:hover {
  color: CustomBackgroundColor;
}

#slider1920516 {
  background-color: CustomBackgroundColor;
}

.skSlider .skNextLinks svg,
.skSlider .skPrevLinks svg {
  fill: CustomFontColor;
}

.caption a.button {
  background-color: CustomFontColor;
}

.skNavTabs ul.nav a.tabLink {
  background-color: CustomFontColor;
  color: #fff;
}

.skTabsCnt.skNews a.url:hover {
  color: CustomBackgroundColor;
}

.skTabsCnt.skNews .skNewsImage:hover:after {
  background-color: CustomBackgroundRGBA(0.4);
}

.skTabsCnt.skNews a.viewall {
  background-color: CustomFontColor;
  color: #fff;
}

.detail .date {
  color: CustomBackgroundColor;
}

.skCalendar a.viewall {
  background-color: CustomFontColor;
}

.skCalendar .calendarTitle a:hover,
.skCalendar .calendarTitle a:focus,
.skCalendar .calendarTitle a:active,
.skCalendar .datewrp .month,
.skCalendar .time {
  color: CustomBackgroundColor;
}

.calendarTitle a:hover, .calendarTitle a:focus, .calendarTitle a:active {
  color: CustomBackgroundColor;
}

.skAboutus .inner h1,
.skAboutus .inner h2,
.skAboutus .inner h3,
.skAboutus .inner h4,
.skAboutus .inner h5,
.skAboutus .inner h6,
.skAboutus .inner a:hover,
.skAboutus .inner a:focus,
.skAboutus .inner a:active,
.skHighlight .inner h1,
.skHighlight .inner h2,
.skHighlight .inner h3,
.skHighlight .inner h4,
.skHighlight .inner h5,
.skHighlight .inner h6,
.skHighlight .inner a:hover,
.skHighlight .inner a:focus,
.skHighlight .inner a:active {
  color: CustomBackgroundColor;
}

.skFeildColumn h2.skHead,
.skSocialColumn h2.skHead {
  background-color: CustomBackgroundColor;
  color: #fff;
}

.skFieldStatus .skDate {
  color: CustomBackgroundColor;
}

.skFieldStatus .viewall {
  background-color: CustomFontColor;
}

a.tweet_screen_name:hover, a.tweet_screen_name:focus, a.tweet_screen_name:active {
  color: CustomBackgroundColor;
}

.tweet_text a:hover, .tweet_text a:focus, .tweet_text a:active {
  color: CustomBackgroundColor;
}

ul.tweet_list .tweet_time {
  color: CustomBackgroundColor;
}

a.nextSponsor svg,
a.prevSponsor svg {
  fill: CustomBackgroundColor;
}

.skAFLinks h2:before, .skAFLinks h2:after {
  border-color: CustomBackgroundColor;
}

.skClubInfo a {
  color: CustomBackgroundColor;
}

.sksiteLinks li {
  border-bottom-color: CustomBackgroundColor;
}

.skFooter .sksiteLinks ul.site-links li a {
	color : #222222;
}

#Body .skFooter .sksiteLinks ul.site-links li a:hover, 
#Body .skFooter .sksiteLinks ul.site-links li a:focus, 
#Body .skFooter .sksiteLinks ul.site-links li a:active {
  color: CustomBackgroundColor;
}

.sksiteLinks a svg {
  fill: CustomBackgroundColor;
}

.skInfo {
  background: CustomBackgroundColor;
}

.skInfo .Info-Left a:hover, .skInfo .Info-Left a:focus, .skInfo .Info-Left a:active {
  color: CustomFontColor;
}

.skFooter .skSocial a.link svg:hover {
  fill: CustomBackgroundColor;
}

@media screen and (max-width: 768px) {

  .skSlider .pager a.selected {
    background-color: CustomBackgroundColor;
  }

  .skLogin a.skBtn,
  .skLogin a.skBtn:hover,
  .skLogin a.skBtn:focus,
  .skLogin a.skBtn:active {
    background-color: CustomBackgroundColor;
    color : #fff;
  }
  .skTabs .mobTabLink {
    background-color: CustomFontColor;
  }

   .skColumnContent h2.skHead {
    background-color: CustomBackgroundColor;
  }

  .skInfo {
    background-color: CustomFontColor;
  }

  #Body #mobNav .navBar {
    background: CustomBackgroundColor;
  }

  #Body #mobNav .navDropDown {
    background: CustomBackgroundColor;
  }

  #Body #mobNav .navTabs .activeTab {
    border-bottom-color: CustomBackgroundColor;
  }
    
  #Body #mobNav .navChild .navLink, #mobNav .navChild .navLink:link, #mobNav .navChild .navLink:visited {
    color: CustomBackgroundColor;
  }

  #Body #mobNav .navChild .navIcon {
    fill: CustomBackgroundColor;
  }
}
`

$(document).ready(function () {
    var customStyleSheet = $("<style type='text/css'></style>");
    var currentBackgroundColor = window.selectedBaseColor !== '' ? window.selectedBaseColor : window.currentBaseColor;
    var currentTextColor = window.selectedTextColor !== '' ? window.selectedTextColor : window.currentTextColor;
    $("body").append(customStyleSheet);
    $("#themecolor")
        .val(currentBackgroundColor)
        .change(function (event) {
            applyCustomColor();
        });
    $("#textcolor")
        .val(currentTextColor)
        .change(function (event) {
            applyCustomColor();
        });
   
    function applyCustomColor(){
        var baseRe = new RegExp("CustomBackgroundColor", "g");
        var textRe = new RegExp("CustomFontColor", "g");
        var rgbaRe = new RegExp("CustomBackgroundRGBA\(([^)]+)\)", "g")
        var css = customStyle
        .replace(baseRe, currentBackgroundColor)
        .replace(textRe, currentTextColor);
        customStyleSheet.html(css);
    }
});