// hho extended currency selector scripts // set pageCUR to the site currency without CUR= in URL var pageCUR = "USD"; var curInURL = "0"; var urlNoCacheId = location.pathname + location.search.replace(/(&cache_id=)\d*/i, ''); // check for &CUR= in the url if (location.href.toUpperCase().indexOf("CUR") != -1) { curInURL = "1"; } function ChangeCurrency(thisCUR) { var fcName = 'Currency Drop Down Full ' + thisCUR; fc_click(fcName, 'ad'); // check for &CUR= in the url if (curInURL == "1") { // change &CUR= if it is there location.href = urlNoCacheId.replace(/(cur=)\d*/i, '$1' + thisCUR); } else { // add &CUR= to URL if its not there url = urlNoCacheId + "&CUR=" + thisCUR; location.href = url; } } function currencyDropdown() { // set the current cur as default in the dropdown if (pageCUR == "CAD") { document.CurrencySelect.CurrencyDropdown.options[0].selected = true; } else if (pageCUR == "USD") { document.CurrencySelect.CurrencyDropdown.options[1].selected = true; } else if (pageCUR == "AUD") { document.CurrencySelect.CurrencyDropdown.options[2].selected = true; } else if (pageCUR == "HKD") { document.CurrencySelect.CurrencyDropdown.options[3].selected = true; } else if (pageCUR == "SGD") { document.CurrencySelect.CurrencyDropdown.options[4].selected = true; } else if (pageCUR == "GBP") { document.CurrencySelect.CurrencyDropdown.options[5].selected = true; } else if (pageCUR == "EUR") { document.CurrencySelect.CurrencyDropdown.options[6].selected = true; } }