// VERSION WITHOUT CSS CLASS
function changeTitles(tag,fontSize,fontColor,stageWidth,stageHeight) {
	var arrTags = document.getElementsByTagName(tag);
	for (var i = 0; i < arrTags.length; i++) {
		writeTitle(arrTags[i], arrTags[i].innerHTML,fontSize,fontColor,stageWidth,stageHeight);
	}
}

var swfCounter = 0;
function writeTitle(obj,textContent,fontSize,fontColor,stageWidth,stageHeight) {
	textContent = ajustText(textContent);
	swfCounter++;
	var so = new SWFObject("/images/swf/titleGenerator.swf", "title_" + swfCounter, stageWidth, stageHeight, "3", "#FFFFFF", "", "", "");
	so.addParam("scale", "noscale");
	so.addParam("wmode", "transparent");
	so.addParam("allowScriptAccess", "always");
	so.addParam("swLiveConnect", "true");
	so.addVariable("text_content",textContent);
	so.addVariable("text_size",fontSize);
	so.addVariable("text_color",fontColor);
	so.addVariable("stage_width",stageWidth);
	so.addVariable("stage_height",stageHeight);
	so.write(obj);
}

function ajustText(text) {
	text = text.replace("&amp;","*[e]*");
	text = text.replace ("\"","*[quot]*");	
	text = text.replace ("\"","*[quot]*");		
	return text;
}
