var version = parseFloat(navigator.appVersion.split("MSIE")[1]);

function fixPng(myImage) {

  if ((this.version >= 5.5) && (this.version < 7) && (document.body.filters)) {

    var imgID = (myImage.id) ? "id='" + myImage.id + "' " : "";
    var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : "";
    var imgTitle = (myImage.title) ?
    "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' ";
    var imgStyle = "display:inline-block;" + myImage.style.cssText;
    var strNewHTML = "<span " + imgID + imgClass + imgTitle
    + " style=\"" + "width:" + myImage.width
    + "px; height:" + myImage.height
    + "px;" + imgStyle + ";"
    + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
    + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>";
    myImage.outerHTML = strNewHTML;

  }

}

function calculateCurrency(currency, tag)
{
  $('text').getElements(tag).each(function(item, index)
  {
    if (isNumeric(item.innerHTML))
    {
      var division = item.innerHTML / currency;
      var result = Math.round(division * Math.pow(10,2))/Math.pow(10,2);
      /*
      if (result < division)
      {
        result = result + 0.1;
        result = Math.round(result * Math.pow(10,2))/Math.pow(10,2);
      }*/
      
      item.innerHTML = result.toFixed(2);
    }
  });
}

function isNumeric(value)
{
  var validChars = "0123456789.";
 
  for (i = 0; i < value.length; i++) 
  { 
    if (validChars.indexOf(value.charAt(i)) == -1) 
    {
      return false
    }
  }
  return true;
}
