function flashResizer(flId,width,height){ 
	if (document.getElementById(flId+"Container")){
		if (flId.indexOf("nav") == -1)
		{
			if (width != 0) document.getElementById(flId+"Container").style.width = width+"px";		
		}
		if (height != 0) document.getElementById(flId+"Container").style.height = height+"px";
	}
	if (document.getElementById(flId+"Flash")){
		if (width != 0) document.getElementById(flId+"Flash").style.width = width+"px";
		if (height != 0) document.getElementById(flId+"Flash").style.height = height+"px";
	}
	if (allowDebbuger)
	{
		var debug = document.getElementById("debuger");
		debug.className = "visible";
		debug.innerHTML = debug.innerHTML+flId+":"+width+":"+height+"<br />";
	}
	return "flashCall result:ok w:"+width+", h:"+height;
}

var headlines = Array();

function insertDuffr(id,width,height,bgColor,content,font){
	if (font == undefined) font = 'duffr';
	content = content.replace(/_/g,'%26nbsp;');
	headlines.push(new SWFObject("/swf/duffr/duffr.swf", id+"Flash", width, height, "8", bgColor));
	headlines[headlines.length-1].addParam("scale", "noscale");
	headlines[headlines.length-1].addParam("allowScriptAccess", "always");
	headlines[headlines.length-1].addVariable("srcXML", "<duffr flashId='"+id+"' definitionSrc='CSS' callResize='none' definitionFile='/css/"+font+".css' sendSize='false' fontPath='/swf/duffr/fonts/'><![CDATA["+content+"]]></duffr>");
	headlines[headlines.length-1].write(id+"Container");
	$('#'+id+'container').css('width',width+'px');
}

function changeRls(index){

	if (index != activeRls){
		var title = 
		$('#rlsImage').html('<img src="'+releaseData[index].image+'" width="588" height="314" alt="'+releaseData[index].title.replace('<br />','')+'" title="'+releaseData[index].title.replace('<br />','')+'" />')
		
		
		if ($('.rlsNav > a').length > 0){
			if ($('.rlsNav > a')[index].className != "")
				$('.rlsNav > a')[index].className = 'active rm';
			else
				$('.rlsNav > a')[index].className = 'active';

			if ($('.rlsNav > a')[activeRls].className != 'active')
				$('.rlsNav > a')[activeRls].className = 'rm';
			else
				$('.rlsNav > a')[activeRls].className = '';
		}
		
		$('.rlsTitle').html('<h4 id="rlsTitleContainer">'+releaseData[index].title+'</h4>');
		insertDuffr("rlsTitle",440,54,"#FFFFFF","<h4>"+releaseData[index].title.replace('<br />','<br>')+"</h4>","AvantGardeBookCE");	
		activeRls = index;
	}
}

