// to display CC-BY icon if article is tagged with CC-BY licence
	$(document).ready(function() {
$("#content-block li.creative-commons").each(function(i) {
  var object = $(this);
  var splitClass=object.attr("class").split(' ');
  $.each(splitClass, function(key, value){
    var regMatch=value.match(/creative-commons-by\/([3,4]\.[0])/);
    if(regMatch){
      var matchObj = object.find("span.open-access-note");
      matchObj.append('<a class="creative-commons-js" rel="creative-commons" href="http://creativecommons.org/licenses/by/'+regMatch[1]+'/"><img src="http://i.creativecommons.org/l/by/'+regMatch[1]+'/80x15.png" alt="cc-by icon"/></a>');
    }
  })
})
})

// to change col-2 words if license is CC-BY licence
$(document).ready(function() {
      var ccArticle=false;
       $("#col-2 div.cb-views li span").each(function(i) {
         if($(this).hasClass("creative-commons-article")){
           $(this).remove();
           ccArticle = true;
         }
       });

         if(ccArticle){
           $("#col-2 span.oa-article").html('Free via CC-BY: <span>OA</span>');
         }else{
          $("#col-2 span.oa-article").html('Free via Free Access: <span>OA</span>'); 
         }
})
