    /*****************************************************************************************
     * Dreamweaver's preload images function
     *****************************************************************************************/
  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];}}
  }


    /*****************************************************************************************
     * This function writes out the current email address in a way to avoid spam
     *****************************************************************************************/
    function noSpamEmail(theaddr)
    {
        var part1 = "@";
        var part2 = "rheumatology";
        var part3 = ".org";

        document.write("<a href=mailto:", theaddr + part1 + part2 + part3, ">" + theaddr + part1 + part2 + part3 + "</a>");
    }

    function noSpamExternal(theaddr, thedomain, theorg)
    {
        document.write("<a href=mailto:", theaddr + "@" + thedomain + "." + theorg, ">" + theaddr + "@" + thedomain + "." + theorg + "</a>");
    }

    function noSpamExternalSubject(theaddr, theorg, thesubj)
    {
        document.write("<a href=mailto:", theaddr + "@" + theorg, ">" + thesubj + "</a>");
    }

/*****************************************************************************************
 * This function finds a form object in the document
 *     Taken from Dreamweaver Ultradev Code Snippets
 *****************************************************************************************/
function findObj(theObj, theDoc)
{
  var p, i, foundObj;

  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++)
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  return foundObj;
}

function PrintThisPage(inElement)
{
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25";

   var sWinHTML = document.getElementById(inElement).innerHTML;

   var winprint=window.open("","",sOption);
       winprint.document.open();
       winprint.document.write('<html><head><LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/mainstyles.css"><LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/mem.css">\n');
       winprint.document.write('<script LANGUAGE="JavaScript" TYPE="text/javascript">\n');
       winprint.document.write('function noSpamEmail(theaddr) { var part1 = \"@\"; var part2 = \"rheumatology\"; var part3 = \".org\";document.write(\"<a href=mailto:\", theaddr + part1 + part2 + part3, \">\" + theaddr + part1 + part2 + part3 + \"</a>\");}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) { document.write(\"<a href=mailto:\", theaddr + \"@\" + thedomain + \".\" + theorg, \">\" + theaddr + \"@\" + thedomain + \".\" + theorg + \"</a>\");}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { document.write(\"<a href=mailto:\", theaddr + \"@\" + theorg, \">\" + thesubj + \"</a>\");}\n');
       winprint.document.write('</script>\n');
       winprint.document.write('</head><body>');
       winprint.document.write('<img src="http://www.rheumatology.org/images/acrlogo.jpg" width="266" height="59"><br><br><br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br>©2007 American College of Rheumatology');
       winprint.document.write('</body></html>');
       winprint.document.close();
       winprint.focus();
}

function PrintThisPageARHP(inElement)
{
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25";

   var sWinHTML = document.getElementById(inElement).innerHTML;

   var winprint=window.open("","",sOption);
       winprint.document.open();
       winprint.document.write('<html><LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/mainstyles.css"><LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/rhp.css">');
       winprint.document.write('<script LANGUAGE="JavaScript" TYPE="text/javascript">\n');
       winprint.document.write('function noSpamEmail(theaddr) { var part1 = \"@\"; var part2 = \"rheumatology\"; var part3 = \".org\";document.write(\"<a href=mailto:\", theaddr + part1 + part2 + part3, \">\" + theaddr + part1 + part2 + part3 + \"</a>\");}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) { document.write(\"<a href=mailto:\", theaddr + \"@\" + thedomain + \".\" + theorg, \">\" + theaddr + \"@\" + thedomain + \".\" + theorg + \"</a>\");}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { document.write(\"<a href=mailto:\", theaddr + \"@\" + theorg, \">\" + thesubj + \"</a>\");}\n');
       winprint.document.write('</script>\n');
       winprint.document.write('</head><body>');
       winprint.document.write('<img src="http://www.rheumatology.org/images/arhplogo_withText.gif" width="450" height="78"><br><br><br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br>©2007 American College of Rheumatology');
       winprint.document.write('</body></html>');
       winprint.document.close();
       winprint.focus();
}

function PrintThisPageREF(inElement)
{
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,";
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25";

   var sWinHTML = document.getElementById(inElement).innerHTML;

   var winprint=window.open("","",sOption);
       winprint.document.open();
       winprint.document.write('<html><LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/mainstyles.css"><LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/ref.css">');
       winprint.document.write('<script LANGUAGE="JavaScript" TYPE="text/javascript">\n');
       winprint.document.write('function noSpamEmail(theaddr) { var part1 = \"@\"; var part2 = \"rheumatology\"; var part3 = \".org\";document.write(\"<a href=mailto:\", theaddr + part1 + part2 + part3, \">\" + theaddr + part1 + part2 + part3 + \"</a>\");}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) { document.write(\"<a href=mailto:\", theaddr + \"@\" + thedomain + \".\" + theorg, \">\" + theaddr + \"@\" + thedomain + \".\" + theorg + \"</a>\");}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { document.write(\"<a href=mailto:\", theaddr + \"@\" + theorg, \">\" + thesubj + \"</a>\");}\n');
       winprint.document.write('</script>\n');
       winprint.document.write('</head><body>');
       winprint.document.write('<img src="http://www.rheumatology.org/images/reflogo.jpg" width="200" height="68"><br><br><br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br>©2007 American College of Rheumatology');
       winprint.document.write('</body></html>');
       winprint.document.close();
       winprint.focus();
}

function PrinterFriendly(inElement)
{
   if (findObj(inElement)!=null)
   {
      PrintThisPage(inElement)
   }
}

function PrinterFriendlyARHP(inElement)
{
   if (findObj(inElement)!=null)
   {
      PrintThisPageARHP(inElement)
   }
}

function PrinterFriendlyREF(inElement)
{
   if (findObj(inElement)!=null)
   {
      PrintThisPageREF(inElement)
   }
}

