 // Pop Up Find on this page
var nm = 0; 
var here = ""; 
if (opener != null) 
{
	here = opener.location.href; 
	var isLayers = 0; 
	var isAll = 0; 
	var isID = 0; 
	if (document.all) 
	{
		isAll = 1;
	} 
	else if(document.getElementById) 
	{
		isID = 1;
	} 
	else 
	{ 
		browserVersion = parseInt(navigator.appVersion); 
		if ((navigator.appName.indexOf("Netscape") != -1) && (browserVersion == 4)) 
		{
			isLayers = 1;
		}
	}
}
function findInPage(str) 
{
	if (opener.closed) 
	{
		alert("The main window has been closed."); 
		self.close(); 
		return false;
	} 
	else if(here != opener.location.href) 
	{
		here = opener.location.href; nm = 0;
	} 
	if (str == "") 
	{
		alert("Please enter the text you are trying to find......"); 
		return false;
	} 
	var tx, i, found; 
	if (isLayers) 
	{
		if (!opener.find(str)) 
			while(opener.find(str,false,true)) 
				n++; 
		else 
			n++;
		if (n == 0) 
			alert(str + " not found on this page.");  
	} 
	else if(isAll) 
	{
		tx = opener.document.body.createTextRange(); 
		for (i = 0; i <= nm && (found = tx.findText(str)) != false; i++) 
		{
			tx.moveStart("character", 1); 
			tx.moveEnd("textedit");
		} 
		if (found) 
		{
			tx.moveStart("character", -1); 
			tx.findText(str);
			tx.select(); 
			tx.scrollIntoView(); 
			nm++;
		}
		else {if (nm > 0)
		{
			nm = 0; findInPage(str);
		}
		else 
			alert(str + " was not found on this page.");
	}
} 
else if (isID) 
{
	var ag = navigator.userAgent.toLowerCase();
	var isG = (ag.indexOf('gecko') != -1); 
	var isR=0;
	if (isG) 
	{
		t = ag.split("rv:"); 
		isR = parseFloat(t[1]);
	}
	if (isR >=1) 
	{
		if (!opener.find(str,false,false,true,false,true,false)) 
			alert(str + " was not found on this page.");document.search.sub.focus();
	}
	else
		alert("Find function not supported. Please use IE 6.");
} 
return false;
} 
function mnWin() 
{
	if (opener.closed) 
	{
		alert("Main window has been closed."); 
		self.close();
	} 
	else 
	{
		opener.focus(); 
		locatorWin();
	}
}
function findBody() 
{
	document.write('<div align="center"><form name="search" onsubmit="return findInPage(this.string.value);"><input name="string" type="text" size="22" onchange="nm = 0;" class=etextbox><input name="sub" type="submit" value="Find" class=ebutton><br /><font color="#003399">press ENTER to find again</font></form></div>');
}

function locatorWin() 
{
	var lwin = window.open('_Scripts/MedXNetSearch.htm','findit','height=10,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no'); 
	lwin.moveTo(300,200); 
	lwin.focus();
}
