// 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: Sincronizaci&oacute;n<br />x = agenda y contactos';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(6)").bind("mouseover", function () {
			var content = '<strong>Nokia Phone Browser= Administrador de archivos , imagenes, clips, y archivos de &aacute;udio</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(7)").bind("mouseover", function () {
			var content = '<strong>Nokia Application Installer= Instala Aplicaciones<br />x = instala y remueve del PC <br />x/i = soporta apenas instalaci&oacute;n del PC';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(8)").bind("mouseover", function () {
			var content = '<strong>Nokia Music Manager= Transfiere m&uacute;sica</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(9)").bind("mouseover", function () {
			var content = '<strong>Nokia Communication Center = Contactos, mensajes y agenda</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(10)").bind("mouseover", function () {
			var content = '<strong>Image Store= Almacena  im&aacute;genes</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(11)").bind("mouseover", function () {
			var content = '<strong>One Touch Access= Conecta a la Internet</strong>';
			showToolTip(this, content);
	});
	$("#pcsuiteTable TR TD:nth-child(12)").bind("mouseover", function () {
			var content = '<strong>Nokia Video Manager = Transfiere videos</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);
});