// Non-destructive CSS fixes and various initialisation scripts

$(function(){

    //If we're working on localhost, subst the image.ashx with xxx.metadata.gr/image.ashx
	if ($(window).attr('location').toString().match("localhost") != null) {
		$('img[src*=Image.ashx]').attr('src', function() {
			return 'http://www.bam.gr/' + $(this).attr('src');
		});
	}
	
	//If we're working on localhost, subst the image.ashx with xxx.metadata.gr/image.ashx
	if ($(window).attr('location').toString().match("127.0.0.1") != null) {
		$('img[src*=Image.ashx]').attr('src', function() {
		return 'http://www.bam.gr/' + $(this).attr('src');
		});
	}
	
	// If we're working on localhost, subst the image.ashx with xxx.metadata.gr/image.ashx
	if ($(window).attr('location').toString().match("localhost") != null) {
		$('img[src*=uploads/]').attr('src', function() {
		return 'http://www.bam.gr/' + $(this).attr('src').replace('/WebSite/', '/');
		});
	}

});
