window.attachEvent("onload", correctPNG);

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 && version < 7.0) && (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 PopUpImage(ImageUrl)
           {
           PopUpWindow=window.open('','Popup','scrollbars=no,menubar=no,toolbar=no,status=no,location=no,resizable=yes,width=100,height=100');
           PopUpWindow.focus();
           PopUpWindow.document.open();
            with(PopUpWindow)
                  {
                document.write("<html><head>");
                document.write('<script type="text/javascript" language="JavaScript">');
                document.write("function click() { window.close(); } ");
                document.write("document.onmousedown=click ");
                document.write('</script>');
                document.write("<title>"+ImageUrl+"</title></head>");
                document.write("<" + "body onblur='window.close()';");
                document.write("marginwidth='0' marginheight='0' leftmargin='0' topmargin='0'>");
                document.write("<img src='" + ImageUrl + "' border='0'>");
                document.write('<script type="text/javascript" language="JavaScript">');

                var DiffWidthTo = 0;
                var DiffHeightTo = 0;
                if (self.innerHeight) // all except Explorer
                   {
	             DiffWidthTo = outerWidth - innerWidth;
	             DiffHeightTo = outerHeight - innerHeight;
                   }
               else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
                        {
	                DiffWidthTo = document.documentElement.offsetWidth - document.documentElement.clientWidth;
	                DiffHeightTo = document.documentElement.offsetHeight - document.documentElement.clientHeight;
                        DiffWidthTo += 5;
                        DiffHeightTo += 45;
                        }
                else if (document.body) // other Explorers
                        {
	                DiffWidthTo = document.body.offsetWidth - document.body.clientWidth;
	                DiffHeightTo = document.body.offsetHeight - document.body.clientHeight;
                        DiffWidthTo += 5;
                        DiffHeightTo += 45;
                       }

                resizeTo(document.images[0].width + DiffWidthTo, document.images[0].height + DiffHeightTo);
                document.write('</script>');
                document.write("</body></html>");
                document.close();
                }
         return false;
        }

function PopUp(Url,Width,Height)
           {
           PopUpWindow=window.open(Url,'Popup','scrollbars=no,menubar=no,toolbar=no,status=no,location=no,resizable=yes,width=' + Width + ',height=' + Height + "'");
           PopUpWindow.focus();
            return false;
        }



function PopUp2(Url,Width,Height)
           {
           PopUpWindow=window.open(Url,'Popup','scrollbars=yes,menubar=no,toolbar=no,status=no,location=no,resizable=yes,width=' + Width + ',height=' + Height + "'");
           PopUpWindow.focus();
            return false;
        }
