function toggle(id) {

imgid = "img_"+id;
merid = "mer-assoc"+id;
	if(document.getElementById(id).style.display == "block") {
		document.getElementById(id).style.display = "none"
		document.getElementById(imgid).src = "kuling_images/pilned_bunn.gif";
		document.getElementById(merid).innerHTML = "Mer...";
	} else {
		document.getElementById(id).style.display = "block"
		document.getElementById(imgid).src = "kuling_images/pilopp_bunn.gif";
		document.getElementById(merid).innerHTML = "Mindre";
	}
}

function spiller(film) {
	var foo = window.open('','Vindu', 'width=980,height=840,resizable=yes');
	var str = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TRx/xhtml1/DTD/xhtml1-transitional.dtd\">";
	str += "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">";
	str += "<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><title>"+film.toUpperCase()+" i Kuling</title></head><body style=\"background-color: #cccccc\">";
	str += "<div style=\"background-image: url('/portal/kuling_images/blue1.png'); background-repeat: repeat-x; height: 41px; width: 100%; margin-bottom: 2px; color: #fff; font-size: 1.2em; font-weight: bold; padding-left: 4px; padding-top: 4px; font-family: verdana, arial, helvetica, sans_serif;\"><span style=\"text-transform: capitalize;\">"+film+"</span> i Kuling</div>";
	str += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"100%\" height=\"800\" align=\"middle\">"
	str += "<param name=\"movie\" value=\"/portal/filearchive/spiller.swf\" />";
	str += "<param name=\"quality\" value=\"high\" />";
	str += "<param name=\"bgcolor\" value=\"#FFFFFF\" />";
	str += "<param name=\"FlashVars\" value=\"flvsrc="+film+"\" />";
	str += "<embed src=\"/portal/filearchive/spiller.swf\" FlashVars=\"flvsrc="+film+"\" quality=\"high\" bgcolor=\"#cccccc\" width=\"100%\" height=\"800\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>";
	str += "</body></html>"
	foo.document.write(str);
	foo.document.close();
	foo.moveTo(0,0);
	
}

function fixImageUrl(url) {

	var arr = url.split("_");
	return arr[1];
}