function bn_isNotEmpty(name) {
   return (name != null) && (name != "");
}
function baynote_setAttrs() {
	/*alert('setAttrs');*/
	var metas = document.getElementsByTagName("meta");
	if (!metas) return;
	
	for (var i = 0; i < metas.length; i++) {
		if (!metas[i]) return;
			if (metas[i].name == "bn_date") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.date = tempMetaContent;
				}
			} else if (metas[i].name == "bn_model") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.model = tempMetaContent;
				}
			} else if (metas[i].name == "bn_make") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.make = tempMetaContent;
				}
			} else if (metas[i].name == "bn_thumbnailURL") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.thumbnailURL = tempMetaContent;
				}
			}else if (metas[i].name == "description") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.description = tempMetaContent;
				}
			}else if (metas[i].name == "bn_articleType") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.articleType = tempMetaContent;
				}
			}else if (metas[i].name == "bn_expired") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.expired = tempMetaContent;
				}
			}else if (metas[i].name == "bn_headline") {
				var tempMetaContent = metas[i].content;
				if(bn_isNotEmpty(tempMetaContent)) {
					baynote_tag.docAttrs.headline = tempMetaContent;
				}
			}
			
	}
}
var bn_location_href = window.location.href;
if (bn_location_href.indexOf("https://") == 0) {
	baynote_tag.server = "https://dennis-auto.baynote.net";
} else {
	baynote_tag.server = "http://dennis-auto.baynote.net";
}
baynote_tag.customerId = "dennis";
baynote_tag.code = "auto";
baynote_tag.type = "baynoteObserver";
baynote_globals.cookieDomain = "autoexpress.co.uk";
baynote_setAttrs();
baynote_tag.show();