function swapImage (obj, idx) {

	var arrThumbs = strThumbs.split(",");
	var arrNormal = strNormal.split(",");
	var arrLarge = strLarge.split(",");
	//Swap target slot with slot 0
	var tmp = arrSlots[0];
	arrSlots[0] = arrSlots[idx];
	arrSlots[idx] = tmp;

	//Slot 0 is the main image	
	$('#main_image').attr('src', arrNormal[arrSlots[0]]);
	$('#mainimage .thickbox').attr('href', arrLarge[arrSlots[0]]);
	
	//render the remaining images as thumbs
	for (var x=1;x<arrThumbs.length+1;x++) {
		$('#thumb_' + x).attr('src', arrThumbs[arrSlots[x]]);
	}

}
