/* Copyright (C) YOOtheme GmbH, http://www.gnu.org/licenses/gpl.html GNU/GPL */

var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},createVmlNameSpace:function(){document.namespaces&&!document.namespaces[this.ns]&&document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml");window.attachEvent&&window.attachEvent("onbeforeunload",function(){DD_belatedPNG=null})},createVmlStyleSheet:function(){var a=document.createElement("style");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");
a.addRule(this.ns+"\\:shape","position:absolute;");a.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.styleSheet=a},readPropertyChange:function(){var a=event.srcElement;(-1!=event.propertyName.search("background")||-1!=event.propertyName.search("border"))&&DD_belatedPNG.applyVML(a);if("style.display"==event.propertyName){var c="none"==a.currentStyle.display?"none":"block",b;for(b in a.vml)a.vml[b].shape.style.display=
c}-1!=event.propertyName.search("filter")&&DD_belatedPNG.vmlOpacity(a)},vmlOpacity:function(a){if(-1!=a.currentStyle.filter.search("lpha")){var c=a.currentStyle.filter,c=parseInt(c.substring(c.lastIndexOf("=")+1,c.lastIndexOf(")")),10)/100;a.vml.color.shape.style.filter=a.currentStyle.filter;a.vml.image.fill.opacity=c}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){for(var a=a.split(","),c=0;c<a.length;c++)this.styleSheet.addRule(a[c],"behavior:expression(DD_belatedPNG.fixPng(this))")},
applyVML:function(a){a.runtimeStyle.cssText="";this.vmlFill(a);this.vmlOffsets(a);this.vmlOpacity(a);a.isImg&&this.copyImageBorders(a)},attachHandlers:function(a){var c=this,b={resize:"vmlOffsets",move:"vmlOffsets"};if("A"==a.nodeName){var e={mouseleave:"handlePseudoHover",mouseenter:"handlePseudoHover",focus:"handlePseudoHover",blur:"handlePseudoHover"},d;for(d in e)b[d]=e[d]}for(var f in b)a.attachEvent("on"+f,function(){c[b[f]](a)});a.attachEvent("onpropertychange",this.readPropertyChange)},giveLayout:function(a){a.style.zoom=
1;"static"==a.currentStyle.position&&(a.style.position="relative")},copyImageBorders:function(a){var c={borderStyle:!0,borderWidth:!0,borderColor:!0},b;for(b in c)a.vml.color.shape.style[b]=a.currentStyle[b]},vmlFill:function(a){if(a.currentStyle){var c=a.currentStyle,b;for(b in a.vml)a.vml[b].shape.style.zIndex=c.zIndex;a.runtimeStyle.backgroundColor="";a.runtimeStyle.backgroundImage="";b=!0;if("none"!=c.backgroundImage||a.isImg){a.isImg?a.vmlBg=a.src:(a.vmlBg=c.backgroundImage,a.vmlBg=a.vmlBg.substr(5,
a.vmlBg.lastIndexOf('")')-5));var e=this;e.imgSize[a.vmlBg]||(b=document.createElement("img"),e.imgSize[a.vmlBg]=b,b.className=e.ns+"_sizeFinder",b.runtimeStyle.cssText="behavior:none; position:absolute; left:-10000px; top:-10000px; border:none;",b.attachEvent("onload",function(){this.width=this.offsetWidth;this.height=this.offsetHeight;e.vmlOffsets(a)}),b.src=a.vmlBg,b.removeAttribute("width"),b.removeAttribute("height"),document.body.insertBefore(b,document.body.firstChild));a.vml.image.fill.src=
a.vmlBg;b=!1}a.vml.image.fill.on=!b;a.vml.image.fill.color="none";a.vml.color.shape.style.backgroundColor=c.backgroundColor;a.runtimeStyle.backgroundImage="none";a.runtimeStyle.backgroundColor="transparent"}},vmlOffsets:function(a){var c=a.currentStyle,b={W:a.clientWidth+1,H:a.clientHeight+1,w:this.imgSize[a.vmlBg].width,h:this.imgSize[a.vmlBg].height,L:a.offsetLeft,T:a.offsetTop,bLW:a.clientLeft,bTW:a.clientTop},e=1==b.L+b.bLW?1:0,d=function(a,b,d,c,e,f){a.coordsize=c+","+e;a.coordorigin=f+","+f;
a.path="m0,0l"+c+",0l"+c+","+e+"l0,"+e+" xe";a.style.width=c+"px";a.style.height=e+"px";a.style.left=b+"px";a.style.top=d+"px"};d(a.vml.color.shape,b.L+(a.isImg?0:b.bLW),b.T+(a.isImg?0:b.bTW),b.W-1,b.H-1,0);d(a.vml.image.shape,b.L+b.bLW,b.T+b.bTW,b.W,b.H,1);var d={X:0,Y:0},f;for(f in d){var g=f,h=c["backgroundPosition"+f],i=!0;switch(h){case "left":case "top":d[g]=0;break;case "center":d[g]=0.5;break;case "right":case "bottom":d[g]=1;break;default:-1!=h.search("%")?d[g]=0.01*parseInt(h):i=!1}var j=
"X"==g;d[g]=Math.ceil(i?b[j?"W":"H"]*d[g]-b[j?"w":"h"]*d[g]:parseInt(h));0==d[g]&&d[g]++}a.vml.image.fill.position=d.X/b.W+","+d.Y/b.H;f=c.backgroundRepeat;g=b.W+e;h=b.H;i=1+e;c={X:{b1:"L",b2:"R",d:"W"},Y:{b1:"T",b2:"B",d:"H"}};"repeat"!=f?(d={T:d.Y,R:d.X+b.w,B:d.Y+b.h,L:d.X},-1!=f.search("repeat-")&&(f=f.split("repeat-")[1].toUpperCase(),d[c[f].b1]=1,d[c[f].b2]=b[c[f].d]),d.B>b.H&&(d.B=b.H),a.vml.image.shape.style.clip="rect("+d.T+"px "+(d.R+e)+"px "+d.B+"px "+(d.L+e)+"px)"):a.vml.image.shape.style.clip=
"rect(1px "+g+"px "+h+"px "+i+"px)"},fixPng:function(a){a.style.behavior="none";if(!("BODY"==a.nodeName||"TD"==a.nodeName||"TR"==a.nodeName)){a.isImg=!1;if("IMG"==a.nodeName)if(-1!=a.src.toLowerCase().search(/\.png$/))a.isImg=!0,a.style.visibility="hidden";else return;else if(-1==a.currentStyle.backgroundImage.toLowerCase().search(".png"))return;var c=DD_belatedPNG;a.vml={color:{},image:{}};var b={shape:{},fill:{}},e;for(e in a.vml){for(var d in b)a.vml[e][d]=document.createElement(c.ns+":"+d);a.vml[e].shape.stroked=
!1;a.vml[e].shape.appendChild(a.vml[e].fill);a.parentNode.insertBefore(a.vml[e].shape,a)}a.vml.image.shape.fillcolor="none";a.vml.image.fill.type="tile";a.vml.color.fill.on=!1;c.attachHandlers(a);c.giveLayout(a);c.giveLayout(a.offsetParent);c.applyVML(a)}}};try{document.execCommand("BackgroundImageCache",!1,!0)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet();
