	var row;
	var col;
	var num=16;
	var capNum=num-1;
	var rowCount;
	var extraRow;
	var extraCol;

	if(num%4==0){
	//For the straight forward multiples of 4
	rowCount=(num/4)*2;
	extraRow=rowCount;
	extraCol=4;
	}
	else{
	//Other than the multiples of 4
	//Reduce the pic count to a multiple of 4
	//Add 1 row to absorb the last 1,2,3 pics
	rowCount=(((num-(num%4))/4))*2+2;
	extraRow=rowCount-2;
	}

	if(num%4==1){
	//extraRow=rowCount-2;
	extraCol=1;
	}

	if(num%4==2){
	//extraRow=rowCount-2;
	extraCol=2;
	}

	if(num%4==3){
	//extraRow=rowCount-2;
	extraCol=3;
	}

    function changecake(num2)
	{

	       document.swapper.src='/cart/cakespic/numbercake/thbnumber0'+num2+'.jpg';
	}

	for(row=1;row<=rowCount;row++){
	   document.write('<tr>');
	   if(row%2==1){
	   for(col=1;col<=4;col++){
	   //if(num==14){num--;};
	   if((row>extraRow) && (col>extraCol)){
	   document.write('<td align="center" width="100"></td>')
	   }
	   else{
	   document.write('<td align="center" width="100"><font size="1" face="Arial"><a href="/cart/cakespic/numbercake/number0' + num + '.htm">Go to this cake</a></font><br><font size="2" face="Arial"><a href="/cart/cakespic/numbercake/regnumber0' + num + '.jpg" target="_top"><img src="/cart/cakespic/numbercake/thbnumber0' + num + '.jpg" border="0"></a></font></td>');
	   num--;}
	     }
	   }
	   else{
	   for(col=1;col<=4;col++){
	   //if(capNum==13){capNum--;};
	   if((row>extraRow) && (col>extraCol)){
	   document.write('<td width="100" align="center"></td>')
	   }
	   else{
	   document.write('<td bgcolor="#B6C7E5" width="100" align="center"><font size="2" face="Arial" color="#000000">' +designer_img[capNum]+ '</font></td>');
	   capNum--;}
	                          }
	   }
	   document.write('</tr>');
	   }

