you do not call your function. A solution would be to ad the following code to the head of the html.
$( document ).ready(function() {
welcomepic();
});
you also need to remove the previous set class in the welcompic function otherwise you'll end up with double classes.
function welcomepic() {
if (location.hostname == 'www.SampleSiteA.com') {
$('.welcomepic').removeClass('picForB').addClass('picForA');
} else {
$('.welcomepic').removeClass('picForA').addClass('picForB');
}
}