function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters))
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }
}

function setup_help_values() {
	for (element_id in HELP_VALUES) {
		setup_help_value(element_id);
	}
}

function setup_help_value(element_id) {
	var element = $(element_id).get(0);
	var help_text = HELP_VALUES[element_id];
	if (element.value == help_text) {
		element.value = '';
		element.style.color = '#000';
	}
	else if (element.value == '') {
		element.style.color = '#aaa';
		element.value = help_text;
	}
}


$(document).ready(function() {

  $("a button").click(function(event) {
    window.location = $(this).parent().attr('href');
  });

  $("#download-mac").click()

  $(".trace_download").click(function(event) {

  });

  $(".track_event").click(function(event) {
    event.preventDefault();
    pageTracker._trackPageview($(this).attr('href'));
    mpq.metrics.track($(this).data('event'), {"Which" : $(this).data('type')});
    return false;
  });

  $(".track_download").click(function(event) {
    event.preventDefault();
    pageTracker._trackPageview($(this).attr('href'));
    var href = $(this).attr('href');
    mpq.metrics.track("Download", {"Platform" : $(this).data('platform'), "Version" : $(this).data('version')}, function() {window.location = href;});
    return false;
  });

  $(".fancyzoom").fancyZoom();

});

