### Eclipse Workspace Patch 1.0
#P drupal-contrib-5
Index: modules/pngfix/pngfix.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pngfix/pngfix.module,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 pngfix.module
--- modules/pngfix/pngfix.module	24 Oct 2007 19:53:11 -0000	1.1.2.1
+++ modules/pngfix/pngfix.module	24 Oct 2007 23:03:53 -0000
@@ -1,9 +1,7 @@
 <?php
 
 /**
-* Display help and module information
-* @param section which section of the site we're displaying help
-* @return help text for section
+* Implementation of hook_help
 */
 function pngfix_help($section = '') {
   $output = '';
@@ -21,11 +19,7 @@
 function pngfix_menu($may_cache) {
   $items = array();
   if (!$may_cache) {
-    $js = base_path() . drupal_get_path('module', 'pngfix') .'/pngfix.js';
-    $html = '<!--[if lt IE 7.]>
-    <script defer type="text/javascript" src="'. $js .'"></script>
-    <![endif]-->';
-    drupal_set_html_head($html);
+    drupal_add_css(drupal_get_path('module', 'pngfix') .'/pngfix.css');
   }
   return $items;
 }
Index: modules/pngfix/pngfix.js
===================================================================
RCS file: modules/pngfix/pngfix.js
diff -N modules/pngfix/pngfix.js
--- modules/pngfix/pngfix.js	24 Oct 2007 19:53:11 -0000	1.1.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@
-/*
- 
-Correctly handle PNG transparency in Win IE 5.5 & 6.
-http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2006.
-
-Use in <HEAD> with DEFER keyword wrapped in conditional comments:
-<!--[if lt IE 7]>
-<script defer type="text/javascript" src="pngfix.js"></script>
-<![endif]-->
-
-*/
-
-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
-      }
-   }
-}
Index: modules/pngfix/pngfix.css
===================================================================
RCS file: modules/pngfix/pngfix.css
diff -N modules/pngfix/pngfix.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/pngfix/pngfix.css	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,3 @@
+img, div { 
+  behavior: url("/drupal/sites/all/modules/pngfix/iepngfix.htc");
+}
Index: modules/pngfix/iepngfix.htc
===================================================================
RCS file: modules/pngfix/iepngfix.htc
diff -N modules/pngfix/iepngfix.htc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/pngfix/iepngfix.htc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,99 @@
+<public:component lightweight="true">
+<public:attach event="onpropertychange" onevent="iePNGFix(0)" />
+
+<script type="text/javascript">
+
+// IE5.5+ PNG Alpha Fix v1.0RC5
+// (c) 2004-2007 Angus Turnbull http://www.twinhelix.com
+
+// This is licensed under the GNU LGPL, version 2.1 or later.
+// For details, see: http://creativecommons.org/licenses/LGPL/2.1/
+
+
+// This must be a path to a blank image, relative to the HTML document(s).
+// In production use I suggest '/images/blank.gif' or similar. That's all!
+if (typeof blankImg == 'undefined') var blankImg = '/drupal/sites/all/modules/pngfix/blank.gif';
+
+
+
+function filt(s, b)
+{
+ var f = 'DXImageTransform.Microsoft.AlphaImageLoader';
+ var sM = (currentStyle.backgroundRepeat == 'no-repeat') ? 'crop' : 'scale';
+ s = (s || '').replace(/\(/g, '%28').replace(/\)/g, '%29');
+
+ if (s && !(/IMG|INPUT/.test(nodeName) && !b) && 
+  currentStyle.width == 'auto' && currentStyle.height == 'auto')
+ {
+  style.width = offsetWidth + 'px';
+  style.display = 'block';
+ }
+
+ if (filters[f])
+ {
+  filters[f].enabled = s ? true : false;
+  if (s) with (filters[f]) { src = s }
+ }
+ else if (s) style.filter = 'progid:'+f+'(src="'+s+'",sizingMethod="' + sM + '")';
+}
+
+function iePNGFix(init)
+{
+ if (!/MSIE (5\.5|6)/.test(navigator.userAgent)) return;
+ var evt = init ? { propertyName: 'src,background' } : event;
+ var isSrc = /src/.test(evt.propertyName);
+ var isBg = /background/.test(evt.propertyName);
+ var isClass = !init &&
+  ((this.className != this._png_class) && (this.className || this._png_class));
+ if (!(isSrc || isBg || isClass)) return;
+ this._png_class = this.className;
+ var blank = blankImg.match(/([^\/]+)$/)[1];
+
+ // Required for Whatever:hover support - erase any set BG if className changes.
+ if (isClass && ((style.backgroundImage.indexOf('url(') == -1) ||
+     (style.backgroundImage.indexOf(blank) > -1)))
+ {
+  style.backgroundImage = '';
+  return;
+ }
+
+ if (isSrc && this.src && /IMG|INPUT/.test(nodeName))
+ {
+  if ((/\.png([^\.]+|$)/i).test(src))
+  {
+   filt(src, 1);
+   src = blankImg;
+  }
+  else if (src.indexOf(blank) == -1) filt();
+ }
+
+ var bgSrc = currentStyle.backgroundImage || style.backgroundImage;
+ if ((bgSrc + this.src).indexOf(blank) == -1)
+ {
+  var bgPNG = bgSrc.match(/url[("']+(.*\.png[^\)"']*)[\)"']+/i);
+
+  if (bgPNG)
+  {
+   style.backgroundImage = 'url("' + blankImg + '")';
+   filt(bgPNG[1], 0);
+   // Unclickable elements inside PNG backgrounds.
+   var tags = ['a', 'input', 'select', 'textarea', 'iframe', 'object'],
+    t = tags.length, tFix = [];
+   while (t--)
+   {
+    var elms = all.tags(tags[t]), e = elms.length;
+    while (e--) tFix.push(elms[e]);    
+   }
+   var t = tFix.length;
+   if (t && (/relative|absolute/i).test(currentStyle.position))
+    alert('IEPNGFix: Children of positioned element are unclickable!\n' + this);
+   while(t--) tFix[t].style.position = 'relative';
+  }
+  else filt();
+ }
+}
+
+iePNGFix(1);
+
+</script>
+</public:component>
