var syncStatusEn = ["No Sync", "188 Pkt Sync", "204 Pkt Sync"];
var syncStatusCn = ["未同步", "188包同步", "204包同步"];
var syncStatus = [syncStatusEn, syncStatusCn];

var objIdArray = ["syncStatus", "inputBitrate"];
var ROW_NUM = 2;

window.onresize = function()
{
	GetMainContentHeight(BUTTON_TOP_MENU, NO_BUTTON_CHANGE);
}

$(document).ready(function()
{
	var args = GetArgs();
	slotNo = parseInt(args["slotNo"], 10);
	portNo = parseInt(args["portNo"], 10);
	GetMainContentHeight(BUTTON_TOP_MENU, NO_BUTTON_CHANGE);
	funcUpdateDisplay();
	setInterval("displayParam();", 10000);
});

function funcUpdateDisplay() 
{
	DisableButton("refreshBtn");
	PageLoadStatus(true);
	
	displayParam();
	
	EnableButton("refreshBtn");
	PageLoadStatus(false);
}

function displayParam()
{
	var data;
	var sectionData;
	var response;
	var length;
	var xmlHttp = GetHTTPObject();
	
	xmlHttp.open("GET", "/goform/formEMR30?type=" + PORT_CON_IN_MONITOR + "&cmd=" + GET + 
		"&language=" + language + "&slotNo=" + slotNo + "&portNo=" + portNo + "&ran=" + Math.random(), true);
	xmlHttp.onreadystatechange = function()
	{
		if((xmlHttp.readyState == 4) && (xmlHttp.status == 200))
		{
			response = AjaxStrDeal(xmlHttp.responseText);						
			if(response != "")
			{
				data = response.split(FIRST_DELIMITER);
				for(var i = 0; i < ROW_NUM; i++)
				{
					if(i == 0)
					{
						$("#" + objIdArray[i]).html(syncStatus[language][data[i]]); 
					}
					else
					{
						$("#" + objIdArray[i]).html(data[i]); 
					}
				}
				refreshFlag = true;
			}
		}
	}
	xmlHttp.send(null);
}