// PCsuite table tooltip functions

function showToolTip (elem, content) {
	if(elem.innerHTML == "&nbsp;") return false; //do not show tooltip if empty tablecell (has only "&nbsp;" inside)
	$("#toolTip").show();
	$("#toolTip DIV").html(content); //add content to tooltip
	var elemOffset = $(elem).offset(); //get element position
	var toolTipLeft = elemOffset.left - 77; //define tooltip horizontal position
	var toolTipTop = elemOffset.top - $("#toolTip").height() - 50; //define tooltip vertical position
	toolTipLeft += "px";
	toolTipTop += "px";
	$("#toolTip").css({ left:toolTipLeft, top:toolTipTop }); //position tooltip on page
}

function hideToolTip () {
	$("#toolTip").hide();
}

// addToolTips
function pcsuiteTableAddToolTips () {
	if ( !document.getElementById || !document.getElementById("pcsuiteTable") ) return false;
	//create tooltip html and add it to body
	var toolTip = $('<div id="toolTip"><span class="min"></span><div></div></div>')
		.hide()
		.appendTo("body");

	//add onmouse events and define tooltip content for specific columns
	$("#pcsuiteTable TR TD:nth-child(4)").bind("mouseover", function () {
			var content = '<strong>NCC = Nokia Content Copier，Nokia 資料複製器 = </strong>備份手機檔案';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(5)").bind("mouseover", function () {
			var content = '<strong>NPS = Nokia PC Sync，Nokia 同步處理 = 同步處理</strong><br />x = 行事曆和通訊錄';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(6)").bind("mouseover", function () {
			var content = '<strong>NPB = Nokia Phone Browser，Nokia 手機瀏覽器 = </strong>檔案管理';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(7)").bind("mouseover", function () {
			var content = '<strong>NAI = Nokia Application Installer，Nokia 應用程式安裝程式 =  </strong>安裝應用程式至手機<br />x = 從電腦安裝及移除<br />x/i = 只支援從電腦進行安裝';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(8)").bind("mouseover", function () {
			var content = '<strong>NMM = Nokia Music Manager，Nokia 音樂管理員 =  </strong>傳輸音樂';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(9)").bind("mouseover", function () {
			var content = '<strong>NcomC = Nokia Communication Centre，Nokia 通訊中心 = </strong>透過 Nokia 通訊中心的日曆圖示管理手機日曆';
			showToolTip(this, content);
	});
	//$("#pcsuiteTable TR TD:nth-child(10)").bind("mouseover", function () {
	//		var content = '<strong>NTE = Nokia Text Message Editor，Nokia 訊息編輯器 =  </strong>從電腦傳送簡訊';
	//		showToolTip(this, content);
	//});
	$("#pcsuiteTable TR TD:nth-child(10)").bind("mouseover", function () {
			var content = '<strong>IS = Image Store，Nokia 影像儲存 = </strong>儲存影像';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(11)").bind("mouseover", function () {
			var content = '<strong>OTA = One Touch Access，單鍵上網 = </strong>連線至網際網路';
			showToolTip(this, content);
	});
	//$("#pcsuiteTable TR TD:nth-child(13)").bind("mouseover", function () {
	//		var content = '<strong>NMF = Nokia 多媒體工廠</strong>';
	//		showToolTip(this, content);
	//});
	$("#pcsuiteTable TR TD:nth-child(12)").bind("mouseover", function () {
			var content = '<strong>NVM = Nokia 大導演</strong>';
			showToolTip(this, content);
	});
	//$("#pcsuiteTable TR TD:nth-child(14)").bind("mouseover", function () {
	//		var content = '<strong>NIC = Nokia 影像轉換器</strong>';
	//		showToolTip(this, content);
	// });
	$("#pcsuiteTable TR TD:nth-child(13)").bind("mouseover", function () {
			var content = '<strong>NMM = Nokia 地圖管理員</strong>';
			showToolTip(this, content);
	});


	

	//define onmouseout events for all columns
	$("#pcsuiteTable TR TD").bind("mouseout",
		function () {
			hideToolTip();
		}
	);

}

$(function() {
	setTimeout("pcsuiteTableAddToolTips();", 200);
});

