// donate sticker on top-right
document.write('<div style="position: absolute; left: 100%; top: 0px; overflow: visible; height: 100px; width: 100px; margin: 0 0 0 -100px; padding: 0; z-index: 9999; border: none; float: none;"><img src="http://www.healthfreedomusa.org/images/dogear.gif" width="100" height="100" border="0" usemap="#rc"></div><map name="rc"><area shape="poly" coords="0,0,100,0,100,100" href="http://www.healthfreedomusa.org/donate/"></map>');

// TELL FRIEND WINDOW
function tellFriendWindow(url)
{	
	popUpWindow(url, 'tellFriendWin', 'no', 'no', 'yes', 'yes', 'no', 'no', '500', '500', '300', '300')
}

// IN CONTEXT WINDOW
function inContext(url)
{	
	popUpWindow(url, 'inContextWindow', 'no', 'no', 'yes', 'yes', 'no', 'no', '500', '300', '300', '200')
}

// ACTION WINDOW
function actionWindow(url)
{	
	popUpWindow(url, 'actionWindow', 'no', 'no', 'yes', 'yes', 'no', 'no', '700', '600', '200', '300')
}

// ACTION WINDOW
function petitionWindow(url)
{	
	popUpWindow(url, 'actionWindow', 'no', 'yes', 'yes', 'yes', 'no', 'no', '700', '600', '200', '300')
}

	// CONTACT FOX FOR BLOGGER HALL OF FAME
function contactWindow(url)
{	
	popUpWindow(url, 'contactWindow', 'no', 'no', 'yes', 'yes', 'no', 'no', '500', '500', '300', '300')
}

// CONTACT FOX FOR BLOGGER HALL OF FAME
function contactFox(url)
{	
	popUpWindow(url, 'bloggerContactWindow', 'no', 'no', 'yes', 'yes', 'no', 'no', '500', '500', '300', '300')
}

// GENERAL WINDOW OPENER
function popUpWindow(popURL, popName, popLocation, popMenu, popResizable, popScroll, popStatus, popTool, popWidth, popHeight, popLeft, popTop)
{	config = ("'location=" + popLocation + ", menubar=" + popMenu + ",resizable=" + popResizable + ",scrollbars=" + popScroll +
	",status=" + popStatus + ",toolbar=" + popTool + ",width=" + popWidth + ",height=" + popHeight + ",left=" + popLeft + ",top=" + popTop + "'");

	windowHandle = window.open(popURL, popName, config);
}

<!--

var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;

d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( nua.indexOf( 'Linux' ) != -1 );

if ( !d.layers ){
	dom = ( d.getElementById );
	
	ie = ( d.all && !op );
	ie4 = ( ie && !dom );

	/*
	ie5x tests only for functionality. ( dom||ie5x ) would be default settings. 
	Opera will register true in this test if set to identify as IE 5
	*/

	ie5x = ( d.all && dom );
	ie5mac = ( mac && ie5x );
	ie5xwin = ( win && ie5x );
}

function add_Favorites(path, marginLeft) {
	d = document;// shorthand so we don't have to write out document each time..
	if (  ie || ie4 || ie5x || ie5mac || ie5xwin )
	{
		d.write("<a href=\"javascript:window.external.addFavorite('http://www.healthfreedomusa.org','HealthFreedomUSA.org - To Protect America from the Deceptive Codex');\"><img src=\"" + path + "images/right-column-favorites.gif\" width=\"120\" height=\"25\" border=\"0\" alt=\"Add to Favorites\" /></a>");
	}
}


function subscriberValidate(formName)
{	
	var nameValue = document[formName].First_Name.value;
	var emailValue = document[formName].Email.value;

	if (nameValue == "" || nameValue == "first name" || isWhitespace(nameValue))
	{	alert("Please fill in your name.");
		document[formName].First_Name.focus(); return false
	}
	else if ( (emailValue == "") || isWhitespace(emailValue) )
	{	
		alert("Please enter your email address.");
		document[formName].Email.focus(); return false
	}
	else if ((!(emailValue == "") || !isWhitespace(emailValue)) && !isValidEmail(emailValue))
	{	alert("Please enter your email address properly.");
		document[formName].Email.focus(); return false
	}
	
	else
	{
		document[formName].submitButton.value = "Success!"; 
		document[formName].submitButton.disabled = true; return true
	}
}

// Regular Expression validation of email
function isValidEmail(str) { 
return true
}

// Checks if string is whitespace (for form validation)
function isWhitespace(s)

{   var i = 0;
	var whitespace = " \t\n\r";
    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);

        if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}


thermoImage = new Image();
thermoImage.src = "../images/rightcolumn/thermometer-over.gif";

donateImage = new Image();
donateImage.src = "../images/rightcolumn/donate-over.gif";

// fireworks popup menu stuff
var mmOpenContainer = null;
var mmOpenMenus = null;
var mmHideMenuTimer = null;

function MM_menuStartTimeout(hideTimeout) {
	mmHideMenuTimer = setTimeout("MM_menuHideMenus()", hideTimeout);	
}

function MM_menuHideMenus() {
	MM_menuResetTimeout();
	if(mmOpenContainer) {
		var c = document.getElementById(mmOpenContainer);
		c.style.visibility = "inherit";
		mmOpenContainer = null;
	}
	if( mmOpenMenus ) {
		for(var i in mmOpenMenus) {
			var m = document.getElementById(mmOpenMenus[i]);
			m.style.visibility = "hidden";			
		}
		mmOpenMenus = null;
	}
}

function MM_menuHideSubmenus(menuName) {
	if( mmOpenMenus ) {
		var h = false;
		var c = 0;
		for(var i in mmOpenMenus) {
			if( h ) {
				var m = document.getElementById(mmOpenMenus[i]);
				m.style.visibility = "hidden";
			} else if( mmOpenMenus[i] == menuName ) {
				h = true;
			} else {
				c++;
			}
		}
		mmOpenMenus.length = c+1;
	}
}

function MM_menuOverMenuItem(menuName, subMenuSuffix) {
	MM_menuResetTimeout();
	MM_menuHideSubmenus(menuName);
	if( subMenuSuffix ) {
		var subMenuName = "" + menuName + "_" + subMenuSuffix;
		MM_menuShowSubMenu(subMenuName);
	}
}

function MM_menuShowSubMenu(subMenuName) {
	MM_menuResetTimeout();
	var e = document.getElementById(subMenuName);
	e.style.visibility = "inherit";
	if( !mmOpenMenus ) {
		mmOpenMenus = new Array;
	}
	mmOpenMenus[mmOpenMenus.length] = "" + subMenuName;
}

function MM_menuResetTimeout() {
	if (mmHideMenuTimer) clearTimeout(mmHideMenuTimer);
	mmHideMenuTimer = null;
}

function MM_menuShowMenu(containName, menuName, xOffset, yOffset, triggerName) {
	MM_menuHideMenus();
	MM_menuResetTimeout();
	MM_menuShowMenuContainer(containName, xOffset, yOffset, triggerName);
	MM_menuShowSubMenu(menuName);
}

function MM_menuShowMenuContainer(containName, x, y, triggerName) {	
	var c = document.getElementById(containName);
	var s = c.style;
	s.visibility = "inherit";
	
	mmOpenContainer = "" + containName;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

function formrule(field)
{
	if (field.defaultValue == field.value) field.value = "";
}
function formrule2(field) {
  if (field.value == "") {
    field.value = field.defaultValue;
  }
}
