
function printIt()
{
var heading = document.getElementById('headingToPrint');
var content=document.getElementById('tdTextFontSize');

w=window.open('about:blank');
w.document.open();
w.document.write("<html><table><tr><td width='40'>" +
		"</td><td><p><img src='http://www.maringeneral.org/images/MGH_Print_logo1.jpg' border=0/>" +
		"</p><p><p><p><p></td><td width='40'></td></tr><tr><td width='40'></td><td><h2>"+heading.innerHTML+"</h2>" +
				"</td><td width='40'></td></tr><tr><td width='40'></td><td>" +
				"<p align='justify'>" + content.innerHTML+"</p></td><td width='40'></td></tr>");
w.document.writeln("<script>window.print()</"+"script>");
w.document.writeln("</table></html>");
w.document.close();
w.close();
}


function printHome()
{
var closeWindow = true;
	//var heading = document.getElementById('headingToPrint');
	var content=document.getElementById('textToPrint');
	var headPortion = document.getElementById('headPortionForPrint').value;
	
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){   
	closeWindow = false;
}

	w=window.open();
	w.document.open();
	w.document.write("<html>" +
		"<head>"+
		headPortion+
		"</head><body>" +
		content.innerHTML+
		""); 
	w.document.writeln("<script>window.print()</"+"script>");
	w.document.writeln("</body></html>");
	w.document.close();
	if(closeWindow)
        w.close();
}
var min=8;
 var max=18;
 function increaseFontSize() {
    var p = document.getElementById("tdTextFontSize");
if(p){
       if(p.style.fontSize) {
    	   
          var s = parseInt(p.style.fontSize.replace("px",""));
       } else {
          var s = 12;
       }
       if(s!=max) {
          s += 1;
       }

       p.style.fontSize = s+"px";
}
var name = "";
   for(var i=1;i<100;i++)
   {
	   name = "tdTextFontSize"+i;
	  // alert(name);
	   p = document.getElementById(name);
	   if(p)
	   {
	      if(p.style.fontSize) {
	         var s = parseInt(p.style.fontSize.replace("px",""));
	      } else {
	         var s = 12;
	      }
	      if(s!=max) {
	         s += 1;
	      }
	      p.style.fontSize = s+"px";
	   }
   }


 }
 function decreaseFontSize() {
 	var p = document.getElementById("tdTextFontSize");
 	   if(p)  {
 	if(p.style.fontSize) {
         var s = parseInt(p.style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p.style.fontSize = s+"px";
}
   var name = "";
   for(var i=1;i<100;i++)
   {
	   name = "tdTextFontSize"+i;
	  // alert(name);
	   p = document.getElementById(name);
	   if(p)
	   {
	      if(p.style.fontSize) {
	         var s = parseInt(p.style.fontSize.replace("px",""));
	      } else {
	         var s = 12;
	      }
	      if(s!=min) {
	         s -= 1;
	      }
	      p.style.fontSize = s+"px";
	   }
   }
   
 }
 function emailAFriend(){
     var daReferrer = document.referrer; 
     var email = ""; 
     var subject = "I thought you might be interested in this Web page: " +"'" +document.title +"'"; 
     var body_message = "I found this page: " +document.title +", and thought you might be interested in it.  Click on the link below: %0D%0D" +window.location.href;
     
     var mailto_link = 'mailto:'+email+'?subject='+subject+'&body='+body_message; 

     win = window.open(mailto_link,'emailWindow'); 
     if (win && win.open &&!win.closed) win.close(); 
}

 function SubmitSearchRequest(){	
	
	 if(document.MGH.q.value==''){
		 document.MGH.q.value = 'Marin General Hospital';
	 }
	 document.MGH.submit();	
 }


