
/**************************************************************************/
function containsDOM (container, containee) {
	var isParent = false;
	do {
		if ((isParent = container == containee))break;
		containee = containee.parentNode;
	}
	while (containee != null);
    return isParent;
}

function checkMouseEnter (element, evt) {
	if(isBrws("ie"))return true;
	if (element.contains && evt.fromElement)return !element.contains(evt.fromElement);
	else if (evt.relatedTarget)return !containsDOM(element, evt.relatedTarget);
}

function checkMouseLeave (element, evt) {
	if(isBrws("ie"))return true;
	if (element.contains && evt.toElement)return !element.contains(evt.toElement);
	else if (evt.relatedTarget)return !containsDOM(element, evt.relatedTarget);
}

function layerSetMouseOut(lrnm, funcnm)
{
	if(isBrws("ie"))gObject(lrnm).onmouseleave=funcnm;
	else gObject(lrnm).onmouseout=funcnm;

	funcnm;
}

/**************************************************************************/
var tooltipName="tooltippop";
var tooltipPerm=0;
var tooltipShiftX=-20;
var tooltipShiftY=-25;
var tooltipTitle="";
var tooltipText="";

tooltipPerm=parseInt(cookieGet('tooltipPerm'));
if(!tooltipPerm)tooltipPerm=0;
else tooltipPerm=1;

function tooltipPop(title,str)
{
	if(title!="")tooltipTitle=title;
	if(str!="")tooltipText=str;
	
	txt="<table border=0 ><tr><th align=left bgcolor=white>";
	txt+="<a href='#' onclick='tooltipRealHide()'>&times;</a>&nbsp;<a href='#' onclick='tooltipPerm=1-tooltipPerm;cookieSet(\"tooltipPerm\",tooltipPerm);tooltipPop(\"\",\"\")'>";
	if(tooltipPerm)txt+="&bull;";else txt+="&deg;";
	txt+="</a></th><th align=center bgcolor=white><strong><small>"+tooltipTitle+"</small></strong></th></tr><tr><td></td><td><small>";
	txt+=tooltipText;
	txt+="</small></td></tr></table>";
	layerSetMouseOut(tooltipName, tooltipHide);
	if(title=="" && str=="")layerSet(tooltipName,"-","-",txt,"show","-","-");
	else layerSet(tooltipName,gMoX+tooltipShiftX,gMoY+tooltipShiftY,txt,"show","-","-");
}
function tooltipHide(event){
	if(tooltipPerm )return;
	if( checkMouseLeave (this, event) ){
		tooltipRealHide();
	}
}
function tooltipRealHide(){
	layerSet(tooltipName,'-','-','-','hide','-','-');
}

function tooltipCreate( str )
{
	tooltipStl="position : absolute;"+
	"background-color:#FFFFDF;"+
	"font-size:x-small;"+
	"border-color: #66CCFF;"+
	"border-width: 2pt;"+
	"border-style: double;"+
	"font-size: x-small;"+
	"font-family: Verdana;"+
	"font-weight:lighter;"+
	"white-space:pre;"+
	"color:#000040;"+
	"padding: .3cm .3cm .3cm .3cm ;"+
	"visibility: hidden;"+
	"";
	
	return layerCreate(tooltipName,tooltipStl,str);//+layerCreate(tooltipName+"X",tooltipStlX,"");
}
//document.write(tooltipCreate(""));	
	
/**************************************************************************/

function winPopup( hrf, x, y , cx, cy) 
{
	window.open(hrf, "popup", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,left="+x+",top="+y+",width="+cx+",height="+cy+"");
	return false;
}

