pics = new Array();

var objCount = 0; // number of (changing) images on web-page

var radio_uno;
var radio_due;
var radio_tre;

function preload(name, first)
{  
// preload images and place them in an array    
    pics[objCount] = new Array(25);
    pics[objCount][0] = new Image();
    pics[objCount][0].src = first;
    pics[objCount][1] = name;
    objCount++;
}


function on2(num)
{
	document.images[pics[0][1]].src = pics[num][0].src;
}


function Pick(num,bnum)
{
var bottone = document.cart_quantity.products_id;
	for(var i=0; i<bottone.length; i++) {
	  if(bottone[i].value){
	    if(!radio_uno){
		var radio_uno=bottone[i].value;
	    }
	    else if(!radio_due){
		var radio_due=bottone[i].value;
	    }
	    else if(!radio_tre){
		var radio_tre=bottone[i].value;
	    }
	  }
	}
   var bottone = document.cart_quantity.products_id;
      for(var i=0; i<bottone.length; i++) {
	if(bottone[i].value==radio_uno){
	  var seleziona_bottone=0;
	}
	else if(bottone[i].value==radio_due){
	  var seleziona_bottone=1;
	}
	else if(bottone[i].value==radio_tre){
	  var seleziona_bottone=2;
	}
	  if(seleziona_bottone==num) {
		bottone[i].checked=true;
	    break;
	  }
      }
   chosen=pics[num][0].src;
	
}


function off()
{
var bottone = document.cart_quantity.products_id;
	for(var i=0; i<bottone.length; i++) {
	  if(bottone[i].value){
	    if(!radio_uno){
		var radio_uno=bottone[i].value;
	    }
	    else if(!radio_due){
		var radio_due=bottone[i].value;
	    }
	    else if(!radio_tre){
		var radio_tre=bottone[i].value;
	    }
	  }
	}
for(var i=0; i<bottone.length; i++) {
  if(bottone[i].checked) {
	if(bottone[i].value==radio_uno){
	  var seleziona_bottone=0;
	}
	else if(bottone[i].value==radio_due){
	  var seleziona_bottone=1;
	}
	else if(bottone[i].value==radio_tre){
	  var seleziona_bottone=2;
	}
	document.images[pics[0][1]].src = pics[seleziona_bottone][0].src;
    break;
  }
}
}

bunchpics = new Array('images/bouquets/0-ball.png','images/bouquets/2-ball.png','images/bouquets/3-ball.png');

var load=0;
preload("link1",bunchpics[load]);
preload("link1",bunchpics[load+1]);
preload("link1",bunchpics[load+2]);

var chosen=bunchpics[0];

