var homeUrl = 'http://www.example.com';
if ( document.URL == homeUrl ){
// true
}else{
// false
}
Now put an id on your image tag in the HTML:
<img src="/img/logo-home.png" id="logotype" />
Now you can easily find the image tag with javascript and change the source of the image depending on where you are on the site.
$(document).ready(function(){
var homeUrl = 'http://www.example.com';
var logotypeHome = '/img/logo-home.png';
var logotypeGeneral = '/img/logo-general.png';
if ( document.URL == homeUrl ){
$('#logotype').attr("src", logotypeHome);
}else{
$('#logotype').attr("src", logotypeGeneral);
}
});
I would still strongly recommend to go for a server-side solution for a thing like this. If the client doesn't have JavaScript enabled this will not work. Also there could be a flash on the image when the javascript changes the logo source.