function replace_headers() {
	var s = $$('div.topBanner');
	var counter = 0
	s.each(function(a) {
//			alert(a.innerHTML);
			intWidth = a.offsetWidth;
			intHeight = 32;
			var flashvars = {
				header: a.innerHTML
			};
			//arrHs[i].innerHTML = "<div id='flashheadline"+i+"' style='width: "+intWidth+"px; height: "+intHeight+"px;'>"+strText+"</div>";
			a.innerHTML = "<div id='flashheading1"+counter+"' style='width: "+intWidth+"px; height: "+(intHeight)+"px;'>"+a.innerHTML+"</div>";
			
			swfobject.embedSWF("/flash/Overskrifter.swf", "flashheading1"+counter, intWidth, intHeight, "9.0.0", "../../flash/expressInstall.swf", flashvars);
			counter++;
		}
	);
	
	var s = $$('div.tilbudPris');
	var counter = 0;
	s.each(function(a) {
			intWidth = 168;
			intHeight = 85;
			contentAry = a.innerHTML.split(";");
			maengde = contentAry[0];
			contentAry = contentAry[1].split(",");
			kr = contentAry[0];
			ore = contentAry[1];
			var flashvars = {
				kroner: kr,
				oerer: ore,
				maengde: maengde
			};
			a.innerHTML = "<div id='pris"+counter+"' style=\"height: "+intHeight+"px; width: "+intWidth+"px;\">"+a.innerHTML+"</div>";
			swfobject.embedSWF("/flash/PrisFlash.swf", "pris"+counter, intWidth, intHeight, "9.0.0", "../../flash/expressInstall.swf", flashvars);
			counter++;
		}
	);
	
	/* Video thumbs */
	var s = $$('div.thumbFlv');
	var counter = 0;
	s.each(
		function(a) {
//			a.show();
			var content = a.innerHTML.split(";");
			var flashvars = {
				id: content[0],
				flv: content[1]
			};
			a.innerHTML='<div id="flvThumb_'+counter+'" style="height: 65px; width: 115px;">&nbsp;</div>';
			//a.id = "flvThumb_"+counter;
			swfobject.embedSWF("/flash/flvThumb.swf", "flvThumb_"+counter, 115, 65, "9.0.0", "../../flash/expressInstall.swf", flashvars);
			a.show();
			counter++;
		}
	);
	
	var s = $$('p.CatalogueFlash');
	var counter = 0;
	s.each(
		function(a) {
//			var str = new String(document.location);
////			alert(str.indexOf("ref"));
//			if(str.indexOf('ref=newsletter')>-1) {
//				var flashvars = {
//					ref: "newsletter"
//				};
//			} else {
//				var flashvars = {
//					
//				};
//			}
			a.update('<span id="catalogueFlash_'+counter+'"></span>');
			swfobject.embedSWF("/flash/CatalogueFlash.swf", "catalogueFlash_"+counter, 400, 156, "9.0.0", "../../flash/expressInstall.swf");
			counter++;
		}
	);
}


Event.observe(window, 'load', function() {
		replace_headers();
	}
);