///////////////////////////////// Function CheckEmpty() ////////////////////////////////////////////////////////////////////////////
function CheckImage1(Myname)
{ 
var Rf =document.getElementById(Myname);
var V = Rf.value;
if (V=="1") 	{document.form_currency.Image01.src="photos/flag_01.jpg";}
if (V=="2") 	{document.form_currency.Image01.src="photos/flag_02.jpg";}
if (V=="3") 	{document.form_currency.Image01.src="photos/flag_03.jpg";}
if (V=="4") 	{document.form_currency.Image01.src="photos/flag_04.jpg";}
if (V=="5") 	{document.form_currency.Image01.src="photos/flag_05.jpg";}
if (V=="6") 	{document.form_currency.Image01.src="photos/flag_06.jpg";}
if (V=="7") 	{document.form_currency.Image01.src="photos/flag_07.jpg";}
if (V=="8") 	{document.form_currency.Image01.src="photos/flag_08.jpg";}
if (V=="9") 	{document.form_currency.Image01.src="photos/flag_09.jpg";}
if (V=="10") 	{document.form_currency.Image01.src="photos/flag_10.jpg";}
return true;
}


function CheckImage2(Myname)
{ 
var Rf =document.getElementById(Myname);
var V = Rf.value;
if (V=="1") 	{document.form_currency.Image02.src="photos/flag_01.jpg";}
if (V=="2") 	{document.form_currency.Image02.src="photos/flag_02.jpg";}
if (V=="3") 	{document.form_currency.Image02.src="photos/flag_03.jpg";}
if (V=="4") 	{document.form_currency.Image02.src="photos/flag_04.jpg";}
if (V=="5") 	{document.form_currency.Image02.src="photos/flag_05.jpg";}
if (V=="6") 	{document.form_currency.Image02.src="photos/flag_06.jpg";}
if (V=="7") 	{document.form_currency.Image02.src="photos/flag_07.jpg";}
if (V=="8") 	{document.form_currency.Image02.src="photos/flag_08.jpg";}
if (V=="9") 	{document.form_currency.Image02.src="photos/flag_09.jpg";}
if (V=="10") 	{document.form_currency.Image02.src="photos/flag_10.jpg";}
return true;
}




function Convert()
{
var GBP=0.72463;
var USD=1.25649;
var EUR=1;
var CAD=1.41620;
var AUD=1.65678;
var CHF=1.59047;
var SEK=9.20008;
var NOK=8.38210;
var DKK=7.45506;
var JPY=149.837;

var Rf1 =document.getElementById('hide_eur');
var Rf2 =document.getElementById('hide_gbp');
var Rf3 =document.getElementById('hide_usd');

if (Rf1.value !=""){EUR=Rf1.value;}
if (Rf2.value !=""){GBP=Rf2.value;}
if (Rf3.value !=""){USD=Rf3.value;}

var Amt=document.form_currency.amount;
var F=document.form_currency.list_01;
var T=document.form_currency.list_02;
var Cc=document.form_currency.result;

if (F.value == 1) 	{V1=GBP;}
if (F.value == 2) 	{V1=USD;}
if (F.value == 3) 	{V1=EUR;}
if (F.value == 4) 	{V1=CAD;}
if (F.value == 5) 	{V1=AUD;}
if (F.value == 6) 	{V1=CHF;}
if (F.value == 7) 	{V1=SEK;}
if (F.value == 8) 	{V1=NOK;}
if (F.value == 9) 	{V1=DKK;}
if (F.value == 10) 	{V1=JPY;}

if (T.value == 1) 	{V2=GBP; N="GBP";}
if (T.value == 2) 	{V2=USD; N="USD";}
if (T.value == 3) 	{V2=EUR; N="EUR";}
if (T.value == 4) 	{V2=CAD; N="CAD";}
if (T.value == 5) 	{V2=AUD; N="AUD";}
if (T.value == 6) 	{V2=CHF; N="CHF";}
if (T.value == 7) 	{V2=SEK; N="SEK";}
if (T.value == 8) 	{V2=NOK; N="NOK";}
if (T.value == 9) 	{V2=DKK; N="DKK";}
if (T.value == 10) 	{V2=JPY; N="JPY";}

msg1 = "The value you have entered  \"" + Amt.value + "\"  is NOT a valid Number \n"
	msg1 = msg1 + "         Please Enter ONLY Numbers into This Field! \n"
	msg1 = msg1 + "               Valid entries are 0-9 and . (dot)\n"

if(isNaN(Amt.value)) {alert(msg1); Amt.focus(); Amt.select(); return false;}
else{
R=Amt.value/V1*V2;
R= R.toFixed(2);
Cc.value= R + "  " + N;
return true;
}

}
//////////////////////////////////////////////////////////////////////////////////

function Reverse()
{
var Amt=document.form_currency.amount;		if (Amt.value.length=0) {alert('No Value to Reverse'); Amt.focus(); Amt.select(); return false;}
var F=document.form_currency.list_01;
var T=document.form_currency.list_02;
var Y=document.form_currency.result;
	
var GBP=0.72463;
var USD=1.25649;
var EUR=1;
var CAD=1.41620;
var AUD=1.65678;
var CHF=1.59047;
var SEK=9.20008;
var NOK=8.38210;
var DKK=7.45506;
var JPY=149.837;


var Rf1 =document.getElementById('hide_eur');
var Rf2 =document.getElementById('hide_gbp');
var Rf3 =document.getElementById('hide_usd');

if (Rf1.value !=""){EUR=Rf1.value;}
if (Rf2.value !=""){GBP=Rf2.value;}
if (Rf3.value !=""){USD=Rf3.value;}

var a=F.value;
var b=T.value;
F.value=b;
T.value=a;

ReverseImage(b,a);
if (F.value == "1") 	{A1=GBP;}
if (F.value == "2") 	{A1=USD;}
if (F.value == "3") 	{A1=EUR;}
if (F.value == "4") 	{A1=CAD;}
if (F.value == "5") 	{A1=AUD;}
if (F.value == "6") 	{A1=CHF;}
if (F.value == "7") 	{A1=SEK;}
if (F.value == "8") 	{A1=NOK;}
if (F.value == "9") 	{A1=DKK;}
if (F.value == "10") 	{A1=JPY;}

if (T.value == "1") 	{A2=GBP; M="GBP";}
if (T.value == "2") 	{A2=USD; M="USD";}
if (T.value == "3") 	{A2=EUR; M="EUR";}
if (T.value == "4") 	{A2=CAD; M="CAD";}
if (T.value == "5") 	{A2=AUD; M="AUD";}
if (T.value == "6") 	{A2=CHF; M="CHF";}
if (T.value == "7") 	{A2=SEK; M="SEK";}
if (T.value == "8") 	{A2=NOK; M="NOK";}
if (T.value == "9") 	{A2=DKK; M="DKK";}
if (T.value == "10") 	{A2=JPY; M="JPY";}

msg1 = "The value you have entered  \"" + Amt.value + "\"  is NOT a valid Number \n"
	msg1 = msg1 + "         Please Enter ONLY Numbers into This Field! \n"
	msg1 = msg1 + "               Valid entries are 0-9 and . (dot)\n"

if(isNaN(Amt.value)) {alert(msg1); Amt.focus(); Amt.select(); return false;}
else{
X=Amt.value/A1*A2;
X= X.toFixed(2);
Y.value= X + "  " + M;
return true;
}

}


/////////////////////////////////////////////////////////////////////////////////////////////////////
function ReverseImage(M1,M2)
{ 
if (M1=="1") 	{document.form_currency.Image01.src="photos/flag_01.jpg";}
if (M1=="2") 	{document.form_currency.Image01.src="photos/flag_02.jpg";}
if (M1=="3") 	{document.form_currency.Image01.src="photos/flag_03.jpg";}
if (M1=="4") 	{document.form_currency.Image01.src="photos/flag_04.jpg";}
if (M1=="5") 	{document.form_currency.Image01.src="photos/flag_05.jpg";}
if (M1=="6") 	{document.form_currency.Image01.src="photos/flag_06.jpg";}
if (M1=="7") 	{document.form_currency.Image01.src="photos/flag_07.jpg";}
if (M1=="8") 	{document.form_currency.Image01.src="photos/flag_08.jpg";}
if (M1=="9") 	{document.form_currency.Image01.src="photos/flag_09.jpg";}
if (M1=="10") 	{document.form_currency.Image01.src="photos/flag_10.jpg";}


if (M2=="1") 	{document.form_currency.Image02.src="photos/flag_01.jpg";}
if (M2=="2") 	{document.form_currency.Image02.src="photos/flag_02.jpg";}
if (M2=="3") 	{document.form_currency.Image02.src="photos/flag_03.jpg";}
if (M2=="4") 	{document.form_currency.Image02.src="photos/flag_04.jpg";}
if (M2=="5") 	{document.form_currency.Image02.src="photos/flag_05.jpg";}
if (M2=="6") 	{document.form_currency.Image02.src="photos/flag_06.jpg";}
if (M2=="7") 	{document.form_currency.Image02.src="photos/flag_07.jpg";}
if (M2=="8") 	{document.form_currency.Image02.src="photos/flag_08.jpg";}
if (M2=="9") 	{document.form_currency.Image02.src="photos/flag_09.jpg";}
if (M2=="10") 	{document.form_currency.Image02.src="photos/flag_10.jpg";}
}

