function addBookmark()
{
	if ( navigator.appName=='Netscape' ) 
	{
		alert('To bookmark this site, click Bookmarks + Add bookmark\nOr press Ctrl+D.');
	}
	else 
	{
		if(document.all) 
		{
			window.external.AddFavorite('http://www.ClearMyMail.com','ClearMyMail Guaranteed E-Mail Protection');
		}
	}
	return false;
}

function addBookmark2()
{
	if ( navigator.appName=='Netscape' ) 
	{
		alert('To bookmark this site, click Bookmarks + Add bookmark\nOr press Ctrl+D.');
	}
	else 
	{
		if(document.all) 
		{
			window.external.AddFavorite('http://www.ClearMyMail.com/anti_spam_tools.aspx','FREE Internet tools from ClearMyMail');
		}
	}
	return false;
}

function switchImage(theItem, imgURL)
{
	theItem.src = imgURL;
	return false;
}

function rePost()
{
	var tempObj = document.getElementById('aspnetForm');
	tempObj.submit();
	return false;
}

function viewEmail(pendingID)
{
	pagePopNoScroll('/members/emailView.aspx?pending_id=' + pendingID, 720, 525);
	return false;
}

function viewEmail2(pendingID)
{
	pagePopNoScroll('/members/emailView.aspx?showOptions=0&pending_id=' + pendingID, 720, 525);
	return false;
}

function showRadioButtonHelp(theItem, e, trustRating)
{
	var message = '';
	var topAdjust = ''
	var halign = ''
	if(trustRating == 'ALLOW_ALL')
	{
		message = 'Select this option to allow ALL e-mail sent from this address.';
		topAdjust = '';
		halign = '30';
	}
	if(trustRating == 'TICK_ALLOW_ALL')
	{
		message = 'Select this option to set all e-mails on this page to "Allow ALL e-mail sent from the senders".';
		topAdjust = '';
		halign = '30';
	}
	if(trustRating == 'ALLOW_ONCE')
	{
		message = 'If you are not sure of this sender, then select this option to receive this message only.<br><br>If the same sender e-mails you again you will then have another chance to block or allow the address.';
		topAdjust = '';
		halign = '80';
	}
	if(trustRating == 'TICK_ALLOW_ONCE')
	{
		message = 'If you are not sure of the senders on this page, then select this option to mark <u>ALL</u> to "Receive this one message only".<br><br>If the same sender e-mails you again you will then have another chance to block or allow the address.';
		topAdjust = '';
		halign = '80';
	}
	if(trustRating == 'BLOCK')
	{
		message = 'Select this option to block ALL e-mail sent from this address.';
		topAdjust = '';
		halign = '120';
	}
	if(trustRating == 'TICK_BLOCK')
	{
		message = 'Select this option to block ALL e-mail senders shown on this page.';
		topAdjust = '';
		halign = '120';
	}
	
	if(trustRating == 'BLOCKONCE')
	{
		message = 'Select this option to block this individual e-mail message.';
		topAdjust = '';
		halign = '120';
	}
	if(trustRating == 'TICK_BLOCKONCE')
	{
		message = 'Select this option to block each individual e-mail message shown.';
		topAdjust = '';
		halign = '120';
	}
	if(trustRating == 'DELETE')
	{
		message = 'Select this option to delete this individual e-mail message';
		topAdjust = '';
		halign = '120';
	}
	if(trustRating == 'TICK_DELETE')
	{
		message = 'Select this option to delete each individual e-mail message shown.';
		topAdjust = '';
		halign=120;
	}
	
	showHelpSmall(e,message,halign,topAdjust);
	return false;
}
function showTrustHelp(theItem, e, trustRating)
{
	var message = '';
	var topAdjust = ''
	if(trustRating == 'UNKNOWN')
	{
		message = 'A trust rating of UNKNOWN signifies that we were unable to check the authenticity of the sender.<br><br>This does not mean that the sender address has been forged, but if you were not expecting the message then use caution.';
		topAdjust = '140';
	}
	if(trustRating == 'HIGH')
	{
		message = 'A trust rating of HIGH signifies that we have checked the message and it appears as though the listed sender is valid and correct.';
		topAdjust = '90';
	}
	if(trustRating == 'LOW')
	{
		message = 'A trust rating of LOW signifies that the message appears to be a forgery.<br><br>That is, the sender address seems to have been forged.<br><br>In some instances this may be ok, if for example your e-mail is forwarded on through another e-mail address.<br><br>If not, and you were not expecting the e-mail then use extreme caution when deciding whether to accept the message or not.';
		topAdjust = '250';
	}
	
	showHelp(e,message,'left',topAdjust);
	return false;
}
function showTrustHelp2(theItem, e, trustRating)
{
	var message = '';
	var topAdjust = ''
	if(trustRating == 'UNKNOWN')
	{
		message = 'A trust rating of UNKNOWN signifies that we were unable to check the authenticity of the sender.<br><br>This does not mean that the sender address has been forged, but if you were not expecting the message then use caution.';
		topAdjust = '0';
	}
	if(trustRating == 'HIGH')
	{
		message = 'A trust rating of HIGH signifies that we have checked the message and it appears as though the listed sender is valid and correct.';
		topAdjust = '0';
	}
	if(trustRating == 'LOW')
	{
		message = 'A trust rating of LOW signifies that the message appears to be a forgery.<br><br>That is, the sender address seems to have been forged.<br><br>In some instances this may be ok, if for example your e-mail is forwarded on through another e-mail address.<br><br>If not, and you were not expecting the e-mail then use extreme caution when deciding whether to accept the message or not.';
		topAdjust = '0';
	}
	
	showHelp(e,message,'right',topAdjust);
	return false;
}
function hideTrustHelp(theItem)
{
	var tempObj = document.getElementById('helpPopup');
	tempObj.style.visibility = 'hidden';
}
function hideSmallHelp(theItem)
{
	var tempObj = document.getElementById('helpPopupSmall');
	tempObj.style.visibility = 'hidden';
}
function showHelpInfo(theItem, e, message, halign, topAdjust)
{

	theItem.src = '/images/help_over.gif';
	showHelp(e, message, halign, topAdjust);
	return false;
}
function hideHelpInfo(theItem)
{
	theItem.src = '/images/help_up.gif';
	var tempObj = document.getElementById('helpPopup');
	tempObj.style.visibility = 'hidden';
	return false;
}
function showHelp(e, message, halign, topAdjust)
{
	var tempObj = document.getElementById('helpPopup');
	tempObj.style.visibility = 'visible';
	tempObj.innerHTML = '<span class="helpText">' + message + '</span>';
	var posx = 0;
	var posy = 0;
	
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop;
	}
	if(topAdjust != '')
	{
		tempObj.style.top = (posy-topAdjust) + 'px';
	}
	else
	{
		tempObj.style.top = (posy+10) + 'px';
	}
	
	if(halign == 'left')
	{
		tempObj.style.left = (posx-165) + 'px';
	}
	else
	{
		tempObj.style.left = posx + 'px';
	}

	
}
function showHelpSmall(e, message, halign, topAdjust)
{
	var tempObj = document.getElementById('helpPopupSmall');
	tempObj.style.visibility = 'visible';
	tempObj.innerHTML = '<span class="helpText">' + message + '</span>';
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY)
	{
		posx = e.clientX + document.body.scrollLeft;
		posy = e.clientY + document.body.scrollTop;
	}
	if(topAdjust != '')
	{
		tempObj.style.top = posy-topAdjust;
	}
	else
	{
		tempObj.style.top = posy+10;
	}
	if(halign != '')
	{
		tempObj.style.left = posx-halign;
	}
	else
	{
		tempObj.style.left = posx;
	}
}

function pagePop(url, width, height)
{
	var pagePop = window.open(url, "pagePop",
			      "toolbar=no,menubar=no,personalbar=no,width=" + width + ",height=" + height + "," +
			      "scrollbars=yes,resizable=yes");
	return false;
}
function pagePopNoScroll(url, width, height)
{
	var pagePop = window.open(url, "pagePop",
			      "toolbar=no,menubar=no,personalbar=no,width=" + width + ",height=" + height + "," +
			      "scrollbars=no,resizable=yes");
	return false;
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

function GetWidth()
{
      var x = 0;
      if (self.innerHeight)
      {
              x = self.innerWidth;
      }
      else if (document.documentElement && document.documentElement.clientHeight)
      {
              x = document.documentElement.clientWidth;
      }
      else if (document.body)
      {
              x = document.body.clientWidth;
      }
      return x;
}

function GetHeight()
{
      var y = 0;
      if (self.innerHeight)
      {
              y = self.innerHeight;
      }
      else if (document.documentElement && document.documentElement.clientHeight)
      {
              y = document.documentElement.clientHeight;
      }
      else if (document.body)
      {
              y = document.body.clientHeight;
      }
      return y;
}

function scrollTop() {
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win, n_docel, n_body) {
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel)))
		n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}
