var customStyle = `
/* Scoll Track*/
::-webkit-scrollbar-thumb {
  background-color: CustomBackgroundColor;
}

.skSection ::-webkit-scrollbar-thumb {
  background: CustomBackgroundColor;
}

a, a:link, a:visited,
a.CommandButton,
a.CommandButton:link,
a.CommandButton:visited,
a.SkinObject,
a.SkinObject:link,
a.SkinObject:visited {
    color: CustomBackgroundColor;
}

.TeamPage_newsHolder a, .TeamPage_newsHolder a:link, .TeamPage_newsHolder a:visited,
.TeamPage_gridColumn a,
.TeamPage_gridColumn a:link,
.TeamPage_gridColumn a:visited,
.skWrapper .ModLinksC a,
.skWrapper .ModLinksC a:link,
.skWrapper .ModLinksC a:visited,
.skWrapper .ModDNNHTMLC a,
.skWrapper .ModDNNHTMLC a:link,
.skWrapper .ModDNNHTMLC a:visited {
    color: <%= CustomBackgroundColor() %>;
}


/* Header CSS */
/*******************************************************************/
.skSocial #google_translate_element svg,
.skSocial a.link svg,
.skSocial a.link:link svg,
.skSocial a.link:visited svg {
  fill: CustomBackgroundColor;
}

.skAction .skLogin a.skBtn {
  background: CustomBackgroundColor;
}

.skAction .skLogin {
  background: CustomBackgroundColor;
}


/* Navigation CSS */
/*******************************************************************/
.skNav {
    background: CustomBackgroundColor;
}
.skNav #dnnStandardMenu .root .m  {
    background: CustomFontColor;
}

.skNav #dnnStandardMenu .root .txt:hover {
  background: CustomFontColor;
}

.skNav #dnnStandardMenu .root.sel .txt, .skNav #dnnStandardMenu .root.exp .txt {
  background: CustomFontColor;
}

.skNav #dnnStandardMenu .dropdown {
  background: CustomFontColor;
}

.skSocialTab li a.skHead:not(.active) {
  background: CustomFontColor;
}

.skNav #dnnStandardMenu .root .mi1 .txt,
.skNav #dnnStandardMenu .root .mi2 .txt {
   color: CustomBackgroundColor;
}


/* News CSS */
/*******************************************************************/

.skSocialTab li a.skHead {
  background: CustomBackgroundColor;
}

.skSection .skHead {
  background: CustomBackgroundColor;
}

.skSocialTab li a.skHead:not(.active):hover {
  background-color: CustomBackgroundColor;
}

.skSection .skColumnContent {
  background: CustomBackgroundColor;
}

.skSection .skColumnContent:after {
    background: linear-gradient(to bottom, rgba(0, 93, 219, 0) 0%, CustomBackgroundColor 60%, CustomBackgroundColor 100%);
    background: -webkit-linear-gradient to bottom, rgba(0, 93, 219, 0) 0%, CustomBackgroundColor 60%, CustomBackgroundColor 100%;
}


/* Field Status CSS */
/*******************************************************************/

ul.skField .skDate {
  color: CustomFontColor;
}


/* Sponsor CSS */
/*******************************************************************/

.skSpnPVLinks svg,
.skSpnNTLinks svg {
  fill: CustomBackgroundColor;
}


/* Slider CSS */
/********************************************************************/

#slider940516 a.next:hover svg,
#slider940516 a.prev:hover svg {
  fill: CustomBackgroundColor;
}

/* Footer CSS */
/********************************************************************/

.skFooter {
  background-color: CustomBackgroundColor;
}

.skBottomBar .skInfo .SkinObject:hover {
  color: CustomBackgroundColor;
}

.skFooter .skSiteLink li.skSiteItem:hover:before,
.skFooter .skSiteLink li.skSiteItem:hover a.skSiteItemLink {
  color: CustomFontColor;
}

.skContact .skClubAddress a.skClubPhone,
.skContact .skClubAddress a.skClubEmail {
  color: CustomFontColor;
}

.skBottomBar {
  background: CustomFontColor;
}

.skBottomBar .skInfo {
  background: CustomFontColor;
}

/*Inner pages*/
/********************************************************************/

.TeamPage_gridColumn a, 
.TeamPage_gridColumn a:link, 
.TeamPage_gridColumn a:visited {
  color: CustomBackgroundColor;
}

.TeamPage_normalText a, 
.TeamPage_normalText a:link, 
.TeamPage_normalText a:visited, 
.dtContent .content a, 
.dtContent .content a:link, 
.dtContent .content a:visited {
    color: CustomBackgroundColor;
}

.sWebTheme_ActionsArea a.sWebTheme_ActionsLinks:active span, 
.sWebTheme_ActionsArea a.sWebTheme_ActionsLinks:hover span, 
.sWebTheme_ActionsArea a.sWebTheme_ActionsLinks:focus span {
  background-color: CustomBackgroundColor;
  color: CustomFontColor;
}

.sWebTheme_ActionsArea a.sWebTheme_showSettings:hover {
  background-color: CustomBackgroundColor;
  color: CustomFontColor;
}

.skInner .default-header {
  background: CustomBackgroundColor;
}


/* Mobile CSS */
/********************************************************************/
#Body.athena #mobNav .navBar {
  background: CustomBackgroundColor;
}

#Body.athena #mobNav .navDropDown {
  background: CustomBackgroundColor;
}

#Body.athena #mobNav .navChild .navLink, #Body.athena #mobNav .navChild .navLink:link, #Body.athena #mobNav .navChild .navLink:visited {
  color: CustomBackgroundColor;
}

#Body.athena #mobNav .navChild .navIcon {
  fill: CustomBackgroundColor;
}

// .skSection .skColumnContent.expanded .skHead {
//   color: CustomBackgroundColor;
// }

.skSection .skNews .readmore a {
  color: CustomBackgroundColor;
}

/* responsive CSS */
/********************************************************************/

@media screen and (max-width: 768px) {
  .skSection .skColumnContent.expanded {
    background: CustomBackgroundColor;
  }
  #Body #slider940516 .pager a.selected {
    background: 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 encodeRe = new RegExp("EncodedSvgCustomColor", "g");
        var encodedColor = encodeURIComponent($("#themecolor").val());
        var svgBackgroundImage = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='37px' height='59px'%3E%3Cpath fill='" + encodedColor + "' d='M0.0,0.0 L17.0,0.0 L37.0,29.0 L37.0,29.999 L17.0,59.0 L0.0,59.0 L19.999,29.999 L19.999,29.0 L0.0,0.0 Z'/%3E%3C/svg%3E\")";
        var css = customStyle.replace(baseRe, $("#themecolor").val()).replace(textRe, $("#textcolor").val()).replace(encodeRe, svgBackgroundImage);
        customStyleSheet.html(css);
    }
});