// ==============================================================
// make call to text 2 flash
// ==============================================================
function update_text()
	{
//-------------------------------------------------------
// check we have the correct flash version or higher
//-------------------------------------------------------		
	if(checkFlash(6)>=6)
		{
		text_to_flash('page_title', 'dax_regular', '25', '4f5e12',  '000000', '28px', '100%', '');
		text_to_flash('heading_level1', 'dax_regular', '18', '4F5E12', 'CE0000',  '23px', '100%', '');
		text_to_flash('style3', 'helveticaround', '22', '006600', 'FFFFFF',  '28px', '100%', '');
		}
	}


// ==============================================================
// make content url friendly
// ==============================================================
function url_friendly_content(content)
{
var content = content.replace('&','%26');
return content;
}


// ==============================================================
// TXT2FLASH v1.1 (c)2005 RC + CG (http://www.springdigital.co.uk)
// based on:
// FLACCESS v1.3 (c)2004 Sergi Meseguer (http://zigotica.com/)
// Released under Creative Commons ShareAlike license: 
// http://creativecommons.org/licenses/by-sa/2.0/
// Check out http://meddle.dzygn.com/eng/tools/ or 
// http://meddle.dzygn.com/esp/utilidades/ for further info
// ==============================================================
var f_id = 0; 
var swf_file_path = '/images/fonts/';
function text_to_flash(class_name, font, font_size, font_color, link_color, height, width, bgcolor)
{
		
//-------------------------------------------------------
// get all the tags from the document
//-------------------------------------------------------		
var document_tags = new Array();
document_tags[0] = document.getElementsByTagName("div");
document_tags[1] = document.getElementsByTagName("span");
document_tags[2] = document.getElementsByTagName("p");
	 
//-------------------------------------------------------
// step through the tags
//-------------------------------------------------------		
for (i = 0, n=document_tags.length; i<n; i++)
	{
	current_tag = document_tags[i];
	for (x = 0, y=current_tag.length; x<y; x++)
		{
				
//-------------------------------------------------------
// if the current tag is using the class we are looking for
// then set the vars needed and update the innerHTML
//-------------------------------------------------------	
if (current_tag[x].className == class_name)
{
f_id++;			
var flash_id = 'flash_'+f_id;
var font_file = swf_file_path+font+'.swf';

var content = current_tag[x].innerHTML;
var link = current_tag[x].firstChild.href;
var link_content = current_tag[x].firstChild.innerHTML;

if (link) 
	{
	var content = link_content;
	var dlink = '&link='+link+'&link_color='+link_color;
	}
else 
	{
	dlink ='';
	}

var content = url_friendly_content(content);

//current_tag[x].innerHTML = '<textarea><object id="'+flash_id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'"><param name="movie" value="'+font_file+'?namevar='+content+dlink+'&color='+font_color+'&size='+font_size+'"><param name="menu" value="false"><param name="wmode" value="transparent"><embed src="'+font_file+'?namevar='+content+dlink+'&color='+font_color+'&size='+font_size+'" bgcolor="'+bgcolor+'" name="'+flash_id+'" id="name'+flash_id+'" width="'+width+'" height="'+height+'" wmode="transparent" menu="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></textarea>';
current_tag[x].innerHTML = '<object id="'+flash_id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+width+'" height="'+height+'"><param name="movie" value="'+font_file+'?namevar='+content+dlink+'&color='+font_color+'&size='+font_size+'"><param name="menu" value="false"><param name="wmode" value="transparent"><embed src="'+font_file+'?namevar='+content+dlink+'&color='+font_color+'&size='+font_size+'" bgcolor="'+bgcolor+'" name="'+flash_id+'" id="name'+flash_id+'" width="'+width+'" height="'+height+'" wmode="transparent" menu="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
}

		}
	} // end of loop
}


// ==============================================================
// FLASH DETECTOR v1.0 (c)2005 mr.doob (http://www.springdigital.co.ouk)
// based on:
// loop by Geoff Stearns (geoff@deconcept.com, http://blog.deconcept.com/)
// ==============================================================
function checkFlash(min) {
var version = 0;
if(!min) min = 10;

if (navigator.plugins) 
	{ 
	if(navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) 
		{
		var desc = navigator.plugins["Shockwave Flash"].description;
		version = parseInt(desc.substring(16)); 
		}
	else if(navigator.appVersion.indexOf("MSIE")>-1)
		{ 
		result = false;
   		for(var i = min; i >= 3 && result != true; i--)
			{
   			execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
			version = i;
			}
		}
	}
	return version;
}