if (typeof olInfo == 'undefined' || typeof olInfo.meets == 'undefined' || !olInfo.meets(4.10)) alert('overLIB 4.10 or later is required for the HideForm Plugin.');
else
{
	registerCommands('customdiv');

	if (typeof ol_centeroffset=='undefined') var ol_customdiv='overDiv';
	var o3_customdiv='overDiv';

	function setCustomDivVariables()
	{
		o3_customdiv=ol_customdiv;
	}

 	function parseCustomDivExtras(pf,i,ar)
	{ 
		var k=i,v;
		if (k < ar.length)
		{
			if (ar[k]==CUSTOMDIV)
			{
				eval(pf +'customdiv="'+ar[++k]+'"');
				return k;
			}
		}
		return -1;
	}

	function createCustomDivPopup(lyrContent)
	{
		runHook("createPopup", FBEFORE);
		if (o3_customdiv)
		{
			var ov = layerReference(o3_customdiv);
			if (ov)
			over = ov;
		}
		if (o3_wrap)
		{
			var wd,ww,theObj = (olNs4 ? over : over.style);
			theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
//			layerWrite(lyrContent);
			wd = (olNs4 ? over.clip.width : over.offsetWidth);
			if (wd > (ww=windowWidth()))
			{
				lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
				o3_width=ww;
				o3_wrap=0;
			}
		}
//		layerWrite(lyrContent);
		// Have to set o3_width for placeLayer() routine if o3_wrap is turned on
		if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
		runHook("createPopup", FAFTER, lyrContent);
		return true;
	}

	function hideCustomDivObject(obj)
	{
		runHook("hideObject", FBEFORE);
		var theObj=(olNs4 ? obj : obj.style);
		if (olNs6 && olShowId>0)
		{
			clearTimeout(olShowId);
			olShowId=0;
		}
		theObj.visibility = 'hidden';
		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
		if (o3_timerid > 0)
			clearTimeout(o3_timerid);
		if (o3_delayid > 0)
			clearTimeout(o3_delayid);
		o3_timerid = 0;
		o3_delayid = 0;
		self.status = "";
/*		if (obj.onmouseout||obj.onmouseover)
		{
			if (olNs4)
				obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
			obj.onmouseout = obj.onmouseover = null;
		}*/
		runHook("hideObject", FAFTER);
	}

	registerRunTimeFunction(setCustomDivVariables);
	registerCmdLineFunction(parseCustomDivExtras);
	registerHook('createPopup', createCustomDivPopup, FREPLACE);
	registerHook('hideObject', hideCustomDivObject, FREPLACE);
}
