//Function for print page

function Clickheretoprint()
{ 
 //Script for printer friendly page
 //Liz Dones 10/04/2006
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=750,height=600,left=100,top=25,resizable=yes"; 
  var content_header = document.getElementById("Print_Header").innerHTML;
  var content_subtitle = document.getElementById("Print_Subtitle").innerHTML;
  var content_value = document.getElementById("Print_Content").innerHTML;
  var Url = document.location.href;
  var docprint=window.open("","",disp_setting); 

   docprint.document.open(); 
   docprint.document.write('<html><head><title>Brigham and Women\'s Hospital</title>');
   docprint.document.write('<LINK REL=StyleSheet TYPE=\"text/css\" HREF=\"/App_CSS/PrintStyles.css\" \/>'); 
   docprint.document.write('</head><body>');
   docprint.document.write('<div id=contentArea>');       
   docprint.document.write('<img src=\"/_images/logo.gif\" border=0 \/>');
   docprint.document.write('<div align=right><a href=# onClick=\"self.print();\"><img src=/_images/PrintPage/Print.gif border=0 alt=Print-friendly \/></a>');
   docprint.document.write('<a href=\"javascript:self.close()\"><img src=/_images/PrintPage/CloseBtn.gif border=0 alt=\"Close Window\" \/></a><\/div>');
   docprint.document.write('<p>');
   docprint.document.write('<STRONG>');
   docprint.document.write(content_header);
   docprint.document.write('</STRONG>');
   docprint.document.write('<br>');
   docprint.document.write('<H1>');
   docprint.document.write(content_subtitle);
   docprint.document.write('</H1>');
   docprint.document.write(content_value);
   docprint.document.write('<p>');
   docprint.document.write('<b>Find this content at:</b>');
   docprint.document.write('<br>');
   docprint.document.write(Url);
   docprint.document.write('<hr>');
   docprint.document.write('The Brigham and Women\'s Hospital web site is primarily an educational resource intended to complement, not take the place of, the advice and recommendations you receive from your health care provider. If you have or suspect that you have a health problem, please seek the services of your health care provider.');
   docprint.document.write('<p>');
   docprint.document.write('<center>Copyright &copy; 2010 Brigham and Women\'s Hospital</center>');
   docprint.document.write('');
   docprint.document.write('</div>');       
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}

//Mail Function, will email the link  ---- Liz Dones Dec. 17, 2009

function mailThisUrl() {
	
	m = "Brigham and Women's Hospital web page of interest";
	t = document.title;
	u = "...." + window.location;

	// the following expression must be all on one line...
	window.location = "mailto:?subject="+m+"&body="+t+u;
}

/**************************************************************************/
// Increase Font or Decrease Font
// added extra tags 3.12.2101 FJD6. probably a more elegant way to do this

/** BEGIN INCREASE FONT**/
var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }

   var p = document.getElementsByTagName('strong');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }

   var p = document.getElementsByTagName('b');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }

   var p = document.getElementsByTagName('td');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }

   var p = document.getElementsByTagName('li');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   } 
   var p = document.getElementsByTagName('h2');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }    
   var p = document.getElementsByTagName('h3');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   } 
   var p = document.getElementsByTagName('h4');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }    
   var p = document.getElementsByTagName('h5');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }    
}
/** END INCREASE FONT**/

/** BEGIN DECREASE FONT**/
function decreaseFontSize() {
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
   var p = document.getElementsByTagName('strong');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   

   var p = document.getElementsByTagName('b');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   

   var p = document.getElementsByTagName('td');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
   var p = document.getElementsByTagName('li');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }         

   var p = document.getElementsByTagName('h2');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }         
      var p = document.getElementsByTagName('h3');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }         
      var p = document.getElementsByTagName('h4');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }         
   var p = document.getElementsByTagName('h5');
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }         
      
   
}
/** END DECREASE FONT**/


/**************************************************************************/


function PrintBulletin()
{ 
 //Script for printer friendly page
 //Liz Dones 08/03/2007, updated 08/03/2007
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=150, top=25"; 
    var PrintImage = document.getElementById("Print_Image").innerHTML;
    var PrintPageTitle = document.getElementById("Print_Page_Title").innerHTML;
    var content_vlue = document.getElementById("Print_Content").innerHTML;
	var Url = document.location.href;
    var docprint=window.open("","",disp_setting);
	var d = new Date();
	currentYear = d.getYear();

   docprint.document.open(); 
   docprint.document.write('<html><head><title>Brigham and Women\'s Hospital</title>');
   docprint.document.write('<LINK REL=StyleSheet TYPE=\"text/css\" HREF=\"/App_JScripts/PrintStyles.css\" \/>'); 
   docprint.document.write('</head><body>');
   docprint.document.write(PrintImage);
   docprint.document.write('<div align=right><a href=# onClick=\"self.print();\"><img src=/_images/PrintPage/Print.gif border=0 alt=Print-friendly \/></a>');
   docprint.document.write('<a href=\"javascript:self.close()\"><img src=/_images/PrintPage/CloseBtn.gif border=0 alt=\"Close Window\" \/></a><\/div>');
   docprint.document.write('<p>');
   docprint.document.write('<table id=contentArea><tr><td width=10></td><td>');       
   docprint.document.write(PrintPageTitle);
   docprint.document.write(content_vlue);
   docprint.document.write('<p>');
   docprint.document.write('<b>Find this content at:</b>');
   docprint.document.write('<br>');
   docprint.document.write(Url);
   docprint.document.write('<br><a href=\"javascript:self.close()\">Close window</a><hr>');
   docprint.document.write('The Brigham and Women\'s Hospital web site is primarily an educational resource intended to complement, not take the place of, the advice and recommendations you receive from your health care provider. If you have or suspect that you have a health problem, please seek the services of your health care provider.');
   docprint.document.write('<p>');
   docprint.document.write('<center>Copyright &copy; '+ currentYear + ' Brigham and Women\'s Hospital</center>');
   docprint.document.write('');
   docprint.document.write('</td></tr></table>');       
   docprint.document.write('</body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}

function moddate()
{

document.write("Last updated " + (document.lastModified))

}
