jQuery(function($) {
	$('div.breadcrum a[href="/midt-nordjylland/planserie"]').prop('href', '/midt-nordjylland');
	$('div.breadcrum a[href="/soenderjylland/planserie"]').prop('href', '/soenderjylland');
	$('div.breadcrum a[href="/fyn/planserie"]').prop('href', '/fyn');
	$('div.breadcrum a[href="/sjaelland/planserie"]').prop('href', '/sjaelland');
});
var interbyg = {
	gallery: {
		addedToInit: false,
		ids: [],
		originalImage: null,
		galleries: [],
		currentImage: null,
		imageLoaded: false,
		firstImage: null,
		initialize: function() {
			try {
				this.originalImage = document.getElementById('contentPres').getElementsByTagName('img')[0];
				for (var i = 0; i < this.ids.length; i++) {
					this.galleries.push(document.getElementById(this.ids[i]).getElementsByTagName('a'));
				}
			} catch (e) {}
			if (this.originalImage && this.galleries.length) {
				this.firstImage = this.originalImage;
				var me = this;
				var click = function() {
					return false; // remove lightbox functionality
				};
				var mouseout = function() {
					if (me.imageLoaded) {
						me.firstImage.parentNode.replaceChild(me.originalImage, me.firstImage);
						me.firstImage = me.originalImage;
					}
					me.currentImage = null;
				};
				var load = function() {
					if (me.currentImage) {
						me.firstImage.parentNode.replaceChild(me.currentImage, me.firstImage);
						me.firstImage = me.currentImage;
						me.imageLoaded = true;
					}
				};
				var mouseover = function() {
					me.currentImage = document.createElement('img');
					me.imageLoaded = false;
					me.currentImage.onload = load;
					me.currentImage.setAttribute('alt', this.getAttribute('title'));
					me.currentImage.setAttribute('src', this.getAttribute('href'));
				};
				setTimeout(function() {
					var link;
					for (var i = 0; i < me.galleries.length; i++) {
						for (var j = 0; j < me.galleries[i].length; j++) {
							link = me.galleries[i][j];
							link.onclick = click;
							link.onmouseover = mouseover;
							link.onmouseout = mouseout;
						}
					}
				}, 0);
			}
		},

		add: function(id) {
			this.ids.push(id);
			if (!this.addedToInit) {
				lightCore.registerInit(this);
				this.addedToInit = true;
			}
		}
	},

	loadVideo: function() {
		if (!secoya.cookie.get('videoSeen')) {
			//lightCore.embedSWF('/Flash/Interbyg.swf', 'commercial',  636, 356);
			//secoya.cookie.set('videoSeen', '1', 30*24*60*60); // 30 days
		}else{
			showConent();
		}
	}
};

function removeVideo(){
	setTimeout(removeIt,1000);
}

function showConent(){
	var theOne =  document.getElementById('hideOne');
	theOne.style.display = 'block';
}

function removeIt(){
	var remo = document.getElementById('commercial');
	remo.style.display = 'none';
	showConent();
}



