/* 'idea[s] for a [modern] painting' © Graham Budgett 2009-2011 */

function sketch() {
sw=screen.availWidth; sh=screen.availHeight; wh=window.innerHeight
window.moveTo(0,0); window.resizeTo(sw,sh);
col=["white","blue","green","red","black"];
bord=["solid","inset","ridge"];
oi=["","inset"];
bg="rgb("+Math.floor(Math.random()*255)+", "+Math.floor(Math.random()*255)+", "+Math.floor(Math.random()*255)+") ";
    for (i=0; i<=8; i++) {
    sq=Math.floor(Math.random()*135);          r=Math.floor(Math.random()*135);
    w=Math.floor(Math.random()*sw);             h=Math.floor(Math.random()*wh);
    bw=Math.floor(Math.random()*200);         bz=Math.floor(Math.random()*100);
    bl=Math.floor(Math.random()*sw)-(sw/2); bt=Math.floor(Math.random()*wh)-(wh/2);
    bc=Math.floor(Math.random()*col.length); bs=Math.floor(Math.random()*bord.length);
    io=Math.floor(Math.random()*oi.length);   bo=Math.random();                
    s1=Math.floor(Math.random()*100);          s2=Math.floor(Math.random()*100);
    r1=Math.floor(Math.random()*200);          r2=Math.floor(Math.random()*200);
    r3=Math.floor(Math.random()*200);          r4=Math.floor(Math.random()*200);
    p=Math.floor(Math.random()*100);    
    canvas=document.getElementById("canvas"); bow=document.createElement("div");
    bow.setAttribute("style","position:absolute; width:"+(-w)+"px; height:"+(-h)+"px;"
    +"left:"+ bl +"px; top:"+bt+"px; opacity:"+bo+"; z-index:"+bz+"; "
    +" padding:"+(p+100)+"px; border:"+(bw+100)+"px "+bord[bs]+" "+col[bc]+"; "
    +"-webkit-box-shadow:"+oi[io]+" "+r1+"px "+r2+"px "+(s1+100)+"px "+(s2+100)+"px "+col[bc]+", "
    +oi[io]+" "+r3+"px "+r4+"px "+(s2+100)+"px "+(s1+100)+"px "+col[bc]+"; " 
    +"-moz-box-shadow:"+oi[io]+" "+r1+"px "+r2+"px "+(s1+100)+"px "+(s2+100)+"px "+col[bc]+", "
    +oi[io]+" "+r3+"px "+r4+"px "+(s2+100)+"px "+(s1+100)+"px "+col[bc]+"; "
    +"-moz-border-radius:"+(r1+200)+"px "+(r2+200)+"px "+(r3+200)+"px "+(r4+200)+"px; "
    +"-webkit-border-radius:"+(r1+200)+"px "+(r2+200)+"px "+(r3+200)+"px "+(r4+200)+"px; "
    +"-moz-transform:skew("+sq+"deg) rotate("+r+"deg); -webkit-transform:skew("+sq+"deg) rotate("+r+"deg); ");
    canvas.appendChild(bow); 
    if(i == 8){break;}
    }
    canvas.style.backgroundColor=bg;
}   
