/**
 * An alpha transparent png support library for Internet Explore (other browsers
 * support this functionality natively) now compatible with Mootools.
 *
 * @author Toby Miller <tmiller@tobymiller.com>
 * @author Keith Baker <god.dreams@gmail.com>
 * @copyright Copyright (C) 2008, Toby Miller
 * @license MIT
 *
 * to remove flash of unstyled content for images (not background):
 * add to header:
 *	<!--[if lt IE 7]>
 *		<style type="text/css" media="all">
 *			img{filter:alpha(opacity=0);}
 *		</style>
 *	<![endif]-->
 * add to footer:
 *	<!--[if lt IE 7]>
 *       <script type="text/javascript">
 *           var ap = new AlphaPng();
 *      </script>
 *  <![endif]-->
 *
 * TODO: override 	setOpacity and getStyle to apply effects to parent
 * element to allow for fade effects.
*/
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
    if ((version >= 5.5) && (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	  
    }
}