function printIt()
{
//var heading = document.getElementById('headingToPrint');
var window_url_for_print = "";
if(document.getElementById('pageTitleForPrint')!=null)
	window_url_for_print = document.getElementById('pageTitleForPrint').value;

var content=document.getElementById('headingToPrint');
var headPortion ="";
if(document.getElementById('pageHeaderHead')!=null)
	headPortion = document.getElementById('pageHeaderHead').value;

	if(window_url_for_print=='Marin Cancer Institute')
	{
		//print();
		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();
		w.close();

	}
	else
	{

		w=window.open();
		w.document.open();
		w.document.write("<html><table><tr><td width='40'>" +
		"</td><td>" +
			"<p>" +
			"<img src='http://www.marincancerinstitute.org/images/Marin-Logo.jpg' border=0/>" +
			" &nbsp;&nbsp; <h4>"+window_url_for_print+
			"</h4> </p>" +
			content.innerHTML+"</td><td width='40'></td></tr>"); 
		w.document.writeln("<script>window.print()</"+"script>");
		w.document.writeln("</table></html>");
		w.document.close();
w.close();

	}
}



function SubmitRequest(contextPath,pgc, opt)
{
	document.frmMCI.action = contextPath+"/MCIServlet";
	document.frmMCI.opCode.value = opt;
	document.frmMCI.pgCode.value = pgc;
	document.frmMCI.target = "_self";
	document.frmMCI.submit();
	
}

function SubmitSearchRequest()
{
	document.frmMCI.action = "http://www.google.com/search";
	//document.frmMCI.action = "get";
	document.frmMCI.target = "_blank";
	document.frmMCI.submit();
	
}

function submitOnEnter(event) {
	if(event.keyCode == 13) {
		SubmitSearchRequest();
		return false;
	}
	//return false;
}

//--------- Added emailAFriend function to support email button - Vartika
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(); 
}

//------------------increase decrease font....

var min=8;
var max=18;
function increaseFontSize() {
   var p = document.getElementById("tdPageText");
   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<30;i++)
   {
	   name = "tdPageText"+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("tdPageText");
	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<30;i++)
	   {
		   name = "tdPageText"+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";
			}	
		   
	   }

}


//var p = document.getElementsByTagName('p');
//var p = document.getElementById("tdPageText");
//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('p');