function changeList( listname, source, key, all ) {
	var list = eval(document.getElementById(listname));

	// empty the list
	for (i in list.options.length) {
		list.options[i] = null;
	}
	i = 0;

	if(all) {
	// make option all
		opt = new Option();
		opt.value = 0;
		opt.text = all;

		list.options[i++] = opt;
	}
	for (x in source) {
		if (source[x][0] == key) {
			opt = new Option();
			opt.value = source[x][1];
			opt.text = source[x][2];

			list.options[i++] = opt;
		}
	}
	list.length = i;
}

var j=0;

function changePicture(i) {
	document.getElementById('mainFrame').src = 'blank.gif';
	document.getElementById('content_en').innerHTML = 'loading...';
	timeOut = window.setTimeout(function sleep() {}, 500);
	window.clearTimeout(timeOut);
	document.getElementById('mainFrame').title = textArray[i][3];
	document.getElementById('flashlink').title = textArray[i][6];
	document.getElementById('mainFrame').width = textArray[i][0];
	document.getElementById('mainFrame').height = textArray[i][1];
	document.getElementById('content_en').innerHTML = textArray[i][6];
	document.getElementById('flashlink').href = textArray[i][7];
	document.getElementById('mainFrame').src = textArray[i][2];
	target = "_blank";
	if(textArray[i][7] == "#") {
		document.getElementById('flashlink').href = document.URL + "#";
		target = "_self";
	}
	document.getElementById('flashlink').target = target;

	j = i;
}

function changePictureHomePage(i) {
	document.getElementById('mainFrame').src = 'blank.gif';
	document.getElementById('content_en').innerHTML = 'loading...';
	timeOut = window.setTimeout(function sleep() {}, 500);
	window.clearTimeout(timeOut);
	document.getElementById('mainFrame').title = textArray[i][3];
	document.getElementById('mainFrame').width = textArray[i][0];
	document.getElementById('mainFrame').height = textArray[i][1];
	document.getElementById('content_en').innerHTML = textArray[i][6];
	document.getElementById('mainFrame').src = textArray[i][2];

	j = i;
}

function change(sign) {
	var total = textArray.length-1;

	j += eval(sign);
	if(j>total) {
		nextPage();
		j = total;
		return;
	}
	if(j<0) {
		prevPage();
		j = 0;
		return;
	}
	changePicture(j);
}

function winOpen(url, target) {
	if(!target) target= '_self';
	window.open(url, target);
}