function openWindow(url, width, height){
	dimension = "toolbar=no, location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=600"
	dimension = "toolbar=no, location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no"
	newwin = window.open('/dym1_empty.html', 't', dimension);
	newwin.document.write('<HTML lang="zh-TW">')
	newwin.document.write('<head><meta http-equiv="Content-Language" content="zh-TW"></head>')
	newwin.document.write('<TITLE> Melodic Bard</TITLE>')
	newwin.document.write('<FRAMESET COLS="0,*,100,">')
	newwin.document.write('<FRAME SRC="'+url+'" NAME="dym1_data" BORDER=0 FRAMESPACING=0 FRAMEBORDER="no" NORESIZE SCROLLING=no>')
	newwin.document.write('<FRAME SRC="/dym1_res.html" NAME="dym1_res" BORDER=0 FRAMESPACING=0 FRAMEBORDER="no" NORESIZE SCROLLING=AUTO>')
	newwin.document.write('<FRAME SRC="/dym1_ctrl.html" NAME="dym1_ctrl" BORDER=0 FRAMESPACING=0 FRAMEBORDER="no" NORESIZE SCROLLING=AUTO>')	
	newwin.document.write('</FRAMESET>')
	newwin.document.write('<HEAD>')
	newwin.document.write('</HEAD>')
	newwin.document.write('</HTML>')
	newwin.document.close();
}

function formtable(name, kindex, idx, other){
	var i=0;
	var other1='';
	while (i<other.length){
		if (other.charAt(i)=='-'){
			i++;
			if (other.charAt(i)=='U'){
				other1 = other1 + '<IMG src = icon/update.gif>'
				i++;
			} else if (other.charAt(i)=='N'){
				other1 = other1 + '<IMG src = icon/new1.gif>'
				i++;
			} else if (other.charAt(i)=='V'){
				other1 = other1 + '<IMG src = icon/youtube.gif>'
				i++;
			} else if (other.charAt(i)=='G'){
				other1 = other1 + '<IMG src = icon/Guitar.gif>'
				i++;
			} 
		} else {
			other1 = other1 + other.charAt(i);
			i++;
		}
	}

	if ((total%2)==0) {
	document.write('<tr><td align="center"><font size=-1><a>'+name+'</a></font></td>\
<td align="center"><A href="javascript:openWindow(\'/chords/'+kclass+ Math.floor(kindex/10)+'/c'+kclass+kindex+'s'+idx+'.html\')">view</a></td>\
<td align="center"><font size=-1>'+other1+'</font></td>');
	} else {
	document.write('<td align="center"><font size=-1><a>'+name+'</a></font></td>\
<td align="center"><A href="javascript:openWindow(\'/chords/'+kclass+Math.floor(kindex/10)+'/c'+kclass+kindex+'s'+idx+'.html\')">view</a></td>\
<td align="center"><font size=-1>'+other1+'</font></td></tr>');
	}
	total++;
}
