

var where = new Array(4);
function comefrom(loca,locacity) {
	this.loca = loca;
	this.locacity = locacity;
}
where[0]= new comefrom("请选择","请选择");
where[1] = new comefrom("MP3","请选择|YP-S1|YP-U5|YP-U4|YP-S2" );
where[2] = new comefrom("MP4","请选择|YP-R0|YP-R1|YP-CM3|YP-P3|YP-Q2|YP-CP3");
where[3] = new comefrom("录音笔","请选择|YP-VX1|YP-VP1|YV-150");

function select(province,city) {
	
	with(document.getElementById(province)) {
		var loca2 = options[selectedIndex].value;
   	}
	for(i = 0;i < where.length;i ++) {
		if (where[i].loca == loca2) {

			loca3 = (where[i].locacity).split("|");
			for(j = 0;j < loca3.length;j++) {
				with(document.getElementById(city)) {
				length = loca3.length;
					options[j].text = loca3[j];
					options[j].value = loca3[j];
					var	loca4=options[selectedIndex].value;
				}
			}
			break;
		}
	}

}

function init(province,city,provincename,cityname) {
        var dd=0;
	with(document.getElementById(province)) {
	length = where.length;
		for(k=0;k<where.length;k++) {
			options[k].text = where[k].loca;
			//alert(options[k].text);
			options[k].value =	where[k].loca;
                        if(provincename==where[k].loca)
                        {
                        options[k].selected=true;
                        dd=k;
                        }
		}
			options[selectedIndex].text = where[dd].loca;
			options[selectedIndex].value = where[dd].loca;
	}
	with(document.getElementById(city)) {
		loca3 = (where[dd].locacity).split("|");
		length = loca3.length;

			for(l=0;l<length;l++) {
				options[l].text = loca3[l];
				options[l].value = loca3[l];

                        if(cityname==loca3[l])
                        options[l].selected=true;
			}
//			options[selectedIndex].text = loca3[0];
//			options[selectedIndex].value = loca3[0];
		}
}

