/*
* html2canvas v0.30
* Copyright (c) 2011 Niklas von Hertzen. All rights reserved.
* http://www.twitter.com/niklasvh
*
* Released under MIT License
*/
function html2canvas(a,b){this.opts=this.extendObj(b||{},{logging:!1,ready:function(a){document.body.appendChild(a.canvas)},storageReady:function(a){a.Renderer(a.contextStacks)},iframeDefault:"default",flashCanvasPath:"http://html2canvas.hertzen.com/external/flashcanvas/flashcanvas.js",renderViewport:!1,reorderZ:!0,throttle:!0,letterRendering:!1,proxyUrl:null,logger:function(a){window.console&&window.console.log?window.console.log(a):alert(a)},canvasWidth:0,canvasHeight:0,useOverflow:!0,renderOrder:"canvas flash html"});
this.element=a;this.imagesLoaded=0;this.images=[];this.fontData=[];this.numDraws=0;this.contextStacks=[];this.ignoreElements="IFRAME|OBJECT|PARAM";this.needReorder=!1;this.blockElements=/(BR|PARAM)/;this.pageOrigin=window.location.protocol+window.location.host;this.queue=[];this.ignoreRe=RegExp("("+this.ignoreElements+")");this.support={rangeBounds:!1};if(document.createRange){var c=document.createRange();if(c.getBoundingClientRect){var e=document.createElement("boundtest");e.style.height="123px";
e.style.display="block";document.getElementsByTagName("body")[0].appendChild(e);c.selectNode(e);if(c.getBoundingClientRect().height==123)this.support.rangeBounds=!0;document.getElementsByTagName("body")[0].removeChild(e)}}return this}
html2canvas.prototype.init=function(){var a=this;this.log("Finding background-images");this.images.push("start");this.getImages(this.element);this.log("Finding images");this.each(this.element.ownerDocument.images,function(b,c){a.preloadImage(a.getAttr(c,"src"))});this.images.splice(0,1);this.images.length==0&&this.start()};
html2canvas.prototype.start=function(){if(this.images.length==0||this.imagesLoaded==this.images.length/2){this.log("Finished loading "+this.imagesLoaded+" images, Started parsing");this.bodyOverflow=document.getElementsByTagName("body")[0].style.overflow;document.getElementsByTagName("body")[0].style.overflow="hidden";var a=new this.storageContext($(document).width(),$(document).height());a.opacity=this.getCSS(this.element,"opacity");this.parseElement(this.element,this.newElement(this.element,a))}};
html2canvas.prototype.stackingContext=function(a){this.canvas=document.createElement("canvas");this.canvas.width=a;this.canvas.height=a;if(this.canvas.getContext)this.ctx=this.canvas.getContext("2d");this.ctx.textBaseline="bottom";return this.ctx};
html2canvas.prototype.storageContext=function(a,b){this.storage=[];this.width=a;this.height=b;this.fillRect=function(a,b,d,f){this.storage.push({type:"function",name:"fillRect",arguments:[a,b,d,f]})};this.drawImage=function(a,b,d,f,j,h,g,m,o){this.storage.push({type:"function",name:"drawImage",arguments:[a,b,d,f,j,h,g,m,o]})};this.fillText=function(a,b,d){this.storage.push({type:"function",name:"fillText",arguments:[a,b,d]})};return this};
html2canvas.prototype.finish=function(){this.log("Finished rendering");document.getElementsByTagName("body")[0].style.overflow=this.bodyOverflow;this.opts.ready(this)};
html2canvas.prototype.drawBackground=function(a,b,c){var e=this.getCSS(a,"background-image").split(",")[0],d=this.getCSS(a,"background-repeat").split(",")[0];if(typeof e!="undefined"&&/^(1|none)$/.test(e)==!1&&/^(-webkit|-moz|linear-gradient|-o-)/.test(e)==!1){var e=this.backgroundImageUrl(e),f=this.loadImage(e),a=this.getBackgroundPosition(a,b,f);if(f)switch(d){case "repeat-x":this.drawbackgroundRepeatX(c,f,a,b.left,b.top,b.width,b.height);break;case "repeat-y":this.drawbackgroundRepeatY(c,f,a,b.left,
b.top,b.width,b.height);break;case "no-repeat":var e=b.width-a.left,d=b.height-a.top,j=a.left,h=a.top,g=a.left+b.left,m=a.top+b.top;j<0?(j=Math.abs(j),g+=j,e=Math.min(b.width,f.width-j)):(e=Math.min(e,f.width),j=0);h<0?(h=Math.abs(h),m+=h,d=Math.min(b.height,f.height-h)):(d=Math.min(d,f.height),h=0);if(d>0&&e>0){this.drawImage(c,f,j,h,e,d,g,m,e,d);break}default:a.top-=Math.ceil(a.top/f.height)*f.height;for(e=b.top+a.top;e
d+e?d+e-e:f.height,e0&&(a.top+=j),e=Math.floor(e+f.height)-j}else this.log("Error loading background:"+e)}};html2canvas.prototype.backgroundImageUrl=function(a){a.substr(0,5)=='url("'?(a=a.substr(5),a=a.substr(0,a.length-2)):(a=a.substr(4),a=a.substr(0,a.length-1));return a};
html2canvas.prototype.getBackgroundPosition=function(a,b,c){var e=(this.getCSS(a,"backgroundPosition").split(",")[0]||"0 0").split(" "),d;e.length==1&&(a=e,e=[],e[0]=a,e[1]=a);e[0].toString().indexOf("%")!=-1?(d=parseFloat(e[0])/100,a=b.width*d-c.width*d):a=parseInt(e[0],10);e[1].toString().indexOf("%")!=-1?(d=parseFloat(e[1])/100,b=b.height*d-c.height*d):b=parseInt(e[1],10);c={};c.top=b;c.left=a;return c};
html2canvas.prototype.drawbackgroundRepeatY=function(a,b,c,e,d,f,j){var h=Math.min(b.width,f),g;c.top-=Math.ceil(c.top/b.height)*b.height;for(g=d+c.top;gj+d?j+d-g:b.height,this.drawBackgroundRepeat(a,b,e+c.left,g,h,f,e,d),g=Math.floor(g+b.height)};
html2canvas.prototype.drawbackgroundRepeatX=function(a,b,c,e,d,f,j){var j=Math.min(b.height,j),h,g;c.left-=Math.ceil(c.left/b.width)*b.width;for(g=e+c.left;gf+e?f+e-g:b.width,this.drawBackgroundRepeat(a,b,g,d+c.top,h,j,e,d),g=Math.floor(g+b.width)};html2canvas.prototype.drawBackgroundRepeat=function(a,b,c,e,d,f,j,h){var g=0,m=0;j-c>0&&(g=j-c);h-e>0&&(m=h-e);this.drawImage(a,b,g,m,d-g,f-m,c+g,e+m,d-g,f-m)};
html2canvas.prototype.getBorderData=function(a){var b=[],c=this;this.each(["top","right","bottom","left"],function(e,d){b.push({width:parseInt(c.getCSS(a,"border-"+d+"-width"),10),color:c.getCSS(a,"border-"+d+"-color")})});return b};
html2canvas.prototype.drawBorders=function(a,b,c,e){var d=c.left,f=c.top,j=c.width,h=c.height,g=this.getBorderData(a),m=this;this.each(g,function(a,c){if(c.width>0){var l=d,v=f,w=j,p=h-g[2].width;switch(a){case 0:p=g[0].width;break;case 1:l=d+j-g[1].width;w=g[1].width;break;case 2:v=v+h-g[2].width;p=g[2].width;break;case 3:w=g[3].width}w={left:l,top:v,width:w,height:p};e&&(w=m.clipBounds(w,e));w.width>0&&w.height>0&&m.newRect(b,l,v,w.width,w.height,c.color)}});return g};
html2canvas.prototype.newElement=function(a,b){var c=this.getBounds(a),e=c.left,d=c.top,f=c.width,j=c.height,h;h=this.getCSS(a,"background-color");var g=this.getCSS(a,"position"),b=b||{},m=this.setZ(this.getCSS(a,"zIndex"),g,b.zIndex,a.parentNode),o=this.getCSS(a,"opacity"),k={ctx:new this.storageContext,zIndex:m,opacity:o*b.opacity,cssPosition:g};if(b.clip)k.clip=$.extend({},b.clip),k.clip.height-=b.borders[2].width;if(this.opts.useOverflow&&/(hidden|scroll|auto)/.test(this.getCSS(a,"overflow"))&&
!/(BODY)/i.test(a.nodeName))k.clip=k.clip?this.clipBounds(k.clip,c):c;g=m.children.push(k);o=m.children[g-1].ctx;this.setContextVariable(o,"globalAlpha",k.opacity);var l=this.drawBorders(a,o,c);k.borders=l;this.ignoreRe.test(a.nodeName)&&this.opts.iframeDefault!="transparent"&&(h=this.opts.iframeDefault=="default"?"#efefef":this.opts.iframeDefault);f={left:e+l[3].width,top:d+l[0].width,width:f-(l[1].width+l[3].width),height:j-(l[0].width+l[2].width)};k.clip&&(f=this.clipBounds(f,k.clip));f.height>
0&&f.width>0&&(this.newRect(o,f.left,f.top,f.width,f.height,h),this.drawBackground(a,f,o));switch(a.nodeName){case "IMG":(h=this.loadImage(this.getAttr(a,"src")))?this.drawImage(o,h,0,0,h.width,h.height,e+parseInt(this.getCSS(a,"padding-left"),10)+l[3].width,d+parseInt(this.getCSS(a,"padding-top"),10)+l[0].width,c.width-(l[1].width+l[3].width+parseInt(this.getCSS(a,"padding-left"),10)+parseInt(this.getCSS(a,"padding-right"),10)),c.height-(l[0].width+l[2].width+parseInt(this.getCSS(a,"padding-top"),
10)+parseInt(this.getCSS(a,"padding-bottom"),10))):this.log("Error loading :"+this.getAttr(a,"src"));break;case "INPUT":/^(text|url|email|submit|button|reset)$/.test(a.type)&&a.value.length>0&&this.renderFormValue(a,c,k);break;case "TEXTAREA":a.value.length>0&&this.renderFormValue(a,c,k);break;case "SELECT":a.options.length>0&&this.renderFormValue(a,c,k);break;case "LI":this.drawListItem(a,k,f)}return m.children[g-1]};html2canvas.Draw=function(){};
html2canvas.prototype.printText=function(a,b,c,e){this.trim(a).length>0&&(e.fillText(a,b,c),this.numDraws++)};html2canvas.prototype.newRect=function(a,b,c,e,d,f){f!="transparent"&&(this.setContextVariable(a,"fillStyle",f),a.fillRect(b,c,e,d),this.numDraws++)};html2canvas.prototype.drawImage=function(a,b,c,e,d,f,j,h,g,m){a.drawImage(b,c,e,d,f,j,h,g,m);this.numDraws++};
html2canvas.Parse=function(a,b){function c(a){var c=-1;if(b.indexOf)c=b.indexOf(a);else for(var d=0,e=b.length;d-1?b[c+1]:!1}function e(a,b){switch(b){case "lowercase":return a.toLowerCase();case "capitalize":return a.replace(/(^|\s|:|-|\(|\))([a-z])/g,function(a,b,c){return b+c.toUpperCase()});case "uppercase":return a.toUpperCase();default:return a}}function d(a){a=a.replace(/^\s*/g,"");return a.replace(/\s*$/g,"")}function f(a){window.scroll(0,0);if(a.getBoundingClientRect){var a=
a.getBoundingClientRect(),b={};b.top=a.top;b.bottom=a.bottom||a.top+a.height;b.left=a.left;b.width=a.width;b.height=a.height;return b}else return b=$(a).offset(),{left:b.left+p(a,"borderLeftWidth",!0),top:b.top+p(a,"borderTopWidth",!0),width:$(a).innerWidth(),height:$(a).innerHeight()}}function j(a,b){var c=Math.max(a.left,b.left),d=Math.max(a.top,b.top);return{left:c,top:d,width:Math.min(a.left+a.width,b.left+b.width)-c,height:Math.min(a.top+a.height,b.top+b.height)-d}}function h(a,b,c){return!c?
this.zStack=new html2canvas.zContext(0):a!=="auto"?(a=new html2canvas.zContext(a),c.children.push(a),a):c}function g(a,b,c,d){for(var e=c.left,f=c.top,h=c.width,c=c.height,a=function(a){for(var b=[],c=["Top","Right","Bottom","Left"],d=0;d<4;d++)b.push({width:p(a,"border"+c[d]+"Width",!0),color:p(a,"border"+c[d]+"Color",!1)});return b}(a),g=0,i;g<4;g++)if(i=a[g],i.width>0){var l=e,m=f,k=h,t=c-a[2].width;switch(g){case 0:t=a[0].width;break;case 1:l=e+h-a[1].width;k=a[1].width;break;case 2:m=m+c-a[2].width;
t=a[2].width;break;case 3:k=a[3].width}k={left:l,top:m,width:k,height:t};d&&(k=j(k,d));k.width>0&&k.height>0&&o(b,l,m,k.width,k.height,i.color)}return a}function m(a,b,c){for(var d=document.createElement("valuewrap"),e=["lineHeight","textAlign","fontFamily","color","fontSize","paddingLeft","paddingTop","width","height","border","borderLeftWidth","borderTopWidth"],f=0,h=e.length,g;f0&&(i=g-c);h-d>0&&(j=h-d);a.drawImage(b,
i,j,e-i,f-j,c+i,d+j,e-i,f-j);G++}function l(a,b,c,d,e,f,g){var g=Math.min(b.height,g),h,i;c.left-=Math.ceil(c.left/b.width)*b.width;for(i=d+c.left;if+d?f+d-i:b.width,k(a,b,i,e+c.top,h,g,d,e),i=Math.floor(i+b.width)}function v(a,b,c){var c=c.ctx,g=p(a,"fontFamily",!1),h=p(a,"fontSize",!1),j=p(a,"color",!1),l=p(a,"textDecoration",!1),m=p(a,"textAlign",!1),i=p(a,"letterSpacing",!1);b.nodeValue=e(b.nodeValue,p(a,"textTransform",!1));if(d(b.nodeValue).length>0){if(l!=="none"){var k;
if(H[g+"-"+h]!==void 0)k=H[g+"-"+h];else{k=document.createElement("div");E.appendChild(k);$(k).css({visibility:"hidden",fontFamily:g,fontSize:h,margin:0,padding:0});var t=document.createElement("img");t.src="http://html2canvas.hertzen.com/images/8.jpg";t.width=1;t.height=1;$(t).css({margin:0,padding:0});var x=document.createElement("span");$(x).css({fontFamily:g,fontSize:h,margin:0,padding:0});x.appendChild(document.createTextNode("Hidden Text"));k.appendChild(x);k.appendChild(t);var y=t.offsetTop-
x.offsetTop+1;k.removeChild(x);k.appendChild(document.createTextNode("Hidden Text"));$(k).css("lineHeight","normal");$(t).css("verticalAlign","super");t={baseline:y,lineWidth:1,middle:t.offsetTop-k.offsetTop+1};H[g+"-"+h]=t;$(k).remove();k=t}}m=m.replace(["-webkit-auto"],["auto"]);m=F.letterRendering===!1&&/^(left|right|justify|auto)$/.test(m)&&/^(normal|none)$/.test(i)?b.nodeValue.split(/(\b| )/):b.nodeValue.split("");i=p(a,"fontWeight",!1);t=p(a,"fontStyle",!1);a=p(a,"fontVariant",!1);switch(parseInt(i,
10)){case 401:i="bold";break;case 400:i="normal"}c.setVariable("fillStyle",j);c.setVariable("font",a+" "+i+" "+t+" "+h+" "+g);c.setVariable("textAlign","left");a=b;for(h=g=0;h0&&(r.fillText(t,x,y),G++);switch(l){case "underline":o(c,i.left,Math.round(i.top+k.baseline+k.lineWidth),i.width,1,j);break;case "overline":o(c,i.left,i.top,i.width,1,j);break;case "line-through":o(c,i.left,Math.ceil(i.top+k.middle+k.lineWidth),i.width,1,j)}}g+=m[h].length}}}function w(a,b){var d=f(a),e=d.left,t=
d.top,n=d.width,q=d.height,A,i=p(a,"backgroundColor",!1),w=p(a,"position",!1),b=b||{},D=h(p(a,"zIndex",!1),w,b.zIndex,a.parentNode),x=p(a,"opacity");A={ctx:new html2canvas.canvasContext,zIndex:D,opacity:x*b.opacity,cssPosition:w};if(b.clip)A.clip=$.extend({},b.clip),A.clip.height-=b.borders[2].width;if(F.useOverflow===!0&&/(hidden|scroll|auto)/.test(p(a,"overflow"))===!0&&!/(BODY)/i.test(a.nodeName)===!0)A.clip=A.clip?j(A.clip,d):d;w=D.children.push(A);x=D.children[w-1].ctx;x.setVariable("globalAlpha",
A.opacity);var y=g(a,x,d);A.borders=y;I.test(a.nodeName)&&F.iframeDefault!=="transparent"&&(i=F.iframeDefault==="default"?"#efefef":F.iframeDefault);n={left:e+y[3].width,top:t+y[0].width,width:n-(y[1].width+y[3].width),height:q-(y[0].width+y[2].width)};A.clip&&(n=j(n,A.clip));if(n.height>0&&n.width>0){o(x,n.left,n.top,n.width,n.height,i);var r=p(a,"backgroundImage",!1).split(",")[0],s=p(a,"backgroundRepeat",!1).split(",")[0];if(typeof r!=="undefined"&&/^(1|none)$/.test(r)===!1&&/^(-webkit|-moz|linear-gradient|-o-)/.test(r)===
!1){i=r;i.substr(0,5)==='url("'?(i=i.substr(5),i=i.substr(0,i.length-2)):(i=i.substr(4),i=i.substr(0,i.length-1));var r=i,i=c(r),q=(p(a,"backgroundPosition").split(",")[0]||"0 0").split(" "),z,u;q.length===1&&(u=q,q=[],q[0]=u,q[1]=u);q[0].toString().indexOf("%")!==-1?(z=parseFloat(q[0])/100,u=n.width*z-i.width*z):u=parseInt(q[0],10);q[1].toString().indexOf("%")!==-1?(z=parseFloat(q[1])/100,z=n.height*z-i.height*z):z=parseInt(q[1],10);q={};q.top=z;q.left=u;if(i)switch(s){case "repeat-x":l(x,i,q,n.left,
n.top,n.width,n.height);break;case "repeat-y":s=n.left;r=n.top;u=n.height;z=Math.min(i.width,n.width);var v;q.top-=Math.ceil(q.top/i.height)*i.height;for(v=r+q.top;vu+r?u+r-v:i.height,k(x,i,s+q.left,v,z,n,s,r),v=Math.floor(v+i.height);break;case "no-repeat":s=n.width-q.left;r=n.height-q.top;u=q.left;z=q.top;v=q.left+n.left;var B=q.top+n.top;u<0?(u=Math.abs(u),v+=u,s=Math.min(n.width,i.width-u)):(s=Math.min(s,i.width),u=0);z<0?(z=Math.abs(z),B+=z,r=Math.min(n.height,
i.height-z)):(r=Math.min(r,i.height),z=0);if(r>0&&s>0){x.drawImage(i,u,z,s,r,v,B,s,r);G++;break}default:q.top-=Math.ceil(q.top/i.height)*i.height;for(s=n.top+q.top;sr+s?r+s-s:i.height,s0&&(q.top+=u),s=Math.floor(s+i.height)-u}else html2canvas.log("Error loading background:"+r)}}switch(a.nodeName){case "IMG":i=a.getAttribute("src");(A=c(i))?(i=p(a,"paddingLeft",
!0),n=p(a,"paddingTop",!0),q=p(a,"paddingRight",!0),s=p(a,"paddingBottom",!0),x.drawImage(A,0,0,A.width,A.height,e+i+y[3].width,t+n+y[0].width,d.width-(y[1].width+y[3].width+i+q),d.height-(y[0].width+y[2].width+n+s)),G++):html2canvas.log("Error loading :"+i);break;case "INPUT":/^(text|url|email|submit|button|reset)$/.test(a.type)&&a.value.length>0&&m(a,d,A);break;case "TEXTAREA":a.value.length>0&&m(a,d,A);break;case "SELECT":a.options.length>0&&m(a,d,A)}return D.children[w-1]}function p(a,b,
c){return c!==void 0&&c===!0?parseInt(html2canvas.Util.getCSS(a,b),10):html2canvas.Util.getCSS(a,b)}function t(a,b){if(p(a,"display")!=="none"&&p(a,"visibility")!=="hidden"&&(b=w(a,b)||b,!I.test(a.nodeName)))for(var c=$(a).contents(),d=0,e=c.length,h;d0?(c.push(a),e.push(a.zindex)):d.push(a);e.sort(function(a,b){return a-b});f=0;for(o=e.length;f0&&l.arguments[7]&&a.drawImage(l.arguments[0],l.arguments[1],l.arguments[2],l.arguments[3],l.arguments[4],l.arguments[5],l.arguments[6],l.arguments[7],l.arguments[8])}c.clip&&a.restore()}return f}var e={width:0,height:0},d=[];switch("canvas"){case "canvas":var f=document.createElement("canvas");if(f.getContext)return c(a)}return this};html2canvas.prototype.throttler=function(){};
html2canvas.prototype.canvasRenderContext=function(a,b){b.textBaseline="bottom";var c=this;a.clip&&(b.save(),b.beginPath(),b.rect(a.clip.left,a.clip.top,a.clip.width,a.clip.height),b.clip());a.ctx.storage&&c.each(a.ctx.storage,function(a,d){switch(d.type){case "variable":b[d.name]=d.arguments;break;case "function":d.name=="fillRect"?b.fillRect(d.arguments[0],d.arguments[1],d.arguments[2],d.arguments[3]):d.name=="fillText"?b.fillText(d.arguments[0],d.arguments[1],d.arguments[2]):d.name=="drawImage"?
d.arguments[8]>0&&d.arguments[7]&&b.drawImage(d.arguments[0],d.arguments[1],d.arguments[2],d.arguments[3],d.arguments[4],d.arguments[5],d.arguments[6],d.arguments[7],d.arguments[8]):c.log(d)}});a.clip&&b.restore()};html2canvas.prototype.canvasRenderStorage=function(a,b){for(;00){if(j!="none")var m=this.fontMetrics(e,d);h=h.replace(["-webkit-auto"],["auto"]);e=this.opts.letterRendering==!1&&/^(left|right|justify|auto)$/.test(h)&&
/^(normal|none)$/.test(g)?b.nodeValue.split(/(\b| )/):b.nodeValue.split("");this.setFont(c,a,!1);a=b;for(b=0;b-1)return this.fontData[c+1];c=document.createElement("div");document.getElementsByTagName("body")[0].appendChild(c);$(c).css({visibility:"hidden",fontFamily:a,fontSize:b,margin:0,padding:0});var e=document.createElement("img");e.src="http://html2canvas.hertzen.com/images/8.jpg";e.width=1;e.height=1;$(e).css({margin:0,padding:0});var d=document.createElement("span");$(d).css({fontFamily:a,fontSize:b,margin:0,
padding:0});d.appendChild(document.createTextNode("Hidden Text"));c.appendChild(d);c.appendChild(e);var f=e.offsetTop-d.offsetTop+1;c.removeChild(d);c.appendChild(document.createTextNode("Hidden Text"));$(c).css("line-height","normal");$(e).css("vertical-align","super");e={baseline:f,lineWidth:1,middle:e.offsetTop-c.offsetTop+1};this.fontData.push(a+"-"+b);this.fontData.push(e);$(c).remove();return e};
html2canvas.prototype.textTransform=function(a,b){switch(b){case "lowercase":return a.toLowerCase();case "capitalize":return a.replace(/(^|\s|:|-|\(|\))([a-z])/g,function(a,b,d){return b+d.toUpperCase()});case "uppercase":return a.toUpperCase();default:return a}};html2canvas.prototype.trim=function(a){return a.replace(/^\s*/,"").replace(/\s*$/,"")};
html2canvas.prototype.parseElement=function(a,b){var c=this;this.each(a.children,function(a,d){c.parsing(d,b)});this.log("Render queue stored");this.opts.storageReady(this);this.finish()};html2canvas.prototype.parsing=function(a,b){if(this.getCSS(a,"display")!="none"&&this.getCSS(a,"visibility")!="hidden"){var c=this,b=this.newElement(a,b)||b;this.ignoreRe.test(a.nodeName)||this.each(this.contentsInZ(a),function(e,d){d.nodeType==1?c.parsing(d,b):d.nodeType==3&&c.newText(a,d,b)})}};
html2canvas.prototype.log=function(a){this.opts.logging&&this.opts.logger(a)};html2canvas.logging=!0;html2canvas.log=function(a){html2canvas.logging&&window.console.log(a)};html2canvas.prototype.withinBounds=function(a,b){return!a?!0:(a.left<=b.left||b.left+b.width0?(b.push(f),c.push(f.zindex)):e.queue.push(f)});c.sort(function(a,b){return a-b});this.each(c,function(a,c){for(var j=0;j<=b.length;j++)if(b[j].zindex==c){j=b.splice(j,1);e.sortZ(j[0]);break}})};
html2canvas.prototype.getContents=function(a){return a.nodeName=="iframe"?a.contentDocument||a.contentWindow.document:a.childNodes};html2canvas.Util={};html2canvas.Util.backgroundImage=function(a){a.substr(0,5)==='url("'?(a=a.substr(5),a=a.substr(0,a.length-2)):(a=a.substr(4),a=a.substr(0,a.length-1));return a};html2canvas.Util.getCSS=function(a,b){return jQuery(a).css(b)};html2canvas.Util.Extend=function(a,b){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b};
html2canvas.prototype.getCSS=function(a,b,c){return c?parseInt($(a).css(b),10):$(a).css(b)};html2canvas.prototype.getIndex=function(a,b){if(a.indexOf)return a.indexOf(b);else{for(var c=0;c