(function (m, i) { // Prevent calls to Firebug from causing errors
    if (!window.console || !console.firebug) {
        window.console = {};
        for (i = 0; i < 16; i += 1) {
            window.console[m[i]] = function () {};
        }
    }
})('log debug info warn error assert dir dirxml group groupEnd time timeEnd count trace profile profileEnd'.split(' '));
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


var article = {
	imageSetup: function(){
		oImage = $$('#mainContentColumn blockquote img');
		if(oImage.length == 0) return;
		var p  = new Element('p', {id: 'topimage'}).grab(oImage[0]);
		p.inject($('page-header'),'before');

		oThumbs = $$('#thumbnails img');
		if(oThumbs.length == 0) return;
		var vinjett  = new Element('h2', {'html': 'Fler bilder'}).inject($('thumbnails'),'top');
		oThumbs.each(function(target,index){
			var a = new Element('a', {'href': target.src, 'rel': 'lightbox-article', 'title': target.alt}).wraps(target);
		});
	},
	projectSetup : function(){
		oProduct = $('projectInfo');
		if(!oProduct) return;
		$('leftContentColumn').grab(oProduct)
	}
};


window.addEvent('domready', function() {
   article.imageSetup();
   article.projectSetup();
   Slimbox.scanPage();
});