var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;
var tipFollowMouse= true;
var tipWidth= 160;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 	
function CloseWin()
{
ids=document.getElementById('DivSearh');
	if (ids!=null)
	{
	ids.style.visibility='hidden';
	ids.style.display="none";
	}
}

function ShowWin(evt)
{
ids=document.getElementById('DivSearh');
	if (ids!=null)
	{
	ids.style.visibility='visible';
	ids.style.display="block";
	}
	positionTip(evt,ids.style);
}

function positionTip(evt,ids) {
	//if (!tipFollowMouse) 
	{
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	var tpWd = (ns4)? ids.width: (ie4||ie5)? ids.clientWidth: ids.offsetWidth;
	var tpHt = (ns4)? ids.height: (ie4||ie5)? ids.clientHeight: ids.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		ids.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else ids.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		ids.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else ids.top = (ns4)? mouseY+offY: mouseY+offY+"px";

}