
addLoadEvent(fStartActivePosts);

function fReportClick(pNewsId)
  {
  var xmlString = '<service request="report_click">';
  xmlString    +=   '<id>' +  pNewsId + '</id>';
  xmlString    +=   '<ip><?php echo ip(); ?></ip>';
  xmlString    += '</service>';
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessReportClick, "xml=" + escape(xmlString) );
  }
  
function fProcessReportClick(xml)
  {
  }
  

function fGetLatestNews()
  {

  if(fCheckForDivInDocument("div_latest_news_accessing"))
    document.getElementById("div_latest_news_accessing").style.visibility = '';
  var node = document.getElementById('div_latest_news');
  var script=document.createElement('script');
  script.setAttribute('type','text/javascript');
  script.text="var node = document.getElementById('div_latest_news');"
  node.appendChild(script)                                             
  var animScript = document.createElement('script');
  animScript.type = 'text/javascript';
  animScript.src = 'anim.js';
  node.appendChild(animScript);

  
  var xmlString = '<service request="latest_news">';
  xmlString    += '</service>';
  //alert('http://www.cryptozoology.com/service.php?xml=' + xmlString);
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessLatestNews, "xml=" + escape(xmlString) );
  

  
  }
  
var bloggersLoaded = false;
  
function fProcessLatestNews(xml)
  {
	var htmlString = '';
  var result = xml.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  if(result == 'success')
    {
    items=xml.getElementsByTagName("item");
    node = document.getElementById('div_latest_news');
    while (node.hasChildNodes()) 
	    {
      node.removeChild(node.lastChild);
      }                                                 
		var bgColorArray = ['#eeeeee', '#eeffee'];
	 

    for(i=0; i<items.length; i++)
      {  
      var item = items[i];
  	  id = item.getElementsByTagName("id")[0].firstChild.nodeValue; 
  	  title = item.getElementsByTagName("title")[0].firstChild.nodeValue; 
  	  body = item.getElementsByTagName("body")[0].firstChild.nodeValue; 
  	  posted = item.getElementsByTagName("posted")[0].firstChild.nodeValue; 
   	  submitter = item.getElementsByTagName("submitter")[0].firstChild.nodeValue; 
   	  link = item.getElementsByTagName("link")[0].firstChild.nodeValue; 
  	  post_id = item.getElementsByTagName("post_id")[0].firstChild.nodeValue;
  	  post_replies = item.getElementsByTagName("post_replies")[0].firstChild.nodeValue;
  	  views = item.getElementsByTagName("views")[0].firstChild.nodeValue;
			viewText = ''; 
  	  if(views == '1')
  	    viewText = ' Viewed 1 time.';
  	  if(myParseInt(views) > 1)
			  viewText = ' Viewed ' + views + ' times.'; 

      var discussLink = '';
      if(myParseInt(post_id) > 0)
        {
        if(myParseInt(post_replies) == 0)
			    discussLink = ' <a class="front_link3" target="_blank" href="http://www.cryptozoology.com/forum/topic_view_thread.php?pid=' + post_id + '&tid=24" onclick="fReadThread(24' + ',' + post_id + '); return false;">Comment.</a> ';
        else
          {
          if(myParseInt(post_replies) == 1)
			      discussLink = ' <a class="front_link3" target="_blank" href="http://www.cryptozoology.com/forum/topic_view_thread.php?pid=' + post_id + '&tid=24" onclick="fReadThread(24' + ',' + post_id + '); return false;">' + post_replies + ' comment.</a> ';
          else			      
			      discussLink = ' <a class="front_link3" target="_blank" href="http://www.cryptozoology.com/forum/topic_view_thread.php?pid=' + post_id + '&tid=24" onclick="fReadThread(24' + ',' + post_id + '); return false;">' + post_replies + ' comments.</a> ';          
          }									      
				} 
  	  
      title = str_replace('#SQ#',"&#39;",title);
      body = str_replace('#SQ#',"&#39;",body);
      title = str_replace("'","&#39;",title);
      body = str_replace("'","&#39;",body);
      
      title = str_replace("&amp;amp;","&",title);
      body = str_replace("&amp;amp;","&",body);

      title = str_replace("\\","",title);
      title = str_replace('\\"','"',title);
      body = str_replace("\\","",body);
      body = str_replace('\\"','"',body);
      
      body = str_replace('&lt;','<',body);
      body = str_replace('&gt;','>',body);
      body = str_replace('#LINK','href="' + link + '" class="front_link2" target="_blank" onclick="fReportClick(' + id + ')"',body);
			  
			
			htmlString =  '<div style="margin-left: 5px; margin-right: 5px; margin-top: 2px; border-top: 1px solid #999999;"></div>';
			htmlString += '<div style="margin-left: 5px; font-size: 10pt; margin-top: 6px; margin-bottom: 3px; font-weight: bold; color: #880000">' + title + '</div>';
			htmlString += '<div style="margin-left: 5px; font-family: Verdana, Arial, sans-serif; font-size: 9pt; padding-top: 1px;">' + body + '</div>';
      htmlString += '<div style="margin-left: 5px; padding-top: 4px; padding-bottom: 0px; font-size: 8pt; color: #666666;">[ Posted:' + posted + '.' + viewText + discussLink + ' ]</div>';
      htmlString += '<div style="clear: both;"></div>';
        
      postItemDiv = document.createElement("div");
      postItemDiv.id = 'div_latest_news_' + i;
      postItemDiv.style.padding = '3px 3px 0px 8px';
        
      postItemDiv.innerHTML = htmlString;
      node.appendChild(postItemDiv);
  	  
      } // end for
      
    
      
    }

	if(bloggersLoaded == false)
	  {
	  bloggersLoaded = true;
	  fGetBloggers();
	  setInterval( "fGetLatestNews()", 300000 ); // every 5 minutes
	  }
	
  } // fProcessLatestNews  
  
  
function fGetBloggers()
  {
  if(fCheckForDivInDocument("div_bloggers_accessing"))
    document.getElementById("div_bloggers_accessing").style.visibility = '';
  var node = document.getElementById('div_bloggers');
  var script=document.createElement('script');
  script.setAttribute('type','text/javascript');
  script.text="var node = document.getElementById('div_bloggers');"
  node.appendChild(script)     
  var animScript = document.createElement('script');
  animScript.type = 'text/javascript';
  animScript.src = 'anim.js';
  node.appendChild(animScript);
  
  
  
  var xmlString = '<service request="bloggers">';
  xmlString    += '</service>';
  //alert('http://www.cryptozoology.com/service.php?xml=' + xmlString);
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessBloggers, "xml=" + escape(xmlString) );


  //setTimeout(fStartActivePosts, 10000);
  }  
  
function fProcessBloggers(xml)
  {
  var result = xml.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  if(result == 'success')
    {
    var htmlString = '';
    var bloggers=xml.getElementsByTagName("blogger");
    var items=xml.getElementsByTagName("item");
    var node = document.getElementById('div_bloggers');
    while (node.hasChildNodes()) 
	    {
      node.removeChild(node.lastChild);
      }      
		var bgColorArray = ['#eeeeee', '#eeffee'];
	 
    for(i=0; i<items.length; i++)
      {

      var item = items[i];
  	  var blogId = item.getElementsByTagName("id")[0].firstChild.nodeValue; 
  	  var profileId = item.getElementsByTagName("profile_id")[0].firstChild.nodeValue; 
  	  var profileName = item.getElementsByTagName("profile_name")[0].firstChild.nodeValue; 
  	  var bloggerImage = item.getElementsByTagName("blogger_image")[0].firstChild.nodeValue; 
  	  var date = item.getElementsByTagName("date")[0].firstChild.nodeValue; 
  	  var subject = item.getElementsByTagName("subject")[0].firstChild.nodeValue; 
  	  var message = item.getElementsByTagName("message")[0].firstChild.nodeValue; 
  	  
      message = str_replace('#SQ#',"&#146;",message);
      subject = str_replace('#SQ#',"&#146;",subject);
      
      message = str_replace("&amp;amp;","&",message);
      subject = str_replace("&amp;amp;","&",subject);
      
      profileName = str_replace('#SQ#',"&#146;",profileName);
      message = str_replace("'","&#146;",message);
      subject = str_replace("'","&#146;",subject);
      profileName = str_replace("'","&#146;",profileName);

			  
			htmlString = '<table width="100%" cellpadding="0" cellspacing="0"><tr><td valign="top" width="50"><div style="margin-top: 5px;"><img src="' + bloggerImage + '" width="50" height="50" border="0" alt=""></div></td>';
			htmlString += '<td valign="top" width="200">';			  
      htmlString += '  <div style="padding-top: 2px; padding-bottom: 1px; padding-left: 5px; font-size: 8pt;"><a class="blogger" href="http://www.cryptozoology.com/profile/profile_view.php?id=' + profileId + '" onclick="fViewProfile(' + profileId + '); return false;" style="text-decoration: none;">' + profileName + '</a></div>';
			htmlString += '  <div style="font-size: 9pt; padding-left: 5px;"><a class="front_link2" href="http://www.cryptozoology.com/blog/blog.php?id=' + blogId + '" onmouseover="return overlib(\'';
			htmlString +=  str_replace("'","&#146;",message); 
			htmlString += '\');" onmouseout="return nd();">'; 
			htmlString += str_replace("'","&#146;",subject); 
			htmlString +=  '</a></div>';
      htmlString += '<div style="padding-top: 3px; padding-bottom: 1px; font-size: 8pt; padding-left: 5px; color: #555555">' + date + '</div>';
      htmlString += '</td></tr></table>';
          
      var blogItemDiv = document.createElement("div");
      blogItemDiv.style.padding = '1px 3px 2px 5px';
      blogItemDiv.style.borderTop = '1px solid black';
      blogItemDiv.style.backgroundColor = bgColorArray[i %2];
        
      blogItemDiv.innerHTML = htmlString;
      node.appendChild(blogItemDiv);
  	  
      } // end for
      
    if(bloggers.length > 0)
      {
      htmlString = '<div style="max-width: 240px;"><span style="float: left;">other bloggers: </span>';
   	  for(i=0; i<bloggers.length; i++)
        {
        var blogger = bloggers[i];
  	    var bloggerProfileId = blogger.getElementsByTagName("profile_id")[0].firstChild.nodeValue; 
  	    var bloggerProfileName = blogger.getElementsByTagName("profile_name")[0].firstChild.nodeValue;
  	    htmlString += '<span style="float: left; padding: 0px 2px 0px 2px;">';
				htmlString += '<a href="blog/blogs.php?blogger_id=' + bloggerProfileId + '" class="front_link2">' + str_replace("'", "\'", bloggerProfileName);
				if(i<bloggers.length - 1)
  	      htmlString += ',';
				htmlString += '</a></span>';
  	    }
  	  htmlString += '</div><div style="clear: both;"></div>';
      var bloggersItemDiv = document.createElement("div");
      bloggersItemDiv.style.padding = '1px 3px 2px 5px';
      bloggersItemDiv.style.borderTop = '1px solid black';
      bloggersItemDiv.innerHTML = htmlString;
     
  	  node.appendChild(bloggersItemDiv);
		  }        
      
    }
    
  fGetOldNews();  

  }  
  
  
function fCheckFlags()
  {
  var xmlString = '<service request="check_flags">';
  xmlString    += '</service>';
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessCheckFlags, "xml=" + escape(xmlString) );
  }  
function fProcessCheckFlags(xml)
  {
  var result = xml.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  if(result == 'success')
    {
    var newsFlag = xml.getElementsByTagName("news")[0].childNodes[0].nodeValue;	
    var forumFlag = xml.getElementsByTagName("forum")[0].childNodes[0].nodeValue;
		}
	}	
	   
  
  
function fGetOldNews()
  {                 
  if(fCheckForDivInDocument("div_old_news_accessing"))
    document.getElementById("div_old_news_accessing").style.visibility = '';
  var node = document.getElementById('div_old_news');
  var script=document.createElement('script');
  script.setAttribute('type','text/javascript');
  script.text="var node = document.getElementById('div_old_news');"
  node.appendChild(script)       
  var animScript = document.createElement('script');
  animScript.type = 'text/javascript';
  animScript.src = 'anim.js';
  node.appendChild(animScript);
  
  
  
  var xmlString = '<service request="old_news">';
  xmlString    += '</service>';
  //alert('http://www.cryptozoology.com/service.php?xml=' + xmlString);
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessOldNews, "xml=" + escape(xmlString) );


  }    
function fProcessOldNews(xml)
  {
	var htmlString = '';
  var result = xml.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  if(result == 'success')
    {
    items=xml.getElementsByTagName("item");
    node = document.getElementById('div_old_news');
    while (node.hasChildNodes()) 
	    {
      node.removeChild(node.lastChild);
      }      
		var bgColorArray = ['#eeeeee', '#eeffee'];
	                                     
    for(i=0; i<items.length; i++)
      {  
      var item = items[i];
  	  var id = item.getElementsByTagName("id")[0].firstChild.nodeValue; 
  	  var title = item.getElementsByTagName("title")[0].firstChild.nodeValue; 
  	  var body = item.getElementsByTagName("body")[0].firstChild.nodeValue; 
  	  var posted = item.getElementsByTagName("posted")[0].firstChild.nodeValue; 
   	  var link = item.getElementsByTagName("link")[0].firstChild.nodeValue; 
  	  var views = item.getElementsByTagName("views")[0].firstChild.nodeValue;
			viewText = ''; 
  	  if(views == '1')
  	    viewText = ' Viewed 1 time.';
  	  if(myParseInt(views) > 1)
			  viewText = ' Viewed ' + views + ' times.'; 
  	  
      title = str_replace('#SQ#',"&#39;",title);
      body = str_replace('#SQ#',"'",body);
      title = str_replace("'","&#39;",title);
      body = str_replace("'","\\'",body);
      title = str_replace("&amp;amp;","&",title);
      body = str_replace("&amp;amp;","&",body);

			  
			  
			htmlString =  '<div style="margin-left: 5px; margin-right: 5px; margin-top: 2px; border-top: 1px solid #999999;"></div>';
			htmlString += '<div style="margin-left: 5px; font-size: 9pt; margin-top: 6px; margin-bottom: 3px;">';
			htmlString += '<a class="old_news" href="' + link + '"  target="_blank" onclick="fReportClick(' + id + ')" onmouseover="return overlib(\'';
			htmlString += body; 
			htmlString += '\');" onmouseout="return nd();">'; 
			htmlString += str_replace("'","&#146;",title); 
			htmlString +=  '</a></div>';
			
			
      htmlString += '<div style="margin-left: 5px; padding-bottom: 0px; font-size: 8pt; color: #666666;">' + posted + '.' + viewText + '</div>';
      htmlString += '<div style="clear: both;"></div>';
        
      var oldNewsItemDiv = document.createElement("div");
      oldNewsItemDiv.style.padding = '3px 3px 0px 8px';
      if(i == items.length-1 && getInternetExplorerVersion() == 8) // odd bug with ie8, where it fails to draw the bottom border of the div.
        {
         oldNewsItemDiv.style.borderBottom = '1px solid black';
        }
        
      oldNewsItemDiv.innerHTML = htmlString;
      node.appendChild(oldNewsItemDiv);
  	  
      } // end for
      
    }
  fRemoveRemnances();
  }    
  
function fRemoveRemnances()
  {
  var nodeList = document.documentElement.getElementsByTagName( "div" );
  for(j=0; j<nodeList.length; j++)
    {
    var theNode = nodeList[j];
    if(theNode.id == 'div_loading')
      theNode.parentNode.removeChild(theNode);
      
    if(theNode.id == 'div_latest_news_accessing' ||
		   theNode.id ==  'div_bloggers_accessing' ||     
		   theNode.id ==  'div_old_news_accessing' ||     
		   theNode.id ==  'div_latest_posts_accessing' ||     
		   theNode.id ==  'div_active_posts_accessing')     
      theNode.parentNode.removeChild(theNode);
    }
  }
  
var newPostsLoaded = false;
function fGetNewPosts()
  {                                                                     
  if(fCheckForDivInDocument("div_latest_posts_accessing"))
    document.getElementById("div_latest_posts_accessing").style.visibility = '';
  if(newPostsLoaded == false)
    {
    var node = document.getElementById('div_latest_posts');
    var script=document.createElement('script');
    script.setAttribute('type','text/javascript');
    script.text="var node = document.getElementById('div_latest_posts');"
    node.appendChild(script)       
    var animScript = document.createElement('script');
    animScript.type = 'text/javascript';
    animScript.src = 'anim.js';
    node.appendChild(animScript);
    }
  
  
  
  var xmlString = '<service request="new">';
  xmlString    += '</service>';
  //alert('http://www.cryptozoology.com/service.php?xml=' + xmlString);
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessNew, "xml=" + escape(xmlString) );


  //setTimeout(fStartActivePosts, 10000);
  }
  
function fProcessNew(xml)
  {

  var result = xml.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  if(result == 'success')
    {
    htmlString = '';
    items=xml.getElementsByTagName("item");
    var node = document.getElementById('div_latest_posts');
    while (node.hasChildNodes()) 
	    {
      node.removeChild(node.lastChild);
      }      
		var bgColorArray = ['#eeeeee', '#eeffee'];
	 
    for(i=0; i<items.length; i++)
      {  
      var item = items[i];
  	  forumTitle = item.getElementsByTagName("forum_title")[0].firstChild.nodeValue; 
  	  topicTitle = item.getElementsByTagName("topic_title")[0].firstChild.nodeValue; 
  	  topicId = item.getElementsByTagName("topic_id")[0].firstChild.nodeValue; 
  	  postId = item.getElementsByTagName("post_id")[0].firstChild.nodeValue; 
   	  subject = item.getElementsByTagName("subject")[0].firstChild.nodeValue; 
   	  message = item.getElementsByTagName("message")[0].firstChild.nodeValue; 
  	  profileId = item.getElementsByTagName("profile_id")[0].firstChild.nodeValue; 
  	  profileName = item.getElementsByTagName("profile_name")[0].firstChild.nodeValue; 
  	  posted = item.getElementsByTagName("posted")[0].firstChild.nodeValue; 
  	  
      message = str_replace('#SQ#',"&#146;",message);
      subject = str_replace('#SQ#',"&#146;",subject);
      subject = str_replace("&amp;amp;","&",subject);
      subject = str_replace('\\','',subject);
      
      //subject = str_replace('\','',subject);
      
      profileName = str_replace('#SQ#',"&#146;",profileName);
      message = str_replace("'","&#146;",message);
      message = str_replace("&amp;amp;","&",message);

      message = str_replace('&#39;','\'',message);
      subject = str_replace("'","&#146;",subject);
      profileName = str_replace("'","&#146;",profileName);
			                                                                                               
			htmlString =  '<div style="font-size: 8pt; padding-top: 2px;"><a class="topics_homepage" href="http://www.cryptozoology.com/forum/topic.php?tid=' + topicId + '">' + topicTitle + '</a></div>';
			htmlString +=  '<div style="font-size: 9pt; padding-top: 3px;"><a class="front_link2" href="http://www.cryptozoology.com/forum/topic_view_thread.php?pid=' + postId + '&tid=' + topicId + '" onclick="fReadThread(' + topicId + ',' + postId + '); return false;"  onmouseover="return overlib(\'';
			htmlString +=  str_replace("'","&#146;",message); 
			htmlString += '\');" onmouseout="return nd();">'; 
			htmlString += str_replace("'","&#146;",subject); 
			htmlString +=  '</a></div>';
      htmlString += '<div style="padding-top: 2px; padding-bottom: 2px; font-size: 8pt;">author: <a class="author_homepage" href="http://www.cryptozoology.com/profile/profile_view.php?id=' + profileId + '" onclick="fViewProfile(' + memberId + '); return false;" style="text-decoration: none;">' + profileName + '</a></div>';
      htmlString += '<div style="padding-top: 0px; padding-bottom: 1px; font-size: 8pt;">' + posted + '</div>';
      htmlString += '<div style="clear: both;"></div>';
        
      postItemDiv = document.createElement("div");
      postItemDiv.style.padding = '1px 3px 2px 10px';
      postItemDiv.style.borderTop = '1px solid black';
      postItemDiv.style.backgroundColor = bgColorArray[i %2];
        
      postItemDiv.innerHTML = htmlString;
      node.appendChild(postItemDiv);
  	  
      } // end for
    }


	
	
  if(newPostsLoaded == false)
    {
    newPostsLoaded = true;
    fGetLatestNews();
    setInterval( "fGetNewPosts()", 300000 ); // every 5 minutes
    }	
	
	
  }
 
var activePostsLoaded = false;
function fStartActivePosts()
  {
  if(fCheckForDivInDocument("div_active_posts_accessing"))
    document.getElementById("div_active_posts_accessing").style.visibility = '';
  if(activePostsLoaded == false)
	  {  
    var node = document.getElementById('div_active_posts');
    var script=document.createElement('script');
    script.setAttribute('type','text/javascript');
    script.text="var node = document.getElementById('div_active_posts');"
    node.appendChild(script)       
    var animScript = document.createElement('script');
    animScript.type = 'text/javascript';
    animScript.src = 'anim.js';
    node.appendChild(animScript);
    }

  
  var xmlString = '<service request="active">';
  xmlString    += '</service>';
  //alert('http://www.cryptozoology.com/service.php?xml=' + xmlString);
  xmlhttpPost('http://www.cryptozoology.com/service.php', fProcessActive, "xml=" + escape(xmlString) );


  //setTimeout(fStartActivePosts, 10000);
  }
  
function fProcessActive(xml)
  {
  var htmlString = '';
  var result = xml.getElementsByTagName("result")[0].childNodes[0].nodeValue;
  if(result == 'success')
    {
    var items=xml.getElementsByTagName("item");
    var node = document.getElementById('div_active_posts');
    while (node.hasChildNodes()) 
	    {
      node.removeChild(node.lastChild);
      }      
		var bgColorArray = ['#eeeeee', '#eeffee'];
 
    for(i=0; i<items.length; i++)
      {
      var item = items[i];
  	  postId = item.getElementsByTagName("post_id")[0].firstChild.nodeValue; 
		  topicId = item.getElementsByTagName("topic_id")[0].firstChild.nodeValue; 
		  topicName = item.getElementsByTagName("topic_name")[0].firstChild.nodeValue; 
		  subject = item.getElementsByTagName("subject")[0].firstChild.nodeValue;
	    message = item.getElementsByTagName("message")[0].firstChild.nodeValue;
		  memberId = item.getElementsByTagName("member_id")[0].firstChild.nodeValue;
		  memberName = item.getElementsByTagName("member_name")[0].firstChild.nodeValue;
		  replies = item.getElementsByTagName("replies")[0].firstChild.nodeValue;
		  recommendations = item.getElementsByTagName("recommendations")[0].firstChild.nodeValue;
		  active_rating = item.getElementsByTagName("active_rating")[0].firstChild.nodeValue;
			  
      message = str_replace('#SQ#',"&#146;",message);
      subject = str_replace('#SQ#',"&#146;",subject);
      memberName = str_replace('#SQ#',"&#146;",memberName);
      message = str_replace("&amp;amp;","&",message);
      subject = str_replace("&amp;amp;","&",subject);
      subject = str_replace('\\','',subject);

      message = str_replace('#SQ#',"&#146;",message);
      message = strip_tags(message);
      

      message = str_replace("'","&#146;",message);
      subject = str_replace("'","&#146;",subject);
      memberName = str_replace("'","&#146;",memberName);
			  
			htmlString =  '<div style="font-size: 8pt; padding-top: 2px;"><a class="topics_homepage" href="http://www.cryptozoology.com/forum/topic.php?tid=' + topicId + '">' + topicName + '</a></div>';
			htmlString +=  '<div style="font-size: 9pt; padding-top: 3px;"><a class="front_link2" href="http://www.cryptozoology.com/forum/topic_view_thread.php?pid=' + postId + '&tid=' + topicId + '" onclick="fReadThread(' + topicId + ',' + postId + '); return false;"  onmouseover="return overlib(\'';
			htmlString +=  message; 
			htmlString += '\');" onmouseout="return nd();">'; 
			htmlString += subject; 
			htmlString +=  '</a></div>';

      htmlString += '<div style="padding-top: 2px; padding-bottom: 2px; font-size: 8pt;">author: <a class="author_homepage" href="http://www.cryptozoology.com/profile/profile_view.php?id=' + memberId + '" onclick="fViewProfile(' + memberId + '); return false;" style="text-decoration: none;">' + memberName + '</a></div>';
		
      htmlString += '  <div style="border: 1px solid #888888; float: left;">';
			htmlString += '    <table cellpadding="0" cellspacing="0"><tr>';
			
			
			
			htmlString += '      <td style="background-color: #d3d5fd; padding-left: 2px; padding-right: 2px;"><img src="images/replyarrow.png" width="14" height="12" border="0" alt="replies" title="replies"></td>';
			htmlString += '      <td style="background-color: #d3d5fd; padding-left: 2px; padding-right: 4px; border-right: 1px solid black;">' + replies + '</td>';
			htmlString += '      <td style="background-color: #c2f5bb; padding-left: 2px; padding-right: 2px;"><img src="images/recommendations.png" width="15" height="17" border="0" alt="recommendations" title="recommendations"></td>';
			htmlString += '      <td style="background-color: #c2f5bb; padding-left: 2px; padding-right: 2px; border-right: 1px solid black;">' + recommendations + '</td>';
			htmlString += '      <td style="background-color: #fbf967; padding-left: 2px; padding-right: 2px;"><img src="images/activity.png" width="18" height="14" border="0" alt="activity rating" title="activity rating"></td>';
			htmlString += '      <td style="background-color: #fbf967; padding-left: 2px; padding-right: 2px;">' + active_rating + '</td>';
      htmlString += '    </tr></table>';
      htmlString += '  </div>';
      htmlString += '<div style="clear: both;"></div>';
  

			
      

        
        
      postItemDiv = document.createElement("div");
      postItemDiv.style.padding = '1px 3px 4px 10px';
      postItemDiv.style.borderTop = '1px solid black';
      postItemDiv.style.backgroundColor = bgColorArray[i %2];
        
      postItemDiv.innerHTML = htmlString;
      node.appendChild(postItemDiv);
			}
      
      
    }
  if(activePostsLoaded == false)
    {
    activePostsLoaded = true;
    fGetNewPosts();
    setInterval( "fStartActivePosts()", 60000 ); // every minute
    }
  }
  


    
function fReadThread(pTid,pPid)
 {
 oScreenWidth = 600;
 oScreenHeight = 400;
 if(screen.height)
 {
 oScreenWidth = screen.width * (0.8);
 oScreenHeight = screen.height * (0.8);
 }

 launchWindow("http://www.cryptozoology.com/forum/topic_view_thread.php?tid=" + pTid + "&pid=" + pPid, "thread", oScreenWidth, oScreenHeight, "yes");
 }

function fViewProfile(pProfileId)
 {
 oScreenWidth = 600;
 oScreenHeight = 400;
 if(screen.height)
 {
 oScreenWidth = screen.width * (0.8);
 oScreenHeight = screen.height * (0.8);
 }
 if(oScreenWidth > 1200)
 {
 oScreenWidth = 700;
 }
 if(oScreenHeight < 900)
 {
 oScreenHeight = 700;
 }
 launchWindow("http://www.cryptozoology.com/profile/profile_view.php?id=" + pProfileId, "profile", oScreenWidth, oScreenHeight, "yes");
 }

 
function launchWindow(url, name, width, height, scrollbars)
 {
 screenX = screen.width * (0.1);
 screenY = screen.height * (0.1);
 if(width > 1200)
 {
 screenX = 100;
 width = 1100;
 }
 if(height < 900)
 {
 screenY = 80;
 height = 800;
 }
 launchWin = window.open(url,name,"toolbar=no,directories=no,menubar=no,scrollbars=" + scrollbars + ",resizable=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left=" + screenX + ",screenX=" + screenX + ",screenY=" + screenY);
 }
	 

var launchWin2;
function launchWindow2(url, width, height)
	{
	if(launchWin2)
	 launchWin2.close();
	screenX = (screen.width /2) - (width /2); // used to center.
	screenY = (screen.height /2) - (height /2); // used to center.
	launchWin2 = window.open(url,"pop","toolbar=no,directories=no,menubar=no,scrollbars=no,resizable=yes,width=" + width + ",height=" + height + ",top=" + screenY + ",left=" + screenX + ",screenX=" + screenX + ",screenY=" + screenY);
	launchWin2.focus();
	}


function getInternetExplorerVersion() {

    var rv = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer') {

        var ua = navigator.userAgent;

        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");

        if (re.exec(ua) != null)

            rv = parseFloat(RegExp.$1);

    }

    return rv;

}


	function strip_tags(html){
 
		//PROCESS STRING
		if(arguments.length < 3) {
			html=html.replace(/<\/?(?!\!)[^>]*>/gi, '');
		} else {
			var allowed = arguments[1];
			var specified = eval("["+arguments[2]+"]");
			if(allowed){
				var regex='</?(?!(' + specified.join('|') + '))\b[^>]*>';
				html=html.replace(new RegExp(regex, 'gi'), '');
			} else{
				var regex='</?(' + specified.join('|') + ')\b[^>]*>';
				html=html.replace(new RegExp(regex, 'gi'), '');
			}
		}
 
		//CHANGE NAME TO CLEAN JUST BECAUSE 
		var clean_string = html;
 
		//RETURN THE CLEAN STRING
		return clean_string;
	}
   

