function changeCurrencys(){var a=$("currency").value;var b="rates/ajax_rates.php?currency="+a;xmlhttp.open("GET",b);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){returnText=xmlhttp.responseText;$("cur").value=returnText}};xmlhttp.send(null)}function callingTo(b){var a=document.getElementById("to1").value;var c=b.options[b.selectedIndex].text.toLowerCase();c=c.replace("/","|");c=encodeURIComponent(c.replace(/\s/g,"-"));if(c!="calling-to-(select-a-country)"){$("callingTo").action=URL_RATES+"cheap-calls-to-"+c;$("callingTo").submit()}else{$("callingTo").action=URL_RATES;$("callingTo").submit()}}function callingFrom(a){var c=document.getElementById("from").options[document.getElementById("from").selectedIndex].text.toLowerCase();if(c=="calling from (select a country)"){c=""}c=c.replace("/","|");c=encodeURIComponent(c.replace(/\s/g,"-"));var b=document.getElementById("to2").options[document.getElementById("to2").selectedIndex].text.toLowerCase();if(b=="calling to (select a country)"){b=""}b=b.replace("/","|");b=encodeURIComponent(b.replace(/\s/g,"-"));if(window.location.href.toString().indexOf("to")>-1){if(b==""){$("callingFrom").action=URL_RATES+"cheap-calls-from-"+c;$("callingFrom").submit()}else{$("callingFrom").action=URL_RATES+"cheap-calls-from-"+c+"-to-"+b;$("callingFrom").submit()}}else{if(c==""){$("callingFrom").action=URL_RATES;$("callingFrom").submit()}else{$("callingFrom").action=URL_RATES+"cheap-calls-from-"+c;$("callingFrom").submit()}}}function callingFromTo(a){var c=document.getElementById("from").options[document.getElementById("from").selectedIndex].text.toLowerCase();var b=document.getElementById("to2").options[document.getElementById("to2").selectedIndex].text.toLowerCase();if(c=="calling from (select a country)"){c=""}if(b=="calling to (select a country)"){b=""}c=c.replace("/","|");c=encodeURIComponent(c.replace(/\s/g,"-"));b=b.replace("/","|");b=encodeURIComponent(b.replace(/\s/g,"-"));if(b!=""){$("callingFromTo").action=URL_RATES+"cheap-calls-from-"+c+"-to-"+b;$("callingFromTo").submit()}else{if(c!=""){$("callingFromTo").action=URL_RATES+"cheap-calls-from-"+c;$("callingFromTo").submit()}else{$("callingFromTo").action=URL_RATES;$("callingFromTo").submit()}}}function changeCurrency(){$("currencyform").submit()};