/*****************************************************
 * HINT WINDOW
 * 
 *****************************************************/
var timerId = Array();

function hintWindow(objId, text, time)
 	{
 	// Главный слой
 		
 	newDiv = document.createElement("div");
 	newDiv.style.position = "Absolute";
 	
 	var x = getLeft($(objId));
	var y = getTop($(objId));
	
	newDiv.style.left = (x-230) + "px";
	newDiv.style.top = (y-70) + "px";
	
	
	
 	
 	newDiv.style.width = "250px";
 	
 	
 	newDiv.style.border = "0px solid #000";
 	newDiv.style.padding = "0px 0px 15px 0px";
 	newDiv.style.background = "url(/images/hint/angle.right.gif) no-repeat right bottom";
 	newDiv.style.margin = "0px";
 	document.body.appendChild(newDiv);
	
	// Заголовок
	newDivSubj = document.createElement("div");
	
	newDivSubj.style.background = "#FCEB8F";
	newDivSubj.style.fontSize = "12px";
	newDivSubj.style.fontFamily = "Arial";
	newDiv.appendChild(newDivSubj);
	newDivSubj.style.padding = "5px";
	newDivSubj.innerHTML = "<a href='#' OnClick='clearTimeout(timerId[\"" + objId + "\"]); document.body.removeChild(parentNode.parentNode)'><img src='/images/hint/button.close.gif' align='right' border='0' title='Скрыть и больше не показывать' alt='Скрыть и больше не показывать'></a>";
 	
	// Сообщение
	
	newDivInner = document.createElement("div");
	newDivInner.style.border = "1px solid #FCEB8F";
	newDivInner.style.background = "#FCEB8F";
	newDivInner.style.fontSize = "12px";
	newDivInner.style.fontFamily = "Arial";
	newDiv.appendChild(newDivInner);
	newDivInner.style.padding = "10px";
	newDivInner.innerHTML = text;
 	
 	
	newDiv.style.opacity = "1";
	newDiv.style.filter = "alpha(opacity=100)";
 	
 	
 	hintFade(newDiv, objId, time)
 	}
 	
function hintFade(obj, objId, time)
	{
	wait(obj, objId, time);
	} 
	


		
function wait(obj, objId, t)
	{
	if (t>0)
		{
		timerId[objId] = setTimeout(function (){wait(obj, objId, t)}, 1000);	
		t--;
		}	
		else
		{
		clearTimeout(timerId[objId]);	
		fade(obj, objId, 10)
		}	
	}	
	
function fade(obj, objId, t)
	{
	if (t>0)
		{
		timerId[objId] = setTimeout(function (){fade(obj, objId, t)}, 100);	
		t--;
		obj.style.opacity = t/10;
		obj.style.filter = "alpha(" + (t*10) + ")";
		}	
		else
		{
		clearTimeout(timerId[objId]);	
		document.body.removeChild(obj)
		}	
	}		
