var eurovals=new Object();eurovals.FRF=6.559;eurovals.ATS=13.7603;eurovals.PTE=200.482;eurovals.ESP=166.386;eurovals.BEF=40.3399;eurovals.NLG=2.20371;eurovals.FIM=5.94573;eurovals.DEM=1.95583;eurovals.IEP=0.78756;eurovals.ITL=1936.27;eurovals.LUF=40.3399;eurovals.GRD=340.75;function calculate(){var m=document.currcalc.from_tkc;var l=document.currcalc.to_tkc;var c=m[m.selectedIndex].text;var j=l[l.selectedIndex].text;var d;var a;var k=document.currcalc.translation1.value;var i=document.currcalc.translation2.value;var f=document.currcalc.translation3.value;var h=0;if(c.match(/\(EUR\)/)!=null){var p=j.split("(");var o=p.length-1;var q=p[o].match(/(FRF|ATS|PTE|ESP|BEF|NLG|FIM|DEM|IEP|ITL|LUF|GRD)/);if(q!=null){d=1;a=eurovals[q[0]]}}if(j.match(/\(EUR\)/)!=null){var e=c.split("(");var b=e.length-1;var q=e[b].match(/(FRF|ATS|PTE|ESP|BEF|NLG|FIM|DEM|IEP|ITL|LUF|GRD)/);if(q!=null){a=1;d=eurovals[q[0]]}}if(d==null&&a==null){d=price[m[m.selectedIndex].value];a=price[l[l.selectedIndex].value]}if((d<0)||(d=="")||isNaN(d)||(a<0)||(a=="")||isNaN(a)){if((d==null)||(d<=0)){if(c.match(/Select/)==null){alert(c+" data is currently not available.")}else{h=1}}if((a==null)||(a<=0)){if(j.match(/Select/)==null){alert(j+" data is currently not available.")}else{h=1}}if(h){alert(k)}return false}var g=document.currcalc.amount.value;if((g=="")||isNaN(g)||(g==0)||(g<1)){alert(i);document.currcalc.amount.focus();return false}var n=/,/g;g=g.replace(n,"");ShowResult(d,a,g)}function ShowResult(e,c,g){var j=g*c/e;var i=document.currcalc.from_tkc;var h=document.currcalc.to_tkc;var b=document.currcalc.pagetype.value;var d=document.currcalc.translation.value;var f="";if(b=="mkts"){f='<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" width="100%"><TR BGCOLOR="#D2E1E8"><TD align="center">'}else{f='<TABLE BGCOLOR="#DDEDD9" BORDER="0" CELLSPACING="0" CELLPADDING="0" width="100%"><TR BGCOLOR="#D8E6CC"><TD align="center">'}var a=f+'<span class="style4"><br>'+g+" "+i.options[i.selectedIndex].text+" = "+round(j)+" "+h.options[h.selectedIndex].text+"</span><br><br></TD></TR></TABLE><br>";if((navigator.appName.indexOf("Microsoft")!=-1)||(parseInt(navigator.appVersion)>=5)){document.getElementById("crncyres").innerHTML=a}else{alert(errmsg3)}}function round(a){if(a<200000){return Math.round(a*10000)/10000}else{if(a<20000000){return Math.round(a*100)/100}else{return Math.round(a)}}};