<!--

	//
	// Check for undefined variables and declare defaults for those that have not been set.
	//
	if(typeof(_fxt_ThemeName) == 'undefined' || _fxt_ThemeName == '') { _fxt_ThemeName = 'green'; }
	if(typeof(_fxt_LayoutFormat) == 'undefined') { _fxt_LayoutFormat = ''; }
	if(typeof(_fxt_RefreshFrequency) == 'undefined' || _fxt_RefreshFrequency == '') { _fxt_RefreshFrequency = 60; }
	if(typeof(_fxt_AllowParameters) == 'undefined' || _fxt_AllowParameters == '') { _fxt_AllowParameters = 'a17'; }
	
	//
	// Construct the source URL and the querystring to pass to the page.
	//
	var _lfx_height, _lfx_width;
	var deploymentBase = 'http://webtools.elynchfx.com/';
	var toolPage;
	var qstring = '';	
		
		
	if(typeof(_fxt_Height) != 'undefined')
	{		
		_lfx_height = parseInt(_fxt_Height);
		if(isNaN(_lfx_height))
			_lfx_height = null;
	}		
	
	if(typeof(_fxt_Width) != 'undefined')
	{
		_lfx_width = parseInt(_fxt_Width);
		if(isNaN(_lfx_width))
			_lfx_width = null;
	}
		
	switch(_fxt_ToolType)
	{
		case('CurrencyChart'):
			toolPage = 'tools/showchartview.aspx';
			qstring = qstring + '&bc='+_fxt_BaseCurrency + '&cc=' + _fxt_CounterCurrency + '&d='+_fxt_Timespan;
					
			if(_fxt_LayoutFormat == '' || _fxt_LayoutFormat == 'small')
			{
				_fxt_LayoutFormat = 'small';
				_lfx_height = 484;
				_lfx_width = 305;
			}
			else if(_fxt_LayoutFormat == 'large')
			{
				_lfx_height = 485;
				_lfx_width = 410;
			}
			
			break;
			
		case('SinglePriceWindow'):
			toolPage = 'tools/showspw.aspx';
			qstring = qstring + '&value=' + _fxt_BaseCurrency + 'To' + _fxt_CounterCurrency;
			
			if(_fxt_LayoutFormat == '' || _fxt_LayoutFormat == 'spwtall')
			{
				_fxt_LayoutFormat = 'spwtall';
				_lfx_height = 290;
				_lfx_width = 200;
			}
			else if(_fxt_LayoutFormat == 'spwwide')
			{
				_lfx_height = 195;
				_lfx_width = 315;
			}
		
			break;
			
		case('CurrencyConverter'):
			toolPage = 'tools/showcc.aspx';			
			qstring = qstring + '&bc='+_fxt_BaseCurrency + '&cc=' + _fxt_CounterCurrency;
			
			if(_fxt_LayoutFormat == '' || _fxt_LayoutFormat == 'tall')
			{
				_fxt_LayoutFormat = 'tall';
				_lfx_height = 464;
				_lfx_width = 190;
			}
			else if(_fxt_LayoutFormat == 'medium')
			{
				_lfx_height = 367;
				_lfx_width = 265;
			}
			else if(_fxt_LayoutFormat == 'wide')
			{
				_lfx_height = 284;
				_lfx_width = 426;
			}
			
			break;	
			
		case('CurrencyPriceTable'):
			toolPage = 'tools/currencypricetable.aspx';
			qstring = qstring + '&f='+_fxt_FromCurrency + '&t=' + _fxt_ToCurrencies;
			
			if(_fxt_LayoutFormat == '' || _fxt_LayoutFormat == 'cpttall')
			{
				_fxt_LayoutFormat = 'cpttall';
				_lfx_height = 280;
				_lfx_width = 275;
			}			
			else if(_fxt_LayoutFormat == 'cptwide')
			{
				_lfx_height = 240;
				_lfx_width = 395;
			}
			
			//
			// For each currency above the second currency, we need to add a marginal height.
			//
			var toCurrencies = _fxt_ToCurrencies.split('_');
			if(toCurrencies.length > 1)
			{
				_lfx_height = _lfx_height + ((toCurrencies.length - 1) * 20);
			}
			
			break;	
	}
	
	var qstringPrefix = '?p='+_fxt_PublisherId+'&ct='+_fxt_ThemeName+'&lf='+_fxt_LayoutFormat+
		'&r='+_fxt_RefreshFrequency+'&pa='+_fxt_AllowParameters+'&hostedby='+parent.document.location.host;
	var includeURL = deploymentBase + toolPage + qstringPrefix + qstring;	
	
	//
	// Write the IFRAME.
	//
	document.write('<iframe  name="' + _fxt_ToolType + '_' + Math.floor(Math.random()*100000) + '" src="' + includeURL + '" height="' + _lfx_height + '" width="' + _lfx_width + '" frameborder="0" scrolling="no" allowtransparency="true"></iframe>');
		
		
-->