// Notification system 
// Build 1900

model.notes = new Array();

function showNotification(type,html,time)
{
	var div = document.getElementById('note');
	if(div){
		if(model.notes.timer) clearTimeout(model.notes.timer);
		switch(type){
			case "loading":
				div.innerHTML='<img src="./images/icons/sync.png" alt="Loading" /><div class="text oneline">Loading..</div>';
				break;
			case "error":
				html='<img src="./images/icons/error.png" alt="Error" class="icon" />'+html;
				div.innerHTML=html;
				break;
			case "success":
				html='<img src="./images/icons/tick.png" alt="Success" class="icon" />'+html;
				div.innerHTML=html;
				break;
			default:
				div.innerHTML=html;
		}
		div.style.display='block';
		if(time) model.notes.timer = setTimeout("hideNotification()",time);
	}
}

function hideNotification()
{
	var div = document.getElementById('note');
	if(div && div.style.display == 'block')
	{
		div.style.display='none';
		div.innerHTML='';
	}
}