// JavaScript Document
function itemline (s_name, s_alias, s_description, s_pic, s_link)
{
	this.name = s_name;
	this.alias = s_alias;
	this.description = s_description;
	this.pic = s_pic;
	this.link = s_link;
}

var o_product = new Array();

function f_addproduct (i_plist, s_path)
{
	for (var i = 0; i < i_plist.length; i++)
		f_additemline (o_product[i_plist[i]].name, o_product[i_plist[i]].alias, o_product[i_plist[i]].description, s_path + "images/" + o_product[i_plist[i]].pic, s_path + o_product[i_plist[i]].link);
}

function f_additemline (s_title, s_alias, s_description, s_pic, s_link)
{
	var s_content = '<tr>'
		+ '<td width=120><a href="' + s_link + '"><img src="' + s_pic + '" width="88" height="88" align=left class="picborder" alt="' + s_title + '"></a></td>'
		+ '<td valign="top"><h2>' + s_title + '&nbsp;<i>' + s_alias + '</i></h2><p>' + s_description + '</p>'
		+ '<img src="../../style/images/rightgreenarrow.gif" width=12 height=8><a href="' + s_link + '">点击进入...</a></td>'
		+ '</tr>';
	document.writeln (s_content);
}

function f_addrelproduct(s_products)
{
	document.write ('<br><h2>相关产品：</h2><table border=0 cellspacing=0 cellpadding=0><tr>');
	for (var i in s_products)
		document.write ('<td height=100 valign="top"><a href="../' + o_product[s_products[i]].link + '"><img src="../images/' + o_product[s_products[i]].pic + '" width="88" height="88" align=left class="picborder"></a></td><td width=20></td>');
	document.write ('</tr><tr>');
	for (var i in s_products)
		document.write ('<td width=88 valign="top"><a href="../' + o_product[s_products[i]].link + '">' + o_product[s_products[i]].name + '&nbsp;<i>' + o_product[s_products[i]].alias + '</i></a></td><td width=20></td>');
	document.write ('</tr></table>');
}

function f_buildtabbedpage (s_tabs)
{
	f_buildtab (s_tabs, "top");
	document.write ('<div id="pagecontent"></div>');
	f_buildtab (s_tabs, "bottom");
	f_showcontent(0, s_tabs.length);
}

function f_buildtab(s_tabs, s_mode)
{
	document.write ('<div id="pagetab"><table width=100% cellspacing=0 cellpadding=0 bgcolor="#DEDCD8"><tr height=38 align="center" valign="middle">');
	for (var i in s_tabs)
		document.write ('<td width=80 id="' + s_mode + 'tab' + i + '"><a href="JavaScript: f_showcontent(' + i + ', ' + s_tabs.length + ');">' + s_tabs[i] + '</a></td>');
	document.write ('<td>&nbsp;</td></tr></table></div>');
}

function f_showcontent(i_partid, i_max)
{
	var s_mode = new Array ("top", "bottom");
	for (var i in s_mode)
	{
		for (var j = 0; j < i_max; j++)
		{
			if (j == i_partid)
				document.getElementById(s_mode[i] + "tab" + j).className = s_mode[i] + "buttonin";
			else
				document.getElementById(s_mode[i] + "tab" + j).className = s_mode[i] + "buttonout";
		}
	}
	document.getElementById("pagecontent").innerHTML = '<br>' + document.getElementById("part" + i_partid).innerHTML + '<br>';
}

function f_addcurve (s_title, s_desc, s_curve, s_bigcurve, i_width, i_height)
{
	document.write ('<h3>' + s_title + '</h3><p>' + s_desc + '</p><p><a href="javascript: o_newwindow=window.open(\'' + s_bigcurve + '\', \'_blank\', \'width=' + eval(i_width + 20) + ' height=' + eval(i_height + 20) + '\');o_newwindow.focus();"><img src="' + s_curve + '" border=0></a></p><br>');
}

function f_addline (s_news, s_link, s_date)
{
	var s_content = '<tr><td><img src="../style/images/greenball.gif" width="12" height="12" /></td>';
	if (s_link != "")
		s_content += '<td><a href="' + s_link + '">' + s_news + '</a></td>';
	else
		s_content += '<td>' + s_news + '</td>';
	if (s_date != "") s_content	+= '<td width=20></td><td>' + s_date + '</td>';
	s_content += '</tr>';
	document.writeln (s_content);
}

function f_addmore (s_link)
{
	document.write ('<table width=100% border=0 cellspacing=0 cellpadding=0><tr height=20 valign="top"><td>......</td><td align="right"><a href="' + s_link + '">点击进入...</a></td></tr></table><hr>');
}
