    window.onresize = RepositionAllClips;
    window.onload = StartUp;
    
    function StartUp(){
        CheckSavedBoxes();
        RepositionAllClips();
    }
    
    function RepositionAllClips(){
        RepositionClip(1);
    }
    
    function RepositionClip(num){  //repositions the paperclip in the center of the cssclipbox
        var checklistid = 'checklist' + num;
        var imageid = 'clip' + num;    
    
        var checklist = document.getElementById(checklistid);
        var image = document.getElementById(imageid);        
        
        var pos = findPos(checklist); //pos[0] = left pos[1] = top
        var checklistleft = pos[0];
        var checklisttop = pos[1];
        var checklistwidth = checklist.offsetWidth;
        if(!checklistwidth ) { checklistwidth = getElementWidth(checklist); }        
    
        var imagewidth = image.offsetWidth ;
        if(!imagewidth) { imagewidth = getElementWidth(image); }
        
        var newleft = checklistleft + (checklistwidth - imagewidth) / 2;
    
    
        image.style.top = (checklisttop - 40) + 'px';
        image.style.left = newleft + 'px';
        image.style.visibility = "visible";

    }
    
    function CheckSavedBoxes(){
        var ok = 1;
        var i = 0;
        while(ok == 1){
            i++;
            var chkid = checkidprefix+i; // checkidprefixshould be definined in all pages using checks
            //for example, the buyer preclosing checklist is using bpcchk1, so they would declare var checkidprefix='bpcchk';
            
            if(readCookie(chkid)=='checked'){
                document.getElementById(chkid).src = "/images/ClosingGuides/checkbox-checked.jpg";
            }
            if(i > 30){ ok=2}
        }
    }
    
    function updateCheckbox(el) {
        src = el.src;
        if (src.indexOf('-checked')==-1) {//check the box b/c it is currently unchecked
            el.src = "/images/ClosingGuides/checkbox-checked.jpg";
            createCookie(el.id,'checked',30);//remember for thirty days
        } else {
             el.src = "/images/ClosingGuides/checkbox.jpg";
            createCookie(el.id,'',30);//remember for thirty days
        }    
    }
