/* Processed by Keyword Controller on Wed, 10 Mar 2010 16:00:31 */ // ----------------------------------------------------------------------------------- // // JSFixMsiePng v1.0 // by Jeffrey Sambells // Copyright (c) 2006 Jeffrey Sambells (http://jeffreysambels.com) // // For more information visit: // http://jeffreysambells.com/openprojects/JavaScript/JSFixMsiePng/ // // Licensed under the Creative Commons Attribution 2.5 License // http://creativecommons.org/licenses/by/2.5/ // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.// // // ----------------------------------------------------------------------------------- JSFixMsiePng = function() { if(!document.body.filters) return; //not MSIE if(7 <= parseFloat(navigator.appVersion.split("MSIE")[1])) return; // 7+ supports PNG //fix the inline images if(document.images) { var images = document.images; for(var i=0; i < images.length; i++) { if(!images[i].nodeName || images[i].nodeName.toUpperCase() != 'IMG') continue; if(images[i].src && images[i].src.substring(images[i].src.length-3, images[i].src.length).toLowerCase() !== 'png') continue; var strId = (images[i].id ? ' id="' + images[i].id + '"' : '' ); var strClassName = (images[i].className ? 'class="' + images[i].className + '" ' : ''); var strStyle = ''; //events? if (images[i].align == 'left' || images[i].align == 'right') imgStyle += 'float:' + images[i].align + ';'; //no whitespace nodes in IE if (images[i].parentElement && images[i].parentElement.href) strStyle += 'cursor:hand;'; strStyle += 'display:inline-block;'; if(images[i].style && images[i].style.cssText) strStyle += images[i].style.cssText; images[i].outerHTML = strXHTML = ''; i--; //we nuked an image so repeat the last loop key } } function addFilters(e) { if( e.style && e.style.background && !e.style.filter ) { if(e.style.background.toLowerCase().match('.png')) { var src = e.style.backgroundImage; //TODO change to a match. src = src.replace('url(',''); src = src.replace(')',''); e.style.backgroundColor = 'transparent'; e.style.backgroundImage = 'url()'; e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='" + ( ( e.style.width && e.style.height ) ? 'scale' : 'crop' ) + "')"; } } } //fix the rules in the CSS style sheets //from and