﻿/******************* Ajax call function start*************************/

var loadedobjects="";
var rootdomain="http://"+window.location.hostname;

function ajaxpage(url, containerid)
{
	//netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
	//netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
	//netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
	//netscape.security.PrivilegeManager.enablePrivilege("CapabilityPreferencesAccess");

	var page_request = false
	if (window.XMLHttpRequest)//if Mozilla, Safari etc
		page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){//if IE
	try
	{
		page_request = new ActiveXObject("Msxml2.XMLHTTP")
	} 
	catch (e)
	{
		try
		{
			page_request = new ActiveXObject("Microsoft.XMLHTTP")
		}
		catch (e){}
	}
}
else
	return false;
	page_request.onreadystatechange=function()
	{
		loadpage(page_request, containerid)
	}	
	page_request.open('GET', url, true)
	page_request.send(null)
}

function loadpage(page_request, containerid)
{
	if (page_request.readyState=="4" && (page_request.status=="200" || window.location.href.indexOf("http")=="-1"))
	{
		document.getElementById(containerid).innerHTML = page_request.responseText;	
		generateFeed(document.getElementById(containerid));
	}	
}

function loadobjs()
{
	if (!document.getElementById)
		return
	for (i=0; i<arguments.length; i++)
	{
		var file=arguments[i]
		var fileref=""
		if (loadedobjects.indexOf(file)==-1)
		{ //Check to see if this object has not already been added to page before proceeding
			if (file.indexOf(".js")!=-1)
			{ //If object is a js file
				fileref=document.createElement('script')
				fileref.setAttribute("type","text/javascript");
				fileref.setAttribute("src", file);
			}
			else if (file.indexOf(".css")!=-1)
			{ //If object is a css file
				fileref=document.createElement("link")
				fileref.setAttribute("rel", "stylesheet");
				fileref.setAttribute("type", "text/css");
				fileref.setAttribute("href", file);
			}
		}
		if (fileref!="")
		{
			document.getElementsByTagName("head").item(0).appendChild(fileref)
			//loadedobjects+=file+" " //Remember this object as being already added to page
		}
	}
}
/******************* Ajax call function End *************************/

/*FCY Rates starts */
	var numcurrency=11; // Number of currency
	var arrCurrency = new Array();
	var arrTTS = new Array();
	var arrMID = new Array();
	var arrTTB = new Array();
	var fxratedate;
	var arr1month=new Array();
	var arr3month=new Array();
	var arr6month=new Array();
	var arr7month=new Array();
	var arr9month=new Array();
	var arr12month=new Array();
	var enjoyplusrow=false;

	function getElementsByClassName(oElm, strTagName, strClassName)
	{
		var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
		var arrReturnElements = new Array();
		strClassName = strClassName.replace(/\-/g, "\\-");
		var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
		var oElement;
		for(var i=0; i<arrElements.length; i++)
		{
			oElement = arrElements[i];
			if(oRegExp.test(oElement.className))
			{
				arrReturnElements.push(oElement);
			}
		}
		return (arrReturnElements)
	}

	var arrOnemonth=new Array();
	var arrThreemonth=new Array();
	var arrSixmonth=new Array();
	var arrSevenmonth=new Array();
	var arrNinenmonth=new Array();
	var arrTwevelmonth=new Array();
	var arrdisplayedcountry=new Array();

	String.prototype.trim = function () {return this.replace(/^\s*/, "").replace(/\s*$/, "");}

	function generateFeed(obj)
	{
		document.getElementById('divRate').innerHTML = obj.innerHTML;
		var theCurrency = getElementsByClassName(document, "*", "smlcolor3");
		disdate=theCurrency[11].innerHTML;
		for(x=0; x<theCurrency.length-1; x++)
		{			
			if (navigator.appName=="Microsoft Internet Explorer")
				{			
					arrCurrency.push(theCurrency[x].innerHTML);
					arrOnemonth.push(theCurrency[x].nextSibling.innerHTML);
					arrThreemonth.push(theCurrency[x].nextSibling.nextSibling.innerHTML);
					arrSixmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.innerHTML);
					arrSevenmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
					arrNinenmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
					arrTwevelmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
				}
			 else
				{
					arrCurrency.push(theCurrency[x].innerHTML);					
					arrOnemonth.push(theCurrency[x].nextSibling.nextSibling.innerHTML);
					arrThreemonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
					arrSixmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
					arrSevenmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
					arrNinenmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
					arrTwevelmonth.push(theCurrency[x].nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML);
				}
		}
		displayrates(arrCurrency,arrOnemonth,arrThreemonth,arrSixmonth,arrSevenmonth,arrNinenmonth,arrTwevelmonth,disdate);
		return arrCurrency,arrOnemonth,arrThreemonth,arrSixmonth,arrSevenmonth,arrNinenmonth,arrTwevelmonth,disdate;
	}	
	
	var fxratesarray =new Array();
	var tieredarray=new Array();
	tieredarray=[
			['+0.05','+0.05','+0.05','+0.05','+0.05','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['---','---','---','---','---','---'],
			['+0.05','+0.05','+0.05','+0.05','+0.05','+0.05'],
			['---','---','---','---','---','---'],
			['---','---','---','---','---','---'],
			//Added for ZAR and NOK. Added temporary interest rate as +0.05
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05']
			];

	function tiered_status(statusflag)
	{
		if (statusflag==true)
		{ 	document.getElementById('tiered_data').style.display="";
			var rd_tiered=document.getElementsByName("tiered");
			document.getElementById('preferenceerror').style.display='none';
			rd_tiered[0].checked=true;
			tiered_function(1);
		}
		else
		{
			document.getElementById('tiered_data').style.display="none";
			if((document.getElementById('chk_enjoy_status').checked==false)&&(document.getElementById('chk_tiered_status').checked==false))
			{document.getElementById('preferenceerror').style.display='';}
			else{document.getElementById('preferenceerror').style.display='none';}
			tiered_function(4);
		}
	}

	var enjoyplusarray=new Array();
	enjoyplusarray=[['+3.00','+1.00','+0.30','---','---','+0.25'],['+3.00','+1.00','+0.30','---','---','+0.25','fcy_spacer.gif'],
	['+3.00','+1.00','+0.30','---','---','+0.25','fcy_spacer.gif'],
	['+3.00','+1.00','+0.30','---','---','+0.25','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['+3.00','+1.00','+0.30','---','---','+0.25','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
	['+3.00','+1.00','+0.30','---','---','+0.25','fcy_spacer.gif'],
	['---','---','---','---','---','---'],['---','---','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	//Added for ZAR and NOK.
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif']
	];	

	function enjoy_status(statusflag)
	{
		if (statusflag==true)
		{
			document.getElementById('enjoyplus_data').style.display="";
			var rd_tiered=document.getElementsByName("enjouplus");
			document.getElementById('preferenceerror').style.display='none';
			rd_tiered[0].checked=true;
			enjoy_function(1);
		}
		else
		{
			document.getElementById('enjoyplus_data').style.display="none";
			if((document.getElementById('chk_enjoy_status').checked==false)&&(document.getElementById('chk_tiered_status').checked==false))
			{document.getElementById('preferenceerror').style.display='';}
			else{document.getElementById('preferenceerror').style.display='none';}
			enjoy_function(4);
		}
	}	

function enjoy_function(id)
{ var eng_innertext="エンジョイプラス";
	if(id==1)enjoyplusarray=[['+3.00','+1.00','+0.30','---','---','+0.25','fcy_spacer.gif'],['+3.00','+1.00','---','---','---','---','fcy_spacer.gif'],
	['+5.00','+2.00','+1.00','---','---','+0.35','fcy_spacer.gif'],
	['+5.00','+2.00','+1.00','---','---','+0.35','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['+3.00','+1.00','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['+3.00','+1.00','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---'],['---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	//Added for ZAR and NOK.
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif']
	];	

	if(id==2){enjoyplusarray=[['+4.00','+1.50','+0.55','---','---','+0.35'],['+4.00','+1.50','---','---','---','---','fcy_spacer.gif'],
	['+6.00','+2.50','+1.25','---','---','+0.45','fcy_spacer.gif'],
	['+6.00','+2.50','+1.25','---','---','+0.45','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['+4.00','+1.50','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['+4.00','+1.50','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],['---','---','---','---','---','---','fcy_icon_notapplicable1.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif'],
	//Added for ZAR and NOK.
	['---','---','---','---','---','---','fcy_spacer.gif'],
	['---','---','---','---','---','---','fcy_spacer.gif']
	];eng_innertext="エンジョイプラスゴールド ";
}
	var tbody = document.getElementById('ratestable_enjoyplus').getElementsByTagName('tbody')[0]; 
	var tierrows=tbody.getElementsByTagName('tr');
		for(x=1; x<numcurrency+1; x++)
		{
			var tiercells=(tierrows[(4*x)-2].nextSibling.nextSibling.getElementsByTagName('td'));			
			tiercells[1].innerHTML=eng_innertext;
			tiercells[2].innerHTML="<div class='fcy_alignrght'>"+enjoyplusarray[x][0]+"<div>";
			tiercells[3].innerHTML="<div class='fcy_alignrght'>"+enjoyplusarray[x][1]+"<div>";
			tiercells[4].innerHTML="<div class='fcy_alignrght'>"+enjoyplusarray[x][2]+"<div>";
			tiercells[5].innerHTML="<div class='fcy_alignrght'>"+enjoyplusarray[x][3]+"<div>";
			tiercells[6].innerHTML="<div class='fcy_alignrght'>"+enjoyplusarray[x][4]+"<div>";
			tiercells[7].innerHTML="<div class='fcy_alignrght'>"+enjoyplusarray[x][5]+"<div>";
			if(id==4){if(tierrows[4 * x])tierrows[4 * x].style.display="none";}			
			else{if(tierrows[4 * x])tierrows[4 * x].style.display="";}
		}
		calculate();
	}

	function tiered_function(id)
	{
		var tbody = document.getElementById('ratestable_enjoyplus').getElementsByTagName('tbody')[0]; 
		var tierrows=tbody.getElementsByTagName('tr');
		if(id==1){tieredarray=[
			['+0.05','+0.05','+0.05','+0.05','+0.05','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['---','---','---','---','---','---'],
			['+0.05','+0.05','+0.05','+0.05','+0.05','+0.05'],
			['---','---','---','---','---','---'],
			['---','---','---','---','---','---'],
			//Added for ZAR and NOK.. Added temporary interest rate as +0.05
			['+0.05','+0.05','+0.05','---','---','+0.05'],
			['+0.05','+0.05','+0.05','---','---','+0.05']
			];}
		if(id==2){tieredarray=[
			['+0.10','+0.10','+0.10','+0.10','+0.10','+0.10'],
			['+0.10','+0.10','+0.10','---','---','+0.10'],
			['+0.10','+0.10','+0.10','---','---','+0.10'],
			['+0.10','+0.10','+0.10','---','---','+0.10'],
			['+0.10','+0.10','+0.10','---','---','+0.10'],
			['---','---','---','---','---','---'],
			['+0.10','+0.10','+0.10','+0.10','+0.10','+0.10'],
			['---','---','---','---','---','---'],
			['---','---','---','---','---','---'],
			//Added for ZAR and NOK.. Added temporary interest rate as +0.01
			['+0.10','+0.10','+0.10','---','---','+0.10'],
			['+0.10','+0.10','+0.10','---','---','+0.10']
			];}
		for(x=1; x<12; x++)
		{
			if (navigator.appName=="Microsoft Internet Explorer")
				{var tiercells=(tierrows[(4*x)-3].nextSibling.nextSibling.getElementsByTagName('td'));}
			else
				{
					if(x==1){var tiercells=(tierrows[1].nextSibling.nextSibling.nextSibling.getElementsByTagName('td'));}
					else{var tiercells=(tierrows[4*(x-1)].nextSibling.nextSibling.nextSibling.getElementsByTagName('td'));}
				}
			tiercells[2].innerHTML = "<div class='fcy_alignrght'>"+tieredarray[x-1][0]+"</div>";			
			tiercells[3].innerHTML = "<div class='fcy_alignrght'>"+tieredarray[x-1][1]+"</div>";
			tiercells[4].innerHTML = "<div class='fcy_alignrght'>"+tieredarray[x-1][2]+"</div>";
			tiercells[5].innerHTML = "<div class='fcy_alignrght'>"+tieredarray[x-1][3]+"</div>";
			tiercells[6].innerHTML = "<div class='fcy_alignrght'>"+tieredarray[x-1][4]+"</div>";
			tiercells[7].innerHTML = "<div class='fcy_alignrght'>"+tieredarray[x-1][5]+"</div>";

			if(id==4){tierrows[(4*x)-1].style.display="none";}
			else{
					tierrows[(4*x)-1].style.display="none";
					tierrows[(4*x)+1].style.display="none";
					if(tierrows[(4*x)-2].style.display==""){tierrows[(4*x)-1].style.display="";tierrows[(4*x)+1].style.display="";}
				}			
		}
		calculate();
	}

	function calculate()
	{
		var tbody1 = document.getElementById('ratestable_enjoyplus').getElementsByTagName('tbody')[0]; 
		var tierrows=tbody1.getElementsByTagName('tr');
		var a,b,c;;
		var sumdetails=0;
		for(x=1; x<12; x++)
		{
			var tiercells=(tierrows[(4 *x)].nextSibling.getElementsByTagName('td'));	
			if((document.getElementById('chk_enjoy_status').checked==false)&&(document.getElementById('chk_tiered_status').checked==false))
			{
				tierrows[(4*x)+1].style.display="none";	
			}
			else if((document.getElementById('chk_enjoy_status').checked==true)&&(document.getElementById('chk_tiered_status').checked==false))
			{
				// If only ENJOY PLUS is checked
				//tierrows[(4*x)+1].style.display="";	
				for(j=0;j<6;j++)
				{
					a=parseFloat(fxratesarray[x-1][3+j]);
					if(isNaN(a)){a=0;}
					b=parseFloat(enjoyplusarray[x][j]);
					if(isNaN(b)){b=0;}
					sumdetails=(a+b).toFixed(2);					
					if(a==0)
					{tiercells[j+2].innerHTML = "<div class='fcy_alignrght'>---</div>";}
					else{tiercells[j+2].innerHTML = "<div class='fcy_alignrght'>"+sumdetails+"</div>";}					
				}
				tierrows[(4*x)+1].style.display="";
				if(tierrows[(4*x)-2].style.display=="none"){tierrows[(4*x)+1].style.display="none";tierrows[(4*x)].style.display="none";}				
			}

			else if((document.getElementById('chk_enjoy_status').checked==false)&&(document.getElementById('chk_tiered_status').checked==true))
			{
				// If only tiered is checked
				for(j=0;j<6;j++)
				{
					a=parseFloat(fxratesarray[x-1][3+j]);
					if(isNaN(a)){a=0;}
					b=parseFloat(tieredarray[x-1]);
					if(isNaN(b)){b=0;}
					sumdetails=(a+b).toFixed(2);
					if(a==0)
					{tiercells[j+2].innerHTML = "<div class='fcy_alignrght'>---</div>";}
					else{tiercells[j+2].innerHTML = "<div class='fcy_alignrght'>"+sumdetails+"</div>";}
				}
				tierrows[(4*x)+1].style.display="";
				if(tierrows[(4*x)-2].style.display=="none"){tierrows[(4*x)+1].style.display="none";}
			}

			else if((document.getElementById('chk_enjoy_status').checked==true)&&(document.getElementById('chk_tiered_status').checked==true))
			{
				// If both is checked
				//tierrows[(4*x)+1].style.display="";	
				
			for(j=0;j<6;j++)
				{
					a=parseFloat(fxratesarray[x-1][3+j]);
					if(isNaN(a)){a=0;}
					b=parseFloat(tieredarray[x-1]);
					if(isNaN(b)){b=0;}
					c=parseFloat(enjoyplusarray[x][j]);
					if(isNaN(c)){c=0;}
					sumdetails=(a+b+c).toFixed(2);
					if(a==0)
					{tiercells[j+2].innerHTML = "<div class='fcy_alignrght'>---</div>";}
					else{tiercells[j+2].innerHTML = "<div class='fcy_alignrght'>"+sumdetails+"</div>";}
				}
				tierrows[(4*x)+1].style.display="";
				if(tierrows[(4*x)-2].style.display=="none"){tierrows[(4*x)+1].style.display="none";tierrows[(4*x)].style.display="none";}
			}

			else
			{
				tierrows[(4*x)+1].style.display="none";
				if(tierrows[(4*x)-2].style.display==""){tierrows[(4*x)+1].style.display="";}
				//tierrows[(4*x)+1].style.display="";
			}
		}
	}

	function displayrates(curr,one,three,six,seven,nine,twevel,disdate)
	{		
		var stratind,endind;
		var countryflag;
		var tbody = document.getElementById('ratestable').getElementsByTagName('tbody')[0]; 
		var tbodyenjoyplus = document.getElementById('ratestable_enjoyplus').getElementsByTagName('tbody')[0]; 
		if(fxratesarray.length>1)
		{
			var tierrows=tbodyenjoyplus.getElementsByTagName('tr');	
			if(checkedcurrency.length>0)
			{
				for(m=0;m<checkedcurrency.length;m++)
				{	document.getElementById('countryrow'+checkedcurrency[m]).style.display='';
					tiered_status(document.getElementById('chk_tiered_status').checked);
					enjoy_status(document.getElementById('chk_enjoy_status').checked);
					arrdisplayedcountry.push('countryrow'+checkedcurrency[m]);
					//document.getElementById('tieredrow'+checkedcurrency[m]).style.display='';
					//document.getElementById('enjoyrow'+checkedcurrency[m]).style.display='';
					//document.getElementById('totaldisplayrow'+checkedcurrency[m]).style.display='';									
				}
			}
			if(uncheckedcurrency.length>0)
			{
				for(k=0;k<uncheckedcurrency.length;k++)
				{	document.getElementById('countryrow'+uncheckedcurrency[k]).style.display='none';
					document.getElementById('tieredrow'+uncheckedcurrency[k]).style.display='none';
					document.getElementById('enjoyrow'+uncheckedcurrency[k]).style.display='none';
					document.getElementById('totaldisplayrow'+uncheckedcurrency[k]).style.display='none';					
				}
			}
			
			for (k=0;k<arrdisplayedcountry.length;k++)
			{
				var rowid=arrdisplayedcountry[k].charAt(arrdisplayedcountry[k].length-1);
				var countryrow=document.getElementById('countryrow'+rowid).className="fcy_bluetblalternaterow";
				var enjoyrow=document.getElementById('enjoyrow'+rowid).className="fcy_bluetblalternaterow";
				var tiredrow=document.getElementById('tieredrow'+rowid).className="fcy_bluetblalternaterow";
				var totalrow=document.getElementById('totaldisplayrow'+rowid).className="fcy_bluetblalternaterow";
				if(k % 2 ==0)
				{
					countryrow=document.getElementById('countryrow'+rowid).className="fcy_bluetblalternatewhiterow";
					enjoyrow=document.getElementById('enjoyrow'+rowid).className="fcy_bluetblalternatewhiterow";
					tiredrow=document.getElementById('tieredrow'+rowid).className="fcy_bluetblalternatewhiterow";
					totalrow=document.getElementById('totaldisplayrow'+rowid).className="fcy_bluetblalternatewhiterow";
				}
			}
			checkedcurrency.length = 0;uncheckedcurrency.length = 0;
			
			return false;
		}
		else{
				for (i=0;i<numcurrency;i++)
				{
						countryflag='fcy_flag_.gif';
						country='US';
						fxratesarray[i]=[countryflag,country,curr[i].trim(),one[i].trim(),three[i].trim(),six[i].trim(),seven[i].trim(),nine[i].trim(),twevel[i].trim()];
				}	
				document.getElementById('displayfxratedate').innerHTML=disdate.trim();
	
				var enjoyplusarray=[['fcy_flag_USD.gif','US','エンジョイプラス','+3.00','+1.00','---','---','---','---','fcy_spacer.gif'],
				  ['fcy_flag_AUD.gif','Australia','エンジョイプラス','+5.00','+2.00','+1.00','---','---','+0.35','fcy_spacer.gif'],
				  ['fcy_flag_NZD.gif','New Zealand','エンジョイプラス','+5.00','+2.00','+1.00','---','---','+0.35','fcy_spacer.gif'],
				  ['fcy_flag_GBP.gif','UK','エンジョイプラス','---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
				  ['fcy_flag_CAD.gif','Canada','エンジョイプラス','+3.00','+1.00','---','---','---','---','fcy_spacer.gif'],
				  ['fcy_flag_CHF.gif','Swiss','エンジョイプラス','---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
				  ['fcy_flag_EUR.gif','Euro','エンジョイプラス','+3.00','+1.00','---','---','---','---','fcy_spacer.gif'],
				  ['fcy_flag_HKD.gif','Hong Kong','エンジョイプラス','---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
				  ['fcy_flag_THB.gif','Thai','エンジョイプラス','---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
				   //Added for ZAR and NOK. 
				  ['fcy_flag_ZAR.gif','ZAR','エンジョイプラス','---','---','---','---','---','---','fcy_icon_notapplicable.gif'],
				  ['fcy_flag_NOK.gif','NOK','エンジョイプラス','---','---','---','---','---','---','fcy_icon_notapplicable.gif']
				  ];

	for (i=0;i<fxratesarray.length;i++)
	{
		var row = document.createElement('TR'); 
		var rowenjoyplus = document.createElement('TR'); 
		var row_tieredarray = document.createElement('TR'); 
		var row_enjoyplus = document.createElement('TR'); 
		var row_Preferentialtotal = document.createElement('TR'); 

		row.setAttribute("className","fcy_bluetblalternaterow");
		row.setAttribute("class","fcy_bluetblalternaterow");

		rowenjoyplus.setAttribute("className","fcy_bluetblalternaterow");
		rowenjoyplus.setAttribute("class","fcy_bluetblalternaterow");
		rowenjoyplus.setAttribute("id","countryrow"+i);

		row_tieredarray.setAttribute("className","fcy_bluetblalternaterow");
		row_tieredarray.setAttribute("class","fcy_bluetblalternaterow");
		row_tieredarray.setAttribute("id","tieredrow"+i);
		
		row_enjoyplus.setAttribute("className","fcy_bluetblalternaterow");
		row_enjoyplus.setAttribute("class","fcy_bluetblalternaterow");
		row_enjoyplus.setAttribute("id","enjoyrow"+i);

		row_Preferentialtotal.setAttribute("class","fcy_bluetblalternaterow");
		row_Preferentialtotal.setAttribute("className","fcy_bluetblalternaterow");
		row_Preferentialtotal.setAttribute("id","totaldisplayrow"+i);

		var cell1 = document.createElement('TD');
		var cell2 = document.createElement('TD'); 
		var cell3 = document.createElement('TD'); 
		var cell4 = document.createElement('TD');
		var cell5 = document.createElement('TD'); 
		var cell6 = document.createElement('TD'); 
		var cell7 = document.createElement('TD'); 
		var cell8 = document.createElement('TD'); 
		var cell9 = document.createElement('TD'); 

		var rowenjoypluscell1 = document.createElement('TD');
		var rowenjoypluscell2 = document.createElement('TD'); 
		var rowenjoypluscell3 = document.createElement('TD'); 
		var rowenjoypluscell4 = document.createElement('TD');
		var rowenjoypluscell5 = document.createElement('TD'); 
		var rowenjoypluscell6 = document.createElement('TD'); 
		var rowenjoypluscell7 = document.createElement('TD'); 
		var rowenjoypluscell8 = document.createElement('TD'); 
		var rowenjoypluscell9 = document.createElement('TD'); 

		var tiereds_cell1 = document.createElement('TD'); 
		var tiereds_cell2 = document.createElement('TD'); 
		var tiereds_cell3 = document.createElement('TD'); 
		var tiereds_cell4 = document.createElement('TD'); 
		var tiereds_cell5 = document.createElement('TD'); 
		var tiereds_cell6 = document.createElement('TD'); 
		var tiereds_cell7 = document.createElement('TD'); 
		var tiereds_cell8 = document.createElement('TD'); 
		var tiereds_cell9 = document.createElement('TD'); 
		var tiereds_cell10 = document.createElement('TD'); 

		var enjoyplus_cell1 = document.createElement('TD'); 
		var enjoyplus_cell2 = document.createElement('TD'); 
		var enjoyplus_cell3 = document.createElement('TD'); 
		var enjoyplus_cell4 = document.createElement('TD'); 
		var enjoyplus_cell5 = document.createElement('TD'); 
		var enjoyplus_cell6 = document.createElement('TD'); 
		var enjoyplus_cell7 = document.createElement('TD'); 
		var enjoyplus_cell8 = document.createElement('TD'); 
		var enjoyplus_cell9 = document.createElement('TD'); 
		var enjoyplus_cell10 = document.createElement('TD');

		var preftotal_cell1 = document.createElement('TD'); 
		var preftotal_cell2 = document.createElement('TD'); 
		var preftotal_cell3 = document.createElement('TD'); 
		var preftotal_cell4 = document.createElement('TD'); 
		var preftotal_cell5 = document.createElement('TD'); 
		var preftotal_cell6 = document.createElement('TD'); 
		var preftotal_cell7 = document.createElement('TD'); 
		var preftotal_cell8 = document.createElement('TD'); 
		var preftotal_cell9 = document.createElement('TD'); 
		var preftotal_cell10 = document.createElement('TD'); 

		cell1.setAttribute("class","fcy_bluetblbdrlft");
		cell1.setAttribute("className","fcy_bluetblbdrlft");
		cell1.innerHTML ="&nbsp;";
		
		cell2.setAttribute("class","fcy_bluetblbdrrgt fcy_pdtp5");
		cell2.setAttribute("className","fcy_bluetblbdrrgt fcy_pdtp5");
		cell2.innerHTML = "<div class='fcy_floatlft fcy_pdlftrght10'><img src='/ja/img/fcy/"+enjoyplusarray[i][0]+"' alt='"+fxratesarray[i][2]+"' title='"+fxratesarray[i][2]+"' border='0' class='fcy_flagpadding'></div><div class='fcy_floatlft fcy_normaltext'>"+fxratesarray[i][2]+"</div>";

		cell3.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell3.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell3.innerHTML ="<div style='padding-bottom:0'>"+fxratesarray[i][3].trim()+"</div>";
		
		cell4.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell4.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell4.innerHTML ="<div style='padding-bottom:0'>"+fxratesarray[i][4].trim()+"</div>";

		cell5.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell5.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell5.innerHTML ="<div style='padding-bottom:0'>"+fxratesarray[i][5].trim()+"</div>";

		cell6.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell6.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell6.innerHTML ="<div style='padding-bottom:0'>"+fxratesarray[i][6].trim()+"</div>";

		cell7.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell7.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data");
		cell7.innerHTML ="<div style='padding-bottom:0'>"+fxratesarray[i][7].trim()+"</div>";

		cell8.setAttribute("class","fcy_greytbl_data");
		cell8.setAttribute("className","fcy_greytbl_data");
		cell8.innerHTML ="<div style='padding-bottom:0'>"+fxratesarray[i][8].trim()+"</div>";

		cell9.setAttribute("class","fcy_bluetblbdrrgt");
		cell9.setAttribute("className","fcy_bluetblbdrrgt");
		cell9.innerHTML = "&nbsp;";	
		
		rowenjoypluscell1.setAttribute("class","fcy_bluetblbdrlft");
		rowenjoypluscell1.setAttribute("className","fcy_bluetblbdrlft");
		rowenjoypluscell1.innerHTML ="&nbsp;";
		
		rowenjoypluscell2.setAttribute("class","fcy_bluetblbdrrgt fcy_pdtp5");
		rowenjoypluscell2.setAttribute("className","fcy_bluetblbdrrgt fcy_pdtp5");
		rowenjoypluscell2.innerHTML = "<div class='fcy_floatlft fcy_pdrght10 fcy_pdlft15'><img src='/ja/img/fcy/"+enjoyplusarray[i][0]+"' alt='"+fxratesarray[i][2]+"' title='"+fxratesarray[i][2]+"' border='0' class='fcy_flagpadding'></div><div class='fcy_floatlft fcy_normaltext'>"+fxratesarray[i][2]+"</div>";

		rowenjoypluscell3.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell3.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell3.innerHTML =fxratesarray[i][3].trim();
		
		rowenjoypluscell4.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell4.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell4.innerHTML =fxratesarray[i][4].trim();

		rowenjoypluscell5.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell5.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell5.innerHTML = fxratesarray[i][5].trim();

		rowenjoypluscell6.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell6.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell6.innerHTML = fxratesarray[i][6].trim();

		rowenjoypluscell7.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell7.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		rowenjoypluscell7.innerHTML = fxratesarray[i][7].trim();
		
		rowenjoypluscell8.setAttribute("class","fcy_greytbl_data1");
		rowenjoypluscell8.setAttribute("className","fcy_greytbl_data1");
		rowenjoypluscell8.innerHTML = fxratesarray[i][8].trim();
		
		rowenjoypluscell9.setAttribute("class","fcy_bluetblbdrrgt");
		rowenjoypluscell9.setAttribute("className","fcy_bluetblbdrrgt");
		rowenjoypluscell9.innerHTML = "&nbsp;";		

		row.appendChild(cell1); 
		row.appendChild(cell2); 
		row.appendChild(cell3);
		row.appendChild(cell4);
		row.appendChild(cell5);
		row.appendChild(cell6);
		row.appendChild(cell7);
		row.appendChild(cell8);
		row.appendChild(cell9);

		rowenjoyplus.appendChild(rowenjoypluscell1); 
		rowenjoyplus.appendChild(rowenjoypluscell2); 
		rowenjoyplus.appendChild(rowenjoypluscell3);
		rowenjoyplus.appendChild(rowenjoypluscell4);
		rowenjoyplus.appendChild(rowenjoypluscell5);
		rowenjoyplus.appendChild(rowenjoypluscell6);
		rowenjoyplus.appendChild(rowenjoypluscell7);
		rowenjoyplus.appendChild(rowenjoypluscell8);
		rowenjoyplus.appendChild(rowenjoypluscell9);		
       
		if(i % 2 ==0)
		{ row.setAttribute("class","fcy_bluetblalternatewhiterow");
		  row.setAttribute("className","fcy_bluetblalternatewhiterow");
		  rowenjoyplus.setAttribute("class","fcy_bluetblalternatewhiterow");
		  rowenjoyplus.setAttribute("className","fcy_bluetblalternatewhiterow");

		  row_tieredarray.setAttribute("className","fcy_bluetblalternatewhiterow");
		  row_tieredarray.setAttribute("class","fcy_bluetblalternatewhiterow");
		  row_enjoyplus.setAttribute("class","fcy_bluetblalternatewhiterow");
		  row_enjoyplus.setAttribute("className","fcy_bluetblalternatewhiterow");
		  row_Preferentialtotal.setAttribute("class","fcy_bluetblalternatewhiterow");
		  row_Preferentialtotal.setAttribute("className","fcy_bluetblalternatewhiterow");
		}		
		
		tiereds_cell1.setAttribute("class","fcy_bluetblbdrlft");
		tiereds_cell1.setAttribute("className","fcy_bluetblbdrlft");
		tiereds_cell1.innerHTML = "&nbsp;";

		tiereds_cell2.setAttribute("class","fcy_bluetblbdrlft");
		tiereds_cell2.setAttribute("className","fcy_bluetblbdrlft");
		tiereds_cell2.innerHTML = "&nbsp;";

		tiereds_cell3.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data2 fcy_pdtp05");
		tiereds_cell3.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data2 fcy_pdtp05");
		if(tieredarray[i]=="---"){tiereds_cell3.innerHTML = "<div style='padding-top:3px;'>お預入れ金額による上乗せ金利 <img src='/ja/img/fcy/fcy_icon_notapplicable.gif' title='適用不可' alt='適用不可'></div>";}
		else{tiereds_cell3.innerHTML = "<div style='padding-top:3px;'>お預入れ金額による上乗せ金利</div>";}		

		tiereds_cell4.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell4.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell4.innerHTML =tieredarray[0][i];

		tiereds_cell5.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell5.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell5.innerHTML =tieredarray[1][i];

		tiereds_cell6.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell6.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell6.innerHTML =tieredarray[2][i];
	
		tiereds_cell7.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell7.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell7.innerHTML =tieredarray[3][i];

		tiereds_cell8.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell8.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data1");
		tiereds_cell8.innerHTML =tieredarray[4][i];

		tiereds_cell9.setAttribute("class","fcy_greytbl_data1");
		tiereds_cell9.setAttribute("className","fcy_greytbl_data1");
		tiereds_cell9.innerHTML =tieredarray[5][i];

		tiereds_cell10.setAttribute("class","fcy_bluetblbdrrgt");
		tiereds_cell10.setAttribute("className","fcy_bluetblbdrrgt");
		tiereds_cell10.innerHTML = "&nbsp;";	

		preftotal_cell1.setAttribute("class","fcy_bluetblbdrlft");
		preftotal_cell1.setAttribute("className","fcy_bluetblbdrlft");
		preftotal_cell1.innerHTML = "&nbsp;";

		preftotal_cell2.setAttribute("class","fcy_bluetblbdrlft");
		preftotal_cell2.setAttribute("className","fcy_bluetblbdrlft");
		preftotal_cell2.innerHTML = "&nbsp;";

		preftotal_cell3.setAttribute("class","fcy_bluetblprefcellpadding fcy_bluetblbdrrgt");
		preftotal_cell3.setAttribute("className","fcy_bluetblprefcellpadding fcy_bluetblbdrrgt");
		preftotal_cell3.innerHTML = "合計金利";

		preftotal_cell4.setAttribute("class","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell4.setAttribute("className","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell4.setAttribute("align","right");
		preftotal_cell4.innerHTML ="<div class='fcy_alignrght'>"+tieredarray[0][0]+"<div>";
		
		preftotal_cell5.setAttribute("class","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell5.setAttribute("className","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell5.setAttribute("align","right");
		preftotal_cell5.innerHTML ="<div class='fcy_alignrght'>"+tieredarray[0][0]+"<div>";

		preftotal_cell6.setAttribute("class","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell6.setAttribute("className","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell6.setAttribute("align","right");
		preftotal_cell6.innerHTML ="<div class='fcy_alignrght'>"+tieredarray[0][0]+"<div>";
		
		preftotal_cell7.setAttribute("class","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell7.setAttribute("className","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell7.setAttribute("align","right");
		preftotal_cell7.innerHTML ="<div class='fcy_alignrght'>"+tieredarray[0][0]+"<div>";

		preftotal_cell8.setAttribute("class","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell8.setAttribute("className","fcy_bluetblbdrrgt fcy_bluetblprefcellpaddingtxt");
		preftotal_cell8.setAttribute("align","right");
		preftotal_cell8.innerHTML ="<div class='fcy_alignrght'>"+tieredarray[0][0]+"<div>";
		
		preftotal_cell9.setAttribute("class","fcy_bluetblprefcellpaddingtxt");
		preftotal_cell9.setAttribute("className","fcy_bluetblprefcellpaddingtxt");
		preftotal_cell9.setAttribute("align","right");
		preftotal_cell9.innerHTML ="<div class='fcy_alignrght'>"+tieredarray[0][0]+"<div>";

		preftotal_cell10.setAttribute("class","fcy_bluetblbdrrgt");
		preftotal_cell10.setAttribute("className","fcy_bluetblbdrrgt");
		preftotal_cell10.innerHTML = "&nbsp;";

		row_tieredarray.appendChild(tiereds_cell2);
		row_tieredarray.appendChild(tiereds_cell2);
		row_tieredarray.appendChild(tiereds_cell3);
		row_tieredarray.appendChild(tiereds_cell4);
		row_tieredarray.appendChild(tiereds_cell5);
		row_tieredarray.appendChild(tiereds_cell6);
		row_tieredarray.appendChild(tiereds_cell7);
		row_tieredarray.appendChild(tiereds_cell8);
		row_tieredarray.appendChild(tiereds_cell9);
		row_tieredarray.appendChild(tiereds_cell10);

		enjoyplus_cell1.setAttribute("class","fcy_bluetblbdrlft");
		enjoyplus_cell1.setAttribute("className","fcy_bluetblbdrlft");
		enjoyplus_cell1.innerHTML = "&nbsp;";

		enjoyplus_cell2.setAttribute("class","fcy_bluetblbdrlft");
		enjoyplus_cell2.setAttribute("className","fcy_bluetblbdrlft");
		enjoyplus_cell2.innerHTML = "&nbsp;";

		enjoyplus_cell3.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data2 ");
		enjoyplus_cell3.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data2");
		enjoyplus_cell3.innerHTML = "<div style='padding-top:0px;*padding-top:3px;'>エンジョイプラス <img src='/ja/img/fcy/" + enjoyplusarray[i][9]+ "'></div>";

		enjoyplus_cell4.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell4.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell4.innerHTML =enjoyplusarray[i][3];

		enjoyplus_cell5.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell5.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell5.innerHTML =enjoyplusarray[i][4];

		enjoyplus_cell6.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell6.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell6.innerHTML =enjoyplusarray[i][5];
		
		enjoyplus_cell7.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell7.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell7.innerHTML =enjoyplusarray[i][6];

		enjoyplus_cell8.setAttribute("class","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell8.setAttribute("className","fcy_bluetblbdrrgt fcy_greytbl_data3");
		enjoyplus_cell8.innerHTML =enjoyplusarray[i][7];
		
		enjoyplus_cell9.setAttribute("class","fcy_greytbl_data3");
		enjoyplus_cell9.setAttribute("className","fcy_greytbl_data3");
		enjoyplus_cell9.innerHTML =enjoyplusarray[i][8];
		enjoyplus_cell10.setAttribute("class","fcy_bluetblbdrrgt");
		enjoyplus_cell10.setAttribute("className","fcy_bluetblbdrrgt");
		enjoyplus_cell10.innerHTML = "&nbsp;";		
		
		row_enjoyplus.appendChild(enjoyplus_cell2);
		row_enjoyplus.appendChild(enjoyplus_cell2);
		row_enjoyplus.appendChild(enjoyplus_cell3);
		row_enjoyplus.appendChild(enjoyplus_cell4);
		row_enjoyplus.appendChild(enjoyplus_cell5);
		row_enjoyplus.appendChild(enjoyplus_cell6);
		row_enjoyplus.appendChild(enjoyplus_cell7);
		row_enjoyplus.appendChild(enjoyplus_cell8);
		row_enjoyplus.appendChild(enjoyplus_cell9);
		row_enjoyplus.appendChild(enjoyplus_cell10);

		row_Preferentialtotal.appendChild(preftotal_cell2);
		row_Preferentialtotal.appendChild(preftotal_cell2);
		row_Preferentialtotal.appendChild(preftotal_cell3);
		row_Preferentialtotal.appendChild(preftotal_cell4);
		row_Preferentialtotal.appendChild(preftotal_cell5);
		row_Preferentialtotal.appendChild(preftotal_cell6);
		row_Preferentialtotal.appendChild(preftotal_cell7);
		row_Preferentialtotal.appendChild(preftotal_cell8);
		row_Preferentialtotal.appendChild(preftotal_cell9);
		row_Preferentialtotal.appendChild(preftotal_cell10);

		tbody.appendChild(row); 

		tbodyenjoyplus.appendChild(rowenjoyplus); 
		tbodyenjoyplus.appendChild(row_tieredarray);
		tbodyenjoyplus.appendChild(row_enjoyplus); 
		tbodyenjoyplus.appendChild(row_Preferentialtotal);		
	}
	}
}

function currency_change(currency_option)
{
	if(currency_option=="Foregin-Foregin")
	{
		document.getElementById('chk_enjoy_status').checked=false;
		document.getElementById('chk_enjoy_status').disabled=true;
		document.getElementById('chk_tiered_status').checked=true;
		tiered_status(true);enjoy_status(false);
		document.getElementById('enjoypluserror').style.display='';
	}
	else {
			document.getElementById('chk_enjoy_status').checked=true;
			document.getElementById('chk_enjoy_status').disabled=false;			
			enjoy_status(true);
			document.getElementById('enjoypluserror').style.display='none';
		}
}

function toggletabs(onTab,offTab)
{
	if(onTab=='basic')
	{
		document.basicimg.src='/ja/img/fcy/fcy_tab_basicintrates_on.gif';
		document.earnmoreimg.src='/ja/img/fcy/fcy_tab_earnmore_off.gif';
		document.getElementById('basictxt1').style.display='';
		document.getElementById('eearnmoretxt1').style.display='none';
		document.getElementById('eearnmoretxt2').style.display='none';
		document.getElementById('eearnmoretxt3').style.display='none';
		enjoyplusrow=false;
		document.getElementById('ratestable_enjoyplus').style.display='none';
		document.getElementById('ratestable').style.display='';
		document.getElementById('preferenceerror').style.display='none';		
	}
	else
	{
		document.basicimg.src='/ja/img/fcy/fcy_tab_basicintrates_off.gif';
		document.earnmoreimg.src='/ja/img/fcy/fcy_tab_earnmore_on.gif';		
		document.getElementById('basictxt1').style.display='none';
		document.getElementById('eearnmoretxt1').style.display='';
		document.getElementById('eearnmoretxt2').style.display='';
		document.getElementById('eearnmoretxt3').style.display='';
		enjoyplusrow=true;
		document.getElementById('ratestable').style.display='none';
		document.getElementById('ratestable_enjoyplus').style.display='';
		tiered_status(false);
		currency_change(document.getElementById('select_currency').value);
		tiered_status(document.getElementById('chk_tiered_status').checked);
		enjoy_status(document.getElementById('chk_enjoy_status').checked);
	}
}
var uncheckedcurrency = new Array();
var checkedcurrency = new Array();

function selectcurrency()
{
	var DivRef = document.getElementById('div');
	var chk = document.getElementById('ratecountrytable').getElementsByTagName('input');
	for(j=0;j<chk.length;j++)
	{
		if(chk[j].checked==false)
		uncheckedcurrency.push(j);
		else
			checkedcurrency.push(j);
	}
	displayrates();
	DivRef.style.display = "none";
//	
}

var ratecountrytableflag=false;
function ShowDiv(divid, state,event)
{
	var DivRef = document.getElementById(divid);
	if(ratecountrytableflag==false)
	{
		var countryarray=[['fcy_flag_USD.gif','US','エンジョイプラス'],['fcy_flag_AUD.gif','Australia','エンジョイプラス'],
				  ['fcy_flag_NZD.gif','New Zealand','エンジョイプラス'],['fcy_flag_GBP.gif','UK','エンジョイプラス'],
				  ['fcy_flag_CAD.gif','Canada','エンジョイプラス'], ['fcy_flag_CHF.gif','Swiss','エンジョイプラス'],
				  ['fcy_flag_EUR.gif','Euro','エンジョイプラス'],
				  ['fcy_flag_HKD.gif','Hong Kong','エンジョイプラス'],
				  ['fcy_flag_THB.gif','Thai','エンジョイプラス'],
				  //Added for ZAR and NOK.
				  ['fcy_flag_ZAR.gif','ZAR','エンジョイプラス'],
				  ['fcy_flag_NOK.gif','NOK','エンジョイプラス']
				  ];
		var tbody = document.getElementById('ratecountrytable').getElementsByTagName('tbody')[0];
		for (i=0;i<fxratesarray.length;i++)
		{
			var row = document.createElement('TR'); 
			var cell1 = document.createElement('TD');
			var cell2 = document.createElement('TD'); 
			var cell3 = document.createElement('TD'); 
			
			cell1.innerHTML ="<input type='checkbox' checked='checked' id='ch'"+i+"' name='ch'"+i+"'>";
			cell2.innerHTML = "<img src='/ja/img/fcy/"+countryarray[i][0]+"' alt='"+fxratesarray[i][2]+"' title='"+fxratesarray[i][2]+"' border='0'>";
			cell3.innerHTML ="<span class='fcy_normaltext'>"+fxratesarray[i][2]+"</span>";
			row.appendChild(cell1); 
			row.appendChild(cell2); 
			row.appendChild(cell3);
			tbody.appendChild(row); 			
		}		
	}

	if(state)
	{
		DivRef.style.display = "";
		ratecountrytableflag=true;
	}
	else
	{
		DivRef.style.display = "none";
	}
}
/*FCY Rates ends */
