Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Convertitore valute</title>
- <link rel="icon" href="favicon2.ico"/>
- <STYLE TYPE="text/css">
- BODY{
- background-image: url(sfondo.jpg);
- font-family:Verdana;
- }
- input, select {
- border-color: #FFFAF0;
- color: #F00;
- border-style: solid;
- font-family:Verdana;
- }
- A:link{color:#FF831C}
- A:visited{color:#FF831C}
- table.sample {
- border-width: 10px;
- border-spacing: 10px;
- border-style: outset;
- border-color:FFFAF0;
- border-collapse: collapse;
- }
- table.sample th {
- border-width: 20px;
- padding: 40px;
- border-style: inset;
- border-color:FFFAF;
- background-color: 3399FF;
- -moz-border-radius: ;
- }
- </STYLE>
- <script>
- var direzione = 1;
- var currentCurrency = 0;
- var convCurrency = 0;
- var valute = ["Dollaro Statunitense","Euro", "Sterlina Brittanica ", "Franco Svizzero ", "Yen Giapponese", "Australia Dollaro", "Canada Dollaro", "Albania Lek",
- "Aruba Fiorino di Aruba", "Bulgaria Lev", "Brasile Real", "Cina Yuan", "Cuba Peso", "Sterlina Egiziana", "Moneta Filippina",
- "India Rupia", "Honduras Lempira", "Liberia Dollaro liber", "Lituania Lita", "Malta Lira", "Marocco Dirham",
- "Norvegia Corona", "Peru' Nuevo Sol", "Pakistan Rupia", "Sudafrica Rand", "Siria Sterlina", "Taiwan Dollaro",
- "Tunisia Dinaro", "Venezuela Bolivar Fuerte", "Zambia Kwacha"];
- var sigle = ["USD","EURO","GBP", "CHF", "JPY", "AUD", "CAD", "ALL", "AWG", "BGN", "BRL", "CNY", "CUP", "EGP", "PHP", "INR",
- "HNL","LRD","LTL", "MTL", "MAD", "NOK", "PEN", "PKR", "ZAR", "SYP", "TWD", "TND", "VEF", "ZMK" ];
- var tasso = [1.1197,1, 0.7153, 1.0407, 135.2239, 1.4185, 1.3658, 141.9551, 2.0043, 1.9556, 3.4079, 6.9405, 1.1197, 8.5434,
- 49.872, 71.1066, 24.5272, 94.7938, 3.2852, 3.2852, 10.8648, 8.4089, 3.522, 114.0919, 13.201, 211.4319, 34.0389,
- 2.1684, 7.1101, 7.1101];
- function riempimento(){
- contenuto = "";
- for(i=0; i<valute.length; i++){
- contenuto = contenuto + "<option value= '" + sigle[i] + "'>" + valute[i] + "</option>\n";
- }
- menu = document.getElementById("altre");
- menu.innerHTML = contenuto;
- }
- function calcola(){
- eur = document.cc.euro.value;
- i = document.cc.other.selectedIndex;
- noneur = eur * tasso[i];
- document.cc.noneuro.value = noneur;
- currentCurrency = i;
- }
- function inverti(){
- if(direzione == 1){
- direzione = 2;
- }else{
- direzione = 1;
- }
- var eur = parseFloat(document.cc.euro.value);
- var noneur = parseFloat(document.cc.noneuro.value);
- var temp = document.cc.euro.value;
- document.cc.euro.value = noneur;
- temp = noneur*tasso[currentCurrency];
- //document.getElementById("currency").innerHTML = valute[i];
- document.cc.noneuro.value = temp;
- }
- alert ("Questo convertitore ha i tassi delle valute aggiornate al 22 Maggio 2015.");
- </script>
- </head>
- <body onLoad="riempimento();">
- <h1 align="center"><font face=”Verdana” color=CRIMSON><u>Convertitore di valuta</u></font></h1>
- <form name="cc" >
- <table class="sample" width="80%" align="center" border="5">
- <tr>
- <td width="50%" align="center" id="sx">
- <font id="currency" face=”Verdana” color=#FFFAF0;><b>EURO</b></font><br><br>
- <input type="text" name="euro" onkeyup="calcola();">
- </td>
- <td width="50%" align="center" id="dx"><br>
- <font id ="otherCurrency" face=”Verdana” color=#FFFAF0;><b>ALTRE VALUTE</b></font><br><br>
- <select name="other" id="altre" onchange="calcola();">
- </select>
- <br>
- <br>
- <input type="text" name="noneuro"><br>
- </br>
- </tr>
- <h3 align="center"> <input type="reset" name="clean" value="Cancella"></h3>
- </table>
- </form>
- <br></br>
- <td>
- <div align="center"><input type="button" id="cambio" value="Inverti i valori" onclick="inverti();"></div>
- <!--<div id ="sx" "</div-->
- <!--div id ="dx" "</div>-->
- </td>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement