function flashbanner() {

if ($("div.addFlashbanner").length == 0) {
 return;
}

container = $("div.addFlashbanner")[0];
var banner = $("div.banner", container)[0]
var navn = $("span.filnavn", container).html(); 
var height = $("span.hoyde", container).html(); 
var width = $("span.bredde", container).html();
var title = $("span.flashbannerTittel", container).html()

AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', width,
			'height', height,
			'src', navn,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', title,
			'bgcolor', '#ffffff',
			'name', title,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', navn,
			'salign', ''
			); //end AC code

// change the class of the div tag so not any more flashbanners are created for the same banner
$(container).addClass("flashbanner");
$(container).removeClass("addFlashbanner");
}


function showFlashBanners() {
	var leftFlashbanners = $("#rg15649 .flashbanner");
	if (leftFlashbanners.length > 0) {
		// left flash banner is present, hide the left image
		hideRegion("#rg15652");
	}
	else {
		// no left flash banners, hide the table for it
		hideRegion("#rg15649");
	}
	
	var rightFlashbanners = $("#rg15647 .flashbanner");
	if (rightFlashbanners.length > 0) {
		// right flash banner is present, hide right image
		hideRegion("#rg15653");
	}	
	else {
		// no right flash banners, hide the table for it
		hideRegion("#rg15647");
	}
}


/**
 * Hides a portlet region. 
 * @param id The id of the region to hide. 
 */
function hideRegion(regionId) {
	$(regionId).hide();
	var parent = $(regionId).parent()[0];
	$(parent).css("width", "0");	
}
