<!--
// global
var sunbo_ntab_count = new Array();
var sunbo_ntab_width = null;
var sunbo_ntab_height = null;
var sunbo_ntab_list = null;

// switch the table pannel
function sunbo_ntab_switch(i, n)
{
	// check the arguments
	if (i >= sunbo_ntab_count.length) return;
	if (n < 0 || n > sunbo_ntab_count[i]) return;

	// switch the display
	for (var k = 0; k <= sunbo_ntab_count[i]; k++)
	{
		var xn = document.getElementById('sunbo-ntab-n' + i + '-' + k);
		var xc = document.getElementById('sunbo-ntab-c' + i + '-' + k);		
		if (!xn || !xc) return;
		if (k == n)
		{
			xn.className = xn.className.replace('normal', 'active');
			document.getElementById('sunbo-ntab-c' + i).innerHTML = xc.innerHTML;
		}
		else
		{
			xn.className = xn.className.replace('active', 'normal');
		}
	}
}

// create the tab
function sunbo_ntab_create()
{
    // init the parameters
	var width = sunbo_ntab_width;
	var height = sunbo_ntab_height;
	var list = sunbo_ntab_list;

	if (width == null || list == null) return;
	var num = list.length - 2;
	if (num < 0) return;
	if (height == null) height = 28;

	// create the table
	var count = sunbo_ntab_count.length;
	sunbo_ntab_count[count] = num;
	document.writeln('<table border=0 cellspacing=0 cellpadding=0 width=' + width + ' height=' + height + ' align=center class="ntab_box">');
	document.writeln('<tr class="ntab_head">');

	// head
	for (var i = 0; i <= num; i++)
	{
	    var cname = 'ntab_normal';
		if (i < num) cname = 'ntab_notend ' + cname;
		document.writeln('<td align=center class="' + cname + '" id="sunbo-ntab-n' + count + '-' + i + '" onmouseover="sunbo_ntab_switch(' + count + ',' + i + ')">' + list[i][0] + '</td>');
	}
	document.writeln('</tr>');

	// body
	document.writeln('<tr><td colspan="' + (num+1) + '" valign="top"><div class="ntab_content" id="sunbo-ntab-c' + count + '"></div></td></tr></table>');

	// every list
	for (var i = 0; i <= num; i++)
	{
		var myid = 'sunbo-ntab-c' + count + '-' + i;
		var myurl ='news/jshtml.asp?a='+ escape(list[i][1]);
		document.writeln('<script type="text/javascript" src="' + myurl + '&id=' + myid + '"></' + 'script>');
	}

	// destroy the value
	sunbo_ntab_width = null;
	sunbo_ntab_height = null;
	sunbo_ntab_list = null;

	// show the first pannel
	var init_func = function () { sunbo_ntab_switch(count, 0); }
	if (typeof window.attachEvent != 'undefined') { window.attachEvent('onload', init_func); }
	else if (typeof window.addEventListener != 'undefined')	{ window.addEventListener('load', init_func, false); }
	else { window.setTimeout('sunbo_ntab_switch(' +  count + ', 0)', 1000); }
}
//-->


