no problem 
Since you had only 2 checkboxes, I thought it was easier to just check whether each was checked or not and assign the appropriate values for a and b using a 'shorhand' version of if-else.
I then also had to reverse the order of a and b in your image path to get the order of paths to match your required order.
You could have also done it the way you had as well but you had logic errors in your code. Your code logic was based on your previous scenario where you had 4 radio buttons and so was not correct for this case with 2 checkboxes.
One way of doing it your way is:
function newpic() {
var radBtns = new Array();
//get all the radio buttons
radBtns = document.getElementById("box").getElementsByTagName("input");
//assign the values to a and b
for(var i=0; i < radBtns.length; i=i+1) {
if(radBtns[0].checked) a = 2; else a = 1;
if(radBtns[1].checked) b = 2; else b = 1;
}
alert(b+"/"+a+"/1.png");
document.getElementById("b1").src =b+"/"+a+"/1.png";
}