function cObj(elm){return(elm.getContext)?elm.getContext('2d'):null}function createRoundCorner(ctx,r,t,l,c){var x=0,y=0;if(t==true&&l==true){ctx.beginPath();ctx.moveTo(x+r,y+r);ctx.lineTo(x,y+r);ctx.quadraticCurveTo(x,y,x+r,y)}else if(t==true&&l==false){ctx.beginPath();ctx.moveTo(x,y+r);ctx.lineTo(x,y);ctx.quadraticCurveTo(x+r,y,x+r,y+r)}else if(t==false&&l==true){ctx.beginPath();ctx.moveTo(x+r,y);ctx.lineTo(x+r,y+r);ctx.quadraticCurveTo(x,y+r,x,y)}else if(t==false&&l==false){ctx.beginPath();ctx.moveTo(x,y);ctx.lineTo(x+r,y);ctx.quadraticCurveTo(x+r,y+r,x,y+r)}ctx.fillStyle=c||"#ffffff";ctx.fill();return ctx}function buildCorner(id,r,t,l,c){var ctx=document.getElementById(id).getContext('2d');var obj=createRoundCorner(ctx,r,t,l,c)}function addCorners(bgTop,bgBottom){buildCorner("top-left",10,true,true,bgTop);buildCorner("top-right",10,true,false,bgTop);buildCorner("bottom-right",10,false,false,bgBottom);buildCorner("bottom-left",10,false,true,bgBottom)}configureElements=function(){var topleft=document.createElement("canvas");var topright=document.createElement("canvas");var botleft=document.createElement("canvas");var botright=document.createElement("canvas");topleft.setAttribute("height","10");topleft.setAttribute("width","10");topleft.setAttribute("id","top-left");document.getElementById('shadowbox_top_left').appendChild(topleft);topright.setAttribute("height","10");topright.setAttribute("width","10");topright.setAttribute("id","top-right");document.getElementById('shadowbox_top_right').appendChild(topright);botleft.setAttribute("height","10");botleft.setAttribute("width","10");botleft.setAttribute("id","bottom-left");document.getElementById("shadowbox_bottom_left").appendChild(botleft);botright.setAttribute("height","10");botright.setAttribute("width","10");botright.setAttribute("id","bottom-right");document.getElementById("shadowbox_bottom_right").appendChild(botright);if(typeof G_vmlCanvasManager!="undefined"){topleft=(!topleft.getContext)?G_vmlCanvasManager.initElement(topleft):topleft;topright=(!topright.getContext)?G_vmlCanvasManager.initElement(topright):topright;botleft=(!botleft.getContext)?G_vmlCanvasManager.initElement(botleft):botleft;botright=(!botright.getContext)?G_vmlCanvasManager.initElement(botright):botright}var topBG=document.getElementById('shadowbox_top_middle').style.backgroundColor;var botBG=document.getElementById('shadowbox_bottom_middle').style.backgroundColor;addCorners(topBG,botBG)}