function getPriceDateList() {
	document.writeln('<option value="'+pricedate[0]+'" selected>'+pricedate[0]+'</option>');
	for (i=1; i<pricedate.length; i++) {
		document.writeln('<option value="'+pricedate[i]+'">'+pricedate[i]+'</option>');
	}
}

function chgPriceDate(d) {
	for (i=0; i<fundcode.length; i++) {
		temp = d+"-"+fundcode[i];
		temp1 = document.getElementById("offer"+fundcode[i]);
		clearChild(temp1);
		if (offerprice[temp]) {
			temp1.appendChild(createText(offerprice[temp]));		
		} else {
			temp1.appendChild(createText("--"));		
		}
		temp1 = document.getElementById("bid"+fundcode[i]);
		clearChild(temp1);
		if (bidprice[temp]) {
			temp1.appendChild(createText(bidprice[temp]));		
		} else {
			temp1.appendChild(createText("--"));		
		}
	}
	clearChild(document.getElementById("price_date"));
	document.getElementById("price_date").appendChild(createText("Valuation Day: "+d));
}	

function clearChild(obj) {
	while(obj.childNodes.length > 0) {
		obj.removeChild(obj.childNodes[0]);
	}
}

function createText(textcontent) {
    return document.createTextNode(textcontent);
}
