//使用说明
// [AreaID] 该特效整体编号
// [ButtonIndex]切换按钮编号
//-------------------------------------------------------------------------------------------------
// 切换菜单按钮命名 Area_[AreaID]_tbc_[ButtonIndex] 
// 例：<td align="center" class="column_1" id="Area_1_tbc_2" onmouseover="FT(1,2)"> Qingdao</td>
// 按钮css命名 column_[AreaID]  选中状态 column_[AreaID]_Sel
//-------------------------------------------------------------------------------------------------
// 显示主幕布命名  Area_[AreaID]_show
// --------------------------------------------------------------------
// 实际栏目组内容容器命名 Area_[AreaID]_container_tbc
// --------------------------------------------------------------------
// 实际栏目容器命名 Area_[AreaID]_td_[ColumnIndex]
var Area = new Array();
Area[0] = new Array();		//0 tba 1 count 2 selnum
Area[1] = new Array();
Area[2] = new Array();
Area[3] = new Array();
function G(i){return document.getElementById(i);}  //根据id获取标记对象

function InitArea(i)
{
		
	var tbcTable;
    tbcTable = G('Area_'+i+'_container_tbc');
	if(tbcTable !=null)
    {
		var node;
        Area[i][0] = new Array();
		Area[i][1] = tbcTable.rows.length;
		Area[i][2] = null;
		
		for(var x=0;x<Area[i][1];x++)
        {
            node = G('Area_'+i+'_td'+x);
            Area[i][0][x] = node.innerHTML;
        }
		
		tbcTable.style.visibility = 'hidden';
	}
	else
	{
		alert('未能获取表格Area_'+i+'_container_tbc');	
	}

}


function FT(i,j)
{
    var render = G('Area_'+i+'_show');
    var seltab = G('Area_'+i+'_tbc_'+j);
	var selnexttab = G('Area_'+i+'_tbc_'+(j+1));    

		
    if(Area[i][2] != null && Area[i][2] != j)
    {
		var old = G('Area_'+i+'_tbc_'+Area[i][2]);
        old.className = 'column_'+i;
		
		var oldnext = G('Area_'+i+'_tbc_'+(Area[i][2]+1));
		
		if(oldnext != null)
		{
			oldnext.className = 'column_'+i;
		}
    }
	
	seltab.className = 'column_'+i+'_Sel';
	//if(selnexttab != null)
	//{
	//	selnexttab.className = 'column_'+i+'_next';
	//}
	
    if(render != null && Area[i][2] != j)
    {
        render.innerHTML = Area[i][0][j];
    }
    Area[i][2] = j;
    
    
}