/*
 * script that takes in content and formats it for print-friendly functionality. 
 * must be included in the printFriendly.jsp itself as well as any page that will 
 * use this functionality. 
 */
	//////////////////////////////////////////////////////////////////////////////////
	// This script parses content for PrintFriendly 
	//////////////////////////////////////////////////////////////////////////////////	
	

	function Printer_Friendly() {
      var p = "";
		
      p = document.getElementById('printFriendly').innerHTML;
      document.getElementById('parContent').value = p;
		
      if( document.getElementById('parContent').value == "" ) {
         alert("This feature does not work with your current browser.");
         return false; } 
      
      else {
        return true;
      }	
	}

  /////////////////////////////////////////////////////////////////////////////
  // this is an MPSS-specific script to show today's date and time on print page
  /////////////////////////////////////////////////////////////////////////////

  function getDateTime() { 
    var d = new Date();
    mon = d.getMonth() + 1;
    day = d.getDate();
    sec = d.getSeconds();
    
    if (sec < 10) { sec="0" + sec; }
    min = d.getMinutes();
    if (min < 10) { min="0" + min; }
    hour = d.getHours();
    
    // convert from military time
    if (hour==0) { showHour = 12 ; ampm = " AM" }
    if (hour > 0 && hour < 12 ) { showHour=hour ; ampm = " AM" }
    if (hour == 12 ) { showHour = hour ; ampm = " PM" }
    if ( hour > 12 ) { showHour = hour-12 ; ampm = " PM"}
    
    var mpssDate = ( mon + "-" + day + "-" + d.getFullYear() + "  " + 
                     showHour + ":" + min + ":" + sec + ampm + " PT" );
                     
     return(mpssDate);
    
  }
    