/*
 * @description initialize defaults for task windows.
 */

/*
 * @description set a taskbar item to selected.
 * @strId this is the string id of the element.
 * @strHover this sets the hover effect.
 */
function handleTrayNotification (strAction, strIcons, intNotificationType, strTitle, strText, intTimedClose)
{
	var objSystemTray = document.getElementById('system_tray');
	var strHtml = '';
	var strNotificationType = 'taskbar_notification';
	if (intNotificationType == 2)
	{
		strNotificationType = 'taskbar_notification_2';
	}
	switch (strAction)
	{
		case 'log_manager':
			// If icon is not present, we need to create it.
			if (!document.getElementById('system_log_manager'))
			{
				strHtml = '<div id="system_log_manager" class="icon" onclick="transitionEffect(\'system_log_manager_notification\', \'opacity\', 1, 0, 10, 0.05); taskNewWindow (\'System Log\', 600, 550, \'3\', \'get_info\', \'osx\'); removeSystemTrayIcon(this);">';
					strHtml += '<div id="system_log_manager_notification" class="' + strNotificationType + '" style="display: none;">';
					strHtml += '</div>';
					strHtml += '<img src="/media/icons/' + strIcons + '/delete_16.png" title="Log Manager" />';
				strHtml += '</div>';
				objSystemTray.innerHTML = strHtml + objSystemTray.innerHTML;
			}
			strHtml = '<img src="/media/icons/' + strIcons + '/delete_32.png" />';
			strHtml += '<h3>';
				strHtml += strTitle;
			strHtml += '</h3>';
			strHtml += strText;
			document.getElementById('system_log_manager_notification').innerHTML = strHtml;
			document.getElementById('system_log_manager_notification').className = strNotificationType;
			document.getElementById('system_log_manager').style.display = 'block';
			setTimeout('transitionEffect(\'system_log_manager_notification\', \'opacity\', 0, 1, 10, 0.05)', 100);
			if (intTimedClose !== undefined && intTimedClose > 0)
			{
				setTimeout('transitionEffect(\'system_log_manager_notification\', \'opacity\', 1, 0, 10, 0.05)', intTimedClose);
			}
			break;
		default:
			alert('handleTrayNotification: ' + strAction + ' not found.');
			break;
	}
}

function removeSystemTrayIcon(objIcon)
{
	objIcon.style.display = 'none';
}