function cleanUp (contentToBeCleanedUp, removing, trim) {
	switch (removing){
		case "font":
			return (contentToBeCleanedUp.replace(/<\/?font[^>]*>/ig, ""));
		break;
		case "span":
			return (contentToBeCleanedUp.replace(/<\/?span[^>]*>/ig, ""));
		break;
		case "clearAllTags":
			var cleanedUp = contentToBeCleanedUp.replace(/<br>/ig, "&br;");
			cleanedUp = cleanedUp.replace(/<p>/ig, "&br;");
			cleanedUp = cleanedUp.replace(/<\/?[^>]*>/ig, "");
			cleanedUp = cleanedUp.replace(/&br;/ig, " ");
			
			if (trim == '0') {
				trim = cleanedUp.length;
			}
			return (cleanedUp.substring(0, trim));
		break;
	}
}

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) {

	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
  	}
  
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function handleContactForm (formNumber) {
	
	currentForm = "contactForm_" + formNumber

	theForm = document.getElementById(currentForm);

	sendForm = true;
	var sendFormErrors = '';

	if (theForm.navn.value == "") {
		sendForm = false;
		sendFormErrors += '\nNavn';
	}
	
	if (theForm.telefon.value == "") {
		sendForm = false;
		sendFormErrors += '\nTelefon';
	}
	
	if (theForm.email.value == "") {
		sendForm = false;
		sendFormErrors += '\nEmail';
	}
	
	if (theForm.emne.value == "") {
		sendForm = false;
		sendFormErrors += '\nEmne';
	}
	
	if (theForm.besked.value == "") {
		sendForm = false;
		sendFormErrors += '\nBesked';
	}
	
	if (sendForm) {
		theForm.submit();
	} else {
		alert ("Du har ikke indtastet:\n" + sendFormErrors);
	}
} 

function clearContactForm (formNumber) {
	
	document.getElementById("contactForm_" + formNumber).reset();
	
}

function fnFlashBanner() {

	var strFlash = '';
	strFlash += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="864" height="134">';
	strFlash += '<param name="movie" value="stadsing_flash_nytwebsite.swf">';
	strFlash += '<param name="quality" value="high">';
	strFlash += '<param name="wmode" value="opaque">';
	strFlash += '<embed src="stadsing_flash_nytwebsite.swf" quality="high" bgcolor="#ffffff" width="864" height="134" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
	strFlash += '</object>'
	
	document.getElementById('FlashBanner').innerHTML = strFlash;	
	
}

function wipeIt() {

	document.getElementById("frontpageflash").style.display = "none";

}

function fnFrontpageFlash() {

	var strFlash = '';
	strFlash += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="999" height="400">';
	strFlash += '<param name="movie" value="frontpageflash/maskine.swf">';
	strFlash += '<param name="quality" value="high">';
	strFlash += '<param name="wmode" value="transparent">';
	strFlash += '<embed src="frontpageflash/maskine.swf" quality="high" bgcolor="#ffffff" width="999" height="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>';
	strFlash += '</object>'
	
	document.getElementById('frontpageflash').innerHTML = strFlash;	
	
}