var tmp=navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("Opera")<1?1:0;if(tmp){var isIE=document.namespaces?1:0}if(isIE){if(document.namespaces.v==null){var e=["shape","shapetype","group","background","path","formulas","handles","fill","stroke","shadow","textbox","textpath","imagedata","line","polyline","curve","roundrect","oval","rect","arc","image"],s=document.createStyleSheet();for(var i=0;i<e.length;i++){s.addRule("v\\:"+e[i],"behavior: url(#default#VML);")}document.namespaces.add("v","urn:schemas-microsoft-com:vml")}}function getImages(d){var c=document.getElementsByTagName("img");var f=new Array();var b=0;var h;var g;var a=0;for(b=0;b<c.length;b++){h=c[b];g=h.className.split(" ");for(var a=0;a<g.length;a++){if(g[a]==d){f.push(h);break}}}return f}function getClasses(d,c){var a="";for(var b=0;b<d.length;b++){if(d[b]!=c){if(a){a+=" "}a+=d[b]}}return a}function getClassValue(d,c){var a=0;var f=c.length;for(var b=0;b<d.length;b++){if(d[b].indexOf(c)==0){a=Math.min(d[b].substring(f),100);break}}return Math.max(0,a)}function getClassColor(d,c){var a=0;var f="";var g=c.length;for(var b=0;b<d.length;b++){if(d[b].indexOf(c)==0){a=d[b].substring(g);f="#"+a.toLowerCase();break}}if(f.match(/^#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]$/i)){return f}else{return 0}}function getClassAttribute(d,c){var a=0;var f=c.length;for(var b=0;b<d.length;b++){if(d[b].indexOf(c)==0){a=1;break}}return a}function roundedRect(d,c,h,g,b,a,f){if(!f){d.beginPath()}d.moveTo(c,h+a);d.lineTo(c,h+b-a);d.quadraticCurveTo(c,h+b,c+a,h+b);d.lineTo(c+g-a,h+b);d.quadraticCurveTo(c+g,h+b,c+g,h+b-a);d.lineTo(c+g,h+a);d.quadraticCurveTo(c+g,h,c+g-a,h);d.lineTo(c+a,h);d.quadraticCurveTo(c,h,c,h+a);if(!f){d.closePath()}}function addRadialStyle(l,c,k,f,a,j,d,h){var g=l.createRadialGradient(c,k,f,a,j,d);var b=Math.min(parseFloat(h+0.1),1);g.addColorStop(0,"rgba(0,0,0,"+b+")");g.addColorStop(0.25,"rgba(0,0,0,"+h+")");g.addColorStop(1,"rgba(0,0,0,0)");return g}function addLinearStyle(c,a,k,b,j,d){var g=c.createLinearGradient(a,k,b,j);var f=Math.min(parseFloat(d+0.1),1);g.addColorStop(0,"rgba(0,0,0,"+f+")");g.addColorStop(0.25,"rgba(0,0,0,"+d+")");g.addColorStop(1,"rgba(0,0,0,0)");return g}function addBright(d,c,j,h,b,a,f){var g=d.createLinearGradient(0,j,0,j+b);g.addColorStop(0,"rgba(254,254,254,"+f+")");g.addColorStop(1,"rgba(254,254,254,0.1)");d.beginPath();d.moveTo(c,j+a);d.lineTo(c,j+b-a);d.quadraticCurveTo(c,j+b,c+a,j+b);d.lineTo(c+h-a,j+b);d.quadraticCurveTo(c+h,j+b,c+h,j+b-a);d.lineTo(c+h,j+a);d.quadraticCurveTo(c+h,j,c+h-a,j);d.lineTo(c+a,j);d.quadraticCurveTo(c,j,c,j+a);d.closePath();d.fillStyle=g;d.fill()}function addDark(d,c,j,h,b,a,f){var g=d.createLinearGradient(0,j,0,j+b);g.addColorStop(0,"rgba(0,0,0,0)");g.addColorStop(1,"rgba(0,0,0,"+f+")");d.beginPath();d.moveTo(c,j);d.lineTo(c,j+b-a);d.quadraticCurveTo(c,j+b,c+a,j+b);d.lineTo(c+h-a,j+b);d.quadraticCurveTo(c+h,j+b,c+h,j+b-a);d.lineTo(c+h,j);d.lineTo(c,j);d.closePath();d.fillStyle=g;d.fill()}function addFrame(d,c,j,h,b,a,f){roundedRect(d,c,j,h,b,a);var g=d.createLinearGradient(0,0,0,b);g.addColorStop(0,"rgba(254,254,254,"+f+")");g.addColorStop(1,"rgba(0,0,0,"+f+")");d.lineWidth=(a+c)/2;d.strokeStyle=g;d.stroke()}function glossyShadow(k,h,g,b,j,f,d){var a;var c=f/2;k.beginPath();k.rect(h+f,g,b-(f*2),g+c);k.closePath();a=addLinearStyle(k,h+f,g+c,h+f,g,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h,g,f,f);k.closePath();a=addRadialStyle(k,h+f,g+f,f-c,h+f,g+f,f,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h,g+f,c,j-(f*2));k.closePath();a=addLinearStyle(k,h+c,g+f,h,g+f,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h,g+j-f,f,f);k.closePath();a=addRadialStyle(k,h+f,g+j-f,f-c,h+f,g+j-f,f,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h+f,g+j-c,b-(f*2),c);k.closePath();a=addLinearStyle(k,h+f,g+j-c,h+f,g+j,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h+b-f,g+j-f,f,f);k.closePath();a=addRadialStyle(k,h+b-f,g+j-f,f-c,h+b-f,g+j-f,f,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h+b-c,g+f,c,j-(f*2));k.closePath();a=addLinearStyle(k,h+b-c,g+f,h+b,g+f,d);k.fillStyle=a;k.fill();k.beginPath();k.rect(h+b-f,g,f,f);k.closePath();a=addRadialStyle(k,h+b-f,g+f,f-c,h+b-f,g+f,f,d);k.fillStyle=a;k.fill()}function addIEGlossy(){var p=getImages("glossy");var k;var G;var c;var b;var u;var E=null;var v=null;var l=0;var D=null;var m=null;var A=0;var j=0.25;var z="";var F="";var y=null;var o=0;var f=0;var w="";var n=0;var h=0;var a=null;var q=null;var t=null;var g=null;var x;var d;var C;var r;var H;var B;for(u=0;u<p.length;u++){k=p[u];G=k.parentNode;d="";C="";r="";H="";B="";if(k.width>=16&&k.height>=16){z=k.className.split(" ");A=0;m=0;j=0.25;l=0;E=0;D=0;E=getClassValue(z,"iradius");D=getClassColor(z,"ibgcolor");m=getClassColor(z,"igradient");l=getClassAttribute(z,"noshadow");A=getClassAttribute(z,"horizontal");F=getClasses(z,"glossy");n=k.width;h=k.height;y=Math.min(n,h)/2;x=0;j=E>0?Math.min(Math.max(E,20),50)/100:j;E=Math.round(45*j);g=Math.round(Math.max(Math.round(y*j),4)/4)*4;if(l<1){f=g/4;v=E*0.75;o=f;radius=v;v=radius*0.75;H='<v:roundrect arcsize="'+radius+'%" strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity=60), progid:dxImageTransform.Microsoft.Blur(PixelRadius='+o+", MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:"+o+"px;left:0px;width:"+(n-(2*o))+"px;height:"+(h-(3*o))+'px;"><v:fill color="#000000" opacity="1" /></v:roundrect>';B='<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:0px;left:0px;width:'+n+"px;height:"+h+'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect>'}else{radius=E;o=0;f=g/4;v=E*0.75}if(isNaN(D)){r='<v:roundrect arcsize="'+radius+'%" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:0px;left:'+o+"px;width:"+(n-(2*o))+"px;height:"+(h-(2*o))+'px;">';if(isNaN(m)){if(A>0){x=90}r=r+'<v:fill method="sigma" type="gradient" angle="'+x+'" color="'+m+'" color2="'+D+'" /></v:roundrect>'}else{r=r+'<v:fill color="'+D+'" /></v:roundrect>'}}t=(k.currentStyle.display.toLowerCase()=="block")?"block":"inline-block";a=document.createElement(['<var style="zoom:1;overflow:hidden;display:'+t+";width:"+n+"px;height:"+h+'px;padding:0;">'].join(""));q=k.currentStyle.styleFloat.toLowerCase();t=(q=="left"||q=="right")?"inline":t;d='<v:group style="zoom:1; display:'+t+"; margin:-1px 0 0 -1px; padding:0; position:relative; width:"+n+"px;height:"+h+'px;" coordsize="'+n+","+h+'">'+B;C='<v:roundrect arcsize="'+radius+'%" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:0px;left:'+o+"px;width:"+(n-(2*o))+"px;height:"+(h-(2*o))+'px;"><v:fill src="'+k.src+'" type="frame" /></v:roundrect><v:roundrect arcsize="'+(v*2)+'%" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="zoom:1;margin:-1px 0 0 -1px;padding: 0;display: block;position:absolute;top:'+f+"px;left:"+(f+o)+"px;width:"+(n-(2*f)-(2*o))+"px;height:"+((h/2)-f-o)+'px;"><v:fill method="linear" type="gradient" angle="0" color="#ffffff" opacity="0.1" color2="#ffffff" o:opacity2="0.75" /></v:roundrect><v:roundrect arcsize="'+(radius*2)+'%" strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="zoom:1;margin:-1px 0 0 -1px;padding: 0;display: block;position:absolute;top:'+((h/2)-o)+"px;left:"+o+"px;width:"+(n-(2*o))+"px;height:"+((h/2)-o)+'px;"><v:fill method="sigma" type="gradient" angle="180" color="#000000" opacity="0.0" color2="#000000" o:opacity2="0.5" /></v:roundrect></v:group>';a.innerHTML=d+H+r+C;a.className=F;a.style.cssText=k.style.cssText;a.style.visibility="visible";a.src=k.src;a.alt=k.alt;a.width=k.width;a.height=k.height;if(k.id!=""){a.id=k.id}if(k.title!=""){a.title=k.title}if(k.getAttribute("onclick")!=""){a.setAttribute("onclick",k.getAttribute("onclick"))}G.replaceChild(a,k)}}}function addGlossy(){var l=getImages("glossy");var g;var w;var b;var a;var m,c;var u=null;var n=null;var h=0;var t=null;var j=null;var r=0;var f=0.25;var q="";var v="";var p=null;var k=0;var d=0;var o="";for(m=0;m<l.length;m++){g=l[m];w=g.parentNode;b=document.createElement("canvas");if(b.getContext&&g.width>=16&&g.height>=16){q=g.className.split(" ");r=0;j=0;f=0.25;h=0;u=0;t=0;u=getClassValue(q,"iradius");t=getClassColor(q,"ibgcolor");j=getClassColor(q,"igradient");h=getClassAttribute(q,"noshadow");r=getClassAttribute(q,"horizontal");v=getClasses(q,"glossy");b.className=v;b.style.cssText=g.style.cssText;b.style.height=g.height+"px";b.style.width=g.width+"px";b.height=g.height;b.width=g.width;b.src=g.src;b.alt=g.alt;if(g.id!=""){b.id=g.id}if(g.title!=""){b.title=g.title}if(g.getAttribute("onclick")!=""){b.setAttribute("onclick",g.getAttribute("onclick"))}p=Math.min(b.width,b.height)/2;f=u>0?Math.min(Math.max(u,20),50)/100:f;u=Math.max(Math.round(p*f),4);if(h<1){u=Math.round(u/4)*4;d=u/4;n=u*0.75;k=d;c=n;n=c*0.75}else{c=u;k=0;d=u/4;n=u*0.75}a=b.getContext("2d");w.replaceChild(b,g);a.clearRect(0,0,b.width,b.height);if(h<1){glossyShadow(a,0,0,b.width,b.height,u,0.5)}a.save();if(!isNaN(t)&&window.opera){a.globalCompositeOperation="destination-out";a.save();roundedRect(a,k,0,b.width-(k*2),b.height-(k*2),c);a.fillStyle="rgba(0,0,0,1)";a.fill();a.clip();a.clearRect(0,0,b.width,b.height);a.restore();roundedRect(a,k,0,b.width-(k*2),b.height-(k*2),c);a.clip();a.globalCompositeOperation="source-over"}else{roundedRect(a,k,0,b.width-(k*2),b.height-(k*2),c);a.clip()}if(isNaN(t)){if(isNaN(j)){if(r>0){o=a.createLinearGradient(0,0,b.width,0)}else{o=a.createLinearGradient(0,0,0,b.height-(k*2))}o.addColorStop(0,t);o.addColorStop(1,j);a.beginPath();a.rect(0,0,b.width,b.height-(k*2));a.closePath();a.fillStyle=o;a.fill()}else{a.fillStyle=t;a.fillRect(0,0,b.width,b.height-(k*2))}}else{a.clearRect(0,0,b.width,b.height)}a.drawImage(g,k,0,b.width-(k*2),b.height-(k*2));addBright(a,d+k,d,b.width-(2*(d+k)),(b.height/2)-d,n,0.75);addDark(a,k,(b.height/2)-k,b.width-(2*k),(b.height/2)-k,n,0.5);addFrame(a,k,0,b.width-(k*2),b.height-(k*2),c,0.25);b.style.visibility="visible"}}}var glossyOnload=window.onload;window.onload=function(){if(glossyOnload){glossyOnload()}if(isIE){addIEGlossy()}else{addGlossy()}};
