var mlist_ad=new Array("&lt;br&gt;","</p>")
var tot, b, c;
document.writeln('<link href="http://www.altprofits.com/ml/screen.css" rel="stylesheet" type="text/css" />');
function doHighlight_mlist(bodyText, searchTerm, highlightStartTag, highlightEndTag,index)
{
  // the highlightStartTag and highlightEndTag parameters are optionalBiodiesel - Definition, Glossary, Details
  //alert(index);
  
  var newText = "";
  var i = -1;
  var lcSearchTerm = searchTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();
  var alm, almm, leng, ll, lll;
  var found=0;
  var no_fd;
  //alert(bodyText.length);
		   if(bodyText.length < 5000)
				   {
					   no_fd = 1;
				   } else if(bodyText.length > 5000 && bodyText.length < 15000) {
					   no_fd = 2;
				   } else {
					   no_fd = 3;
				   }
  while (bodyText.length > 0) {
	//alert(i);
	i = lcBodyText.indexOf(lcSearchTerm, i+1);
	
	if (i < 0) {
	  newText += bodyText;
	  bodyText = "";
	} else {
		   if (bodyText.lastIndexOf("/a>", i) >= bodyText.lastIndexOf("<a", i)) {
			    //stip anything inside an table tag
			    if (lcBodyText.lastIndexOf("/table>", i) >= lcBodyText.lastIndexOf("<table", i)) {
		// skip anything inside a <script> block
		if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
				alm = bodyText.substr(i-1, searchTerm.length);
				almm = bodyText.substr(i+1, searchTerm.length);
				//var nmm = bodyText.substring(0, i);
				leng = alm.length;
				//alert(leng);
				ll = alm.charAt(0);
				lll = almm.charAt(leng-1);						   
		  //alert(lll);
		  var txt = bodyText.substring(0, i);
		  var tot_midl_worda = txt.length;
		 //alert(tot_midl_worda);
		  if((found < no_fd) && tot_midl_worda > 4300)
		  {
	  
	   if(found == 0)
	   {
    highlightStartTag = "<center><div><form id='myform' method='post' action='http://altprofits.com/mlist/user/process.php'><fieldset><legend>Free Newsletter in Your Email</legend><b>Email</b><input type='text' id='email' name='Email' /><b>Name</b><input type='text' value='' id='field1' name='d[1]' /><b>Profile</b><input type='text' id='field3' name='d[3]' /><input name='pommo_signup' value='true' type='hidden' /><div><input type='submit' name='pommo_signup' id='submit' value='Subscribe' class='submit' />";
	highlightEndTag = "</div></div></fieldset></form></center>";
	   }
	else if(found == 1) {
			highlightStartTag = "";
                        highlightEndTag = "";
	   } else if(found == 2) {
		   highlightStartTag = "";
	   }

		   
   //alert(found);
				newText += bodyText.substring(0, i) + bodyText.substr(i, searchTerm.length)+ highlightStartTag + highlightEndTag;  
				bodyText = bodyText.substr(i + searchTerm.length);
				lcBodyText = bodyText.toLowerCase();
				//alert(i);
				i = -1;
				found++;
				//alert(found);&& (found < 5) && (tot_link < 50)
		  }
		 
		}
		   }
	   }
	}
  }
  return newText;
}
function highlightSearchTerms_mlist(warnOnFailure, highlightStartTag, highlightEndTag)
{
	//alert(warnOnFailure);
 if (!document.body || typeof(document.body.innerHTML) == "undefined") {
	  //alert(searchText);
    if (warnOnFailure) {
      alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
    }
    //return false;
  }
 
  //var bodyText = document.body.innerHTML;
  var bodyText = document.getElementById('main').innerHTML;
 
  for (var i = 1; i < mlist_ad.length; i++) {
    bodyText = doHighlight_mlist(bodyText, mlist_ad[i], highlightStartTag, highlightEndTag,i);
  }
  document.getElementById('main').innerHTML = bodyText;
  return true;
}
highlightSearchTerms_mlist(false);
