// 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>Nokia Content Copier = Backup</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(5)").bind("mouseover", function () {
			var content = '<strong>Nokia PC Sync = Synchronization</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(6)").bind("mouseover", function () {
			var content = '<strong>Nokia Phone Browser = File Manager</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(7)").bind("mouseover", function () {
			var content = '<strong>Nokia Application Installer = Install Applications</strong><br />x = install and remove from PC<br />x/i = supports only installation from PC';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(8)").bind("mouseover", function () {
			var content = '<strong>Nokia Music Manager = Transfer Music</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(9)").bind("mouseover", function () {
			var content = '<strong>Nokia Communication Centre = Contacts, messages and calendar</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(10)").bind("mouseover", function () {
			var content = '<strong>Image Store = Store Images</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(11)").bind("mouseover", function () {
			var content = '<strong>One Touch Access = Connect to the Internet</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(12)").bind("mouseover", function () {
			var content = '<strong>Nokia Video Manager = Transfer videos</strong>';
			showToolTip(this, content);
	});
	// $("#pcsuiteTable TR TD:nth-child(13)").bind("mouseover", function () {
	//		var content = '<strong>Nokia Image Converter</strong>';
	//		showToolTip(this, content);
	// });
	$("#pcsuiteTable TR TD:nth-child(13)").bind("mouseover", function () {
			var content = '<strong>Nokia Map Manager</strong>';
			showToolTip(this, content);
	});

	//define onmouseout events for all columns
	$("#pcsuiteTable TR TD").bind("mouseout",
		function () {
			hideToolTip();
		}
	);

}

$(function() {
	setTimeout("pcsuiteTableAddToolTips();", 200);
});
