function fWriteEmailLink(vName,vDomain,vExtension,vText)
{
	if(vText=='')
	{
		vText=vName+'@'+vDomain+'.'+vExtension;
	}
	
	document.write('<a href="mailto:'+vName+'@'+vDomain+'.'+vExtension+'" class="BodyLink">'+vText+'<\/a>');
}


function fWriteEmailLinkIcon(vName,vDomain,vExtension,vIconPath)
{
	document.write('<a href="mailto:'+vName+'@'+vDomain+'.'+vExtension+'"><img src="'+vIconPath+'" border="0" align="baseline"><\/a>');
}


function fWriteHiddenEmailRecipient(vName,vDomain,vExtension)
{
	document.write('<input type="hidden" name="recipient" value="'+vName+'@'+vDomain+'.'+vExtension+'">');
}


function fFixFlashBugInIE()
{
	objects = document.getElementsByTagName( 'object' );
	for ( var i = 0; i < objects.length; i++ )
	{
		objects[i].outerHTML = objects[i].outerHTML;
	}
}


//******************************************************************************
//		These functions are for the news ticker in the footer of the pages
//******************************************************************************

var swap;
var aSwapLinks = new Array();
var vCurrentLinkIndex = 0;

var fadeout;
var fadeup;
var aFadeColors = new Array();
aFadeColors[0] = '#333';
aFadeColors[1] = '#666';
aFadeColors[2] = '#999';
aFadeColors[3] = '#bbb';
aFadeColors[4] = '#ddd';
aFadeColors[5] = '#eee';
aFadeColors[6] = '#fff';
var vCurrentColorIndex = 0;


function fStartTicker()
{
	swap = setInterval( 'fRollTicker()', 5 * 1000 );
}


function fRestartTicker()
{
	swap = setInterval( 'fRollTicker()', 1 * 1000 );
}


function fStopTicker()
{
	clearInterval( swap );
}


function fRollTicker()
{
	clearInterval( swap );
	fadeout = setInterval( 'fFadeOut()', 50 );
}


function fFadeOut()
{
	if( vCurrentColorIndex < aFadeColors.length )
	{
		document.getElementById('news_ticker').style.color = aFadeColors[vCurrentColorIndex];
	}
	
	if( vCurrentColorIndex < aFadeColors.length-1 )
	{
		vCurrentColorIndex += 1;
	}
	else
	{
		clearInterval( fadeout );
		fSwitchText();
	}
}


function fSwitchText()
{
	if( vCurrentLinkIndex < aSwapLinks.length-1 )
	{
		vCurrentLinkIndex += 1;
	}
	else
	{
		vCurrentLinkIndex = 0;
	}
	
	document.getElementById('news_ticker').innerHTML = aSwapLinks[vCurrentLinkIndex];
	
	fadeup = setInterval( 'fFadeUp()', 50 );
}


function fFadeUp()
{
	if( vCurrentColorIndex > 0-1 )
	{
		document.getElementById('news_ticker').style.color = aFadeColors[vCurrentColorIndex];
	}
	
	if( vCurrentColorIndex > 0 )
	{
		vCurrentColorIndex -= 1;
	}
	else
	{
		clearInterval( fadeup );
		fStartTicker();
	}
}


function fWriteFlashMenu()
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="1000" height="750" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="flash/main_site.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="loop" value="false" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="scale" value="noscale" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="flash/main_site.swf" loop="false" menu="false" quality="high" scale="noscale" width="1000" height="750" allowscriptaccess="sameDomain" swliveconnect="true" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle" />');
	document.write('</object>');
	
	//document.write('<param name="salign" value="lt" />');
	//document.write('<param name="bgcolor" value="#ffffff" />');
	//document.write('<embed src="flash/' + vFlashMenu + '.swf' + vFlashVars + '" salign="lt" bgcolor="#ffffff" width="800" height="' + vHeight + '" name="' + vFlashMenu + '" />');
}
