    /*****************************************************************************************
     * 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 style='text-decoration:none;color:#0278c0;font-weight:bold;' href=mailto:", theaddr + part1 + part2 + part3, " onmouseover=this.style.textDecoration='underline'; onmouseout=this.style.textDecoration='none';>" + theaddr + part1 + part2 + part3 + "</a>");
    }

    function noSpamExternal(theaddr, thedomain, theorg)
    {
        document.write("<a style='text-decoration:none;color:#0278c0;font-weight:bold;' href=mailto:", theaddr + "@" + thedomain + "." + theorg, " onmouseover=this.style.textDecoration='underline'; onmouseout=this.style.textDecoration='none';>" + theaddr + "@" + thedomain + "." + theorg + "</a>");
    }

    function noSpamExternalSubject(theaddr, theorg, thesubj)
    {
        document.write("<a style='text-decoration:none;color:#0278c0;font-weight:bold;' href=mailto:", theaddr + "@" + theorg, " onmouseover=this.style.textDecoration='underline'; onmouseout=this.style.textDecoration='none';>" + 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 PrintThisPageCME(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) {return;}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) {return;}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { return;}\n');
       winprint.document.write('function print_mail(left,right,end) { return;}\n');
       winprint.document.write('function switchColour(row,i){return;}\n');
       winprint.document.write('function toggle(row, i){return;}\n');
       winprint.document.write('function switchBack(row, i){return;}\n');
       winprint.document.write('</script>\n');
       winprint.document.write('</head><body><br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br>©2010 American College of Rheumatology');
       winprint.document.write('</body></html>');
       winprint.document.close();
       winprint.focus();
       winprint.print(); 
}

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) {return;}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) {return;}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { return;}\n');
       winprint.document.write('function print_mail(left,right,end) { return;}\n');
       winprint.document.write('function switchColour(row,i){return;}\n');
       winprint.document.write('function toggle(row, i){return;}\n');
       winprint.document.write('function switchBack(row, i){return;}\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>©2010 American College of Rheumatology');
       winprint.document.write('</body></html>');
       winprint.document.close();
       winprint.focus();
       winprint.print(); 
}

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) {return;}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) {return;}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { return;}\n');
       winprint.document.write('function print_mail(left,right,end) { return;}\n');
       winprint.document.write('function switchColour(row,i){return;}\n');
       winprint.document.write('function toggle(row, i){return;}\n');
       winprint.document.write('function switchBack(row, i){return;}\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>©2010 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) {return;}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) {return;}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { return;}\n');
       winprint.document.write('function print_mail(left,right,end) { return;}\n');
       winprint.document.write('function switchColour(row,i){return;}\n');
       winprint.document.write('function toggle(row, i){return;}\n');
       winprint.document.write('function switchBack(row, i){return;}\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>©2010 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)
   }
}

function PrinterFriendlyAll(inElement,inTempl, inAud)
{
   if (findObj(inElement)!=null)
   {
      PrintThisPageREF(inElement,inTempl, inAud)
   }
}

function PrintThisPageAll(inElement,inTempl, inAud)
{
   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>\n<head>\n<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/mainstyles.css">\n');
       winprint.document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="http://www.rheumatology.org/codelib/styles/');
     if (inAud == "")
     {
       winprint.document.write('mem');
     }
     else
     {
       winprint.document.write(inAud);
     }
       winprint.document.write('.css">\n');
       winprint.document.write('<link rel="stylesheet" type="text/css" href="http://www.rheumatology.org/codelib/styles/annprint.css" media="print">\n');
       winprint.document.write('<script language="JavaScript" src="http://www.rheumatology.org/codelib/js/expand_collapse.js" type="text/javascript"></script>\n');
       winprint.document.write('<script LANGUAGE="JavaScript" TYPE="text/javascript">\n');
       winprint.document.write('function noSpamEmail(theaddr) {return;}\n');
       winprint.document.write('function noSpamExternal(theaddr, thedomain, theorg) {return;}\n');
       winprint.document.write('function noSpamExternalSubject(theaddr, theorg, thesubj) { return;}\n');
       winprint.document.write('function print_mail(left,right,end) { return;}\n');
       winprint.document.write('function switchColour(row,i){return;}\n');
       winprint.document.write('function toggle(row, i){return;}\n');
       winprint.document.write('function switchBack(row, i){return;}\n');
       winprint.document.write('function bgr_color(obj, color, quad){return;}\n');
       winprint.document.write('function bgr_color_out(obj, pos){return;}\n');
       winprint.document.write('function expandArraySimple(list_s,number_s){return;}\n');
       winprint.document.write('function collapseArraySimple(list_s,number_s){return;}\n');
       winprint.document.write('</script>\n');
       winprint.document.write('</head>\n<body>');
     if (inTempl == "rhp")
     {
       winprint.document.write('<img src="http://www.rheumatology.org/images/arhplogo_withText.gif" width="450" height="78"><br><br><br>');
     }
     else if (inTempl == "ref")
     {
       winprint.document.write('<img src="http://www.rheumatology.org/images/reflogo.jpg" width="200" height="68"><br><br><br>');
     }
     else
     {
       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>©2010 American College of Rheumatology');
       winprint.document.write('</body></html>');
       winprint.document.close();
       winprint.focus();
}


