//html のBODYタグでinitdata()をロードすること
n = 1;

function makeArray(num_deco) {
        this.length = num_deco;
        for (i = 0; i < num_deco; i++) {
		this[i] = 1
	}
}

function initdata(data1, data2, data3, data4, data5) {
directory = data1;
picture = data2;
part_ext = data3;
img_ext = data4;
pic_max = data5;
deco = new makeArray(pic_max + 1)
}



function ModelPicker(pickList, location)
// pickList is array of images in <select> list
// location is name of image tag
// directory is where image is stored
{       
pic_num = 1;

if(version == "supported")
        {       
		while(pic_num <= pic_max){
		picture = pickList.options[pickList.selectedIndex].value;
		document.images[location + pic_num].src = eval("directory + picture + part_ext + deco[pic_num] + img_ext");
		pic_num = pic_num + 1;
		}
}       }

function lotate(i, pic_num) {
if (deco[i] == pic_num){
deco[i] = 1;
}
else{
deco[i] = deco[i] + 1;
}
	document.images["nam"+i].src=(directory + picture + part_ext + deco[i] + img_ext);

}

function DesignPicker(pickList, location)
// pickList is array of images in <select> list
// location is name of image tag
// directory is where image is stored
{  
n = 1;     
patern = pickList.options[pickList.selectedIndex].value;
	while(n <= pic_max)
	{
	deco[n] = parseInt(patern.charAt(n - 1));
	n = n + 1;
	}
pic_num = 1;
	if(version == "supported")
        {       
		while(pic_num <= pic_max){
		document.images[location + pic_num].src = eval("directory + picture + part_ext + deco[pic_num] + img_ext");
		pic_num = pic_num + 1;
		}
}       }

