// creates a small flash containing the requested text
function writeFlashHeadline(text, target, width, color) {
	var so = new SWFObject("/tc/flash/slkscr.swf", "slkscr_swf", width, "7", "8", "");	
	so.addParam("wmode", "transparent");		
	so.addVariable("color", "0x"+color);
	text = text.replace(/&amp;/g, "&"); // &amp; -> & because flash will not decode it
	so.addVariable("txt", escape(text));			
	so.write(target);	
}

/* solution for the click-through-bug when using transparent flash in firefox
	these functions are called inside the flash navigation in the top menu */
function onMenuOpen() {		
	document.getElementById("topmenu").style.height = "400px";
	//alert("open");
	return true;
}

function onMenuClose() {			
	document.getElementById("topmenu").style.height = "35px";	
	//alert("close");	
	return true;
}

// highlight and unhighlight news-list-items 
function highlightMe(div, imgIdx, colorname) {
	div.style.cursor = "pointer";
	div.getElementsByTagName('h2')[0].style.textDecoration = "underline";
	paragraphs = div.getElementsByTagName('p'); 
	for (i=0; i<paragraphs.length; i++) {
		div.getElementsByTagName('p')[i].style.textDecoration = "underline";
	}	
	div.getElementsByTagName('img')[imgIdx].src = '/tc/gfx/more_'+colorname+'_hover.gif';
}

function unhighlightMe(div, imgIdx, colorname) {
	div.style.cursor = "normal";
	div.getElementsByTagName('h2')[0].style.textDecoration = "none";
	for (i=0; i<paragraphs.length; i++) {
		div.getElementsByTagName('p')[i].style.textDecoration = "none";
	}
	div.getElementsByTagName('img')[imgIdx].src = '/tc/gfx/more_'+colorname+'.gif';
}

function toggleHighlightning(element, classname) {	
	element.className = classname;	
}

function changeView(show, hide) {
	document.getElementById(show).style.display = 'block';
	document.getElementById(hide).style.display = 'none';
}
