//  This code locates the header logo in the page, then changes the logo to the new one if the old logo is found.

// Create variables
// var imgSourceLocation = "/resources/img/logos/WK_WR_Wheel_RGB_PNG/WK_WR_01_Pos_RGB_Color.png";
var imgSourceLocation = "/resources/img/logos/WK_H_Horizontal_RGB_PNG/WK_H_01_Pos_RGB_250_Color.png";
var imgSource = $('.wh_logo').find('img').attr('src');
var DocumentName = $('.wh_publication_title').text();

// If the logo does not exist, create it
var logoLength = $('.wh_logo').length;
if (logoLength == 0) {
	$('.wh_logo_and_publication_title').prepend('<a href="" class=" wh_logo hidden-xs " style="visibility: visible;"><img src="" alt="' + DocumentName + '" width="250px"></a>');
}

// If the old logo is present, change to the new logo
// if ((imgSource !== '/resources/img/logos/WK_WR_Wheel_RGB_PNG/WK_WR_01_Pos_RGB_Color.png' || imgSource !== 'WK_WR_01_Pos_RGB_Color.png')) {
// 	$('.wh_logo').find('img').attr('src', '/resources/img/logos/WK_WR_Wheel_RGB_PNG/WK_WR_01_Pos_RGB_Color.png');
// 	$('.wh_logo').find('img').attr('width', '70px');
// };
if ((imgSource !== '/resources/img/logos/WK_H_Horizontal_RGB_PNG/WK_H_01_Pos_RGB_250_Color.png' || imgSource !== 'WK_H_01_Pos_RGB_250_Color.png')) {
	$('.wh_logo').find('img').attr('src', '/resources/img/logos/WK_H_Horizontal_RGB_PNG/WK_H_01_Pos_RGB_250_Color.png');
	$('.wh_logo').find('img').attr('width', '250px');
};


// Make the logo visible and position it
$('.wh_logo').css({
	'margin-right': '10px',
	'visibility':'visible'
	})
