function replace_headers() {
	var counter = 0;
	// Sort text til education
	var s = $$('div.sortTitle');
	s.each(function(a) {
			intWidth = a.offsetWidth;
			intHeight = a.offsetHeight;
			intHeight = 50;
			var flashVars = {
					fontSize: 18,
					fontColor: "2c2c2c",
					headerText: a.innerHTML.replace("&amp;", "%26")
				}
			var params = {
				bgColor: '#f1f2f1'
			}
			a.innerHTML = '<div id="contentH1'+counter+'">'+a.innerHTML+'</div>';
			swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars, params);
			counter++;
		}
	);
	
	// Erstat alle H1 i body
	var s = $$('div.content h1');
	
	s.each(function(a) {
			intWidth = a.offsetWidth;
			a.style.letterSpacing='0px';
			intHeight = a.offsetHeight;
//			alert(intHeight);
			ans = a.ancestors();
			ans = ans[0];
			if(ans.className=='content') {
				var flashVars = {
					fontSize: 26,
					fontColor: "2c2c2c",
					headerText: a.innerHTML.replace("&amp;", "%26")
				}
				a.innerHTML = '<div id="contentH1'+counter+'">'+a.innerHTML+'</div>';
				swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars);
				counter++;
			}
		}
	);
	// Erstat alle H1 i body
	var s = $$('div.contentLogin h1');
	
	s.each(function(a) {
			intWidth = a.offsetWidth;
			a.style.letterSpacing='0px';
			intHeight = a.offsetHeight;
//			alert(intHeight);
			ans = a.ancestors();
			ans = ans[0];
			if(ans.className=='contentLogin') {
				var flashVars = {
					fontSize: 26,
					fontColor: "2c2c2c",
					headerText: a.innerHTML.replace("&amp;", "%26")
				}
				a.innerHTML = '<div id="contentH1'+counter+'">'+a.innerHTML+'</div>';
				swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars);
				counter++;
			}
		}
	);
	
//	var s = $$('div.content h2');
//	
//	s.each(function(a) {
//			intWidth = a.offsetWidth;
//			intHeight = a.offsetHeight;
////			intHeight = 34;
//			ans = a.ancestors();
//			ans = ans[0];
//			if(ans.className=='content') {
//				var flashVars = {
//					fontSize: 20,
//					fontColor: "2c2c2c",
//					headerText: a.innerHTML.replace("&amp;", "%26")
//				}
//				a.innerHTML = '<div id="contentH1'+counter+'">'+a.innerHTML+'</div>';
//				swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars);
//				counter++;
//			}
//		}
//	);
//	
//	var s = $$('h2.news');
//	s.each(function(a) {
//			intWidth = a.offsetWidth;
//			intHeight = a.offsetHeight;
//			intHeight = 41;
//			ans = a.ancestors();
//			ans = ans[0];
//			var flashVars = {
//				fontSize: 26,
//				fontColor: "2c2c2c",
//				headerText: a.innerHTML.replace("&amp;", "%26")
//			}
//			a.innerHTML = '<div id="contentH1'+counter+'">'+a.innerHTML+'</div>';
//			swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars);
//			counter++;
//		}
//	);
	
	// Ops�t folde divs
	var s = $$('div.foldeRightUdvid');
	s.each(function(a) {
			a.onclick = function() {
				show_folde_div(a.id);
			}
			a.style.cursor='pointer';
			var m = a.firstDescendant();
			$(a.id+'_fold').show();
			
			// Replace headers
			var c = $(a.id+'_fold').childElements();
			
			c.each(function(b) {
					if(b.tagName=='H1') {
						intHeight=0;
						intWidth = b.offsetWidth;
						intHeight = b.offsetHeight;
//						b.style.backgroundColor='blue';
//						intHeight=41;
						var flashVars = {
							fontSize: 26,
							fontColor: "2c2c2c",
							headerText: b.innerHTML.replace("&amp;", "%26")
						}
						b.innerHTML = '<div id="contentH1'+counter+'">'+b.innerHTML+'</div>';
						swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars);
						counter++;
					} else if(b.tagName=='H2') {
						intWidth = b.offsetWidth;
						intHeight = b.offsetHeight;
//						intHeight=34;
						var flashVars = {
							fontSize: 20,
							fontColor: "2c2c2c",
							headerText: b.innerHTML.replace("&amp;", "%26")
						}
						b.innerHTML = '<div id="contentH1'+counter+'">'+b.innerHTML+'</div>';
						swfobject.embedSWF("/flash/headers.swf", "contentH1"+counter, intWidth, intHeight, "9.0.0", "/flash/expressInstall.swf", flashVars);
						counter++;
					}
				}
			);
			if(m.className=='foldeDown') {
				$(a.id+'_fold').hide();
			}
		}
	);
}

function show_folde_div(id) {
	if($(id+"_fold").style.display=='none') {
		$(id+"_fold").show();
		var s = $(id).firstDescendant();
		s.className='foldeUp';
	} else {
		$(id+"_fold").hide();
		var s = $(id).firstDescendant();
		s.className='foldeDown';
	}
}

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