vectiaScripts();
function vectiaScripts(){
  $(document).ready(function(){
    /* remove "Vectia Blog:" and "Vectia News:" strings from the footer links*/
    $('#footer .widget_categoryposts .cat-post-item a').each(function(){
      var tempString=$(this).text();
      var tempSubString=tempString.substring(0,12);
      if(tempSubString=="Vectia Blog:" || tempSubString=="Vectia News:"){
        $(this).text(tempString.substring(12));
      }
    });
    
    $('.frontpage-boxes .box h2 a').each(function(){
      var tempString=$(this).text();
      var tempSubString=tempString.substring(0,12);
      if(tempSubString=="Vectia Blog:" || tempSubString=="Vectia News:" || tempSubString=="Vectia Case:"){
        $(this).text(tempString.substring(12));
      }
    });
    
    var itemCounter=0;
    $('.newBlogArchiveNavi li a').each(function(){
      itemCounter++;
      if(itemCounter>10){
      $(this).parent().hide();
      }
      var tempString=$(this).text();
      var tempSubString=tempString.substring(0,12);
      var tempSubString2=tempString.substring(0,13);
      if(tempSubString=="Vectia Blog:" || tempSubString=="Vectia News:" || tempSubString=="Vectia Case:"){
        $(this).text(tempString.substring(12));
      }
      if(tempSubString2=="Vectia Blogi:"){
        $(this).text(tempString.substring(13));
      }
    });
    
    $('.blogArchiveShowAll').click(function(){
      $('.newBlogArchiveNavi li').show('500');
      $(this).hide('500');
    });
    
    itemCounter=0;
    $('.newNewsArchiveNavi li a').each(function(){
      itemCounter++;
      if(itemCounter>10){
      $(this).parent().hide();
      }
      var tempString=$(this).text();
      var tempSubString=tempString.substring(0,12);
      var tempSubString2=tempString.substring(0,15);
      if(tempSubString=="Vectia Blog:" || tempSubString=="Vectia News:" || tempSubString=="Vectia Case:"){
        $(this).text(tempString.substring(12));
      }
      if(tempSubString2=="Vectia Uutisia:"){
        $(this).text(tempString.substring(15));
      }
    });
    
    $('.newsArchiveShowAll').click(function(){
      $('.newNewsArchiveNavi li').show('500');
      $(this).hide('500');
    });
  
  });
  }
