function win_title(pg_title, sPtName, sMedRecNo){
/* 08/14/2006  hjbriske
 * Set the window title bar value
 * On stylesheet can pass in ptname and med rec no cookies, which fix the formatting issues.
 * 
 * Parmeters: pg_title  title of page
 *            sPtName   Patient name, if no PMI display then '' will not show patient name
 *            sMedRecNo a 12 digit medical record numbe, if no PMI display then '' will not show med_rec_no
*/
   
    if ((sPtName.length == 0) && (sMedRecNo.length == 0)){
       document.title = 'Gundersen Lutheran: ' + pg_title;
    }else{
      if (sMedRecNo.substr(4,1) == '0'){
         sMedRecNo = sMedRecNo.substr(5,6) + '-' + sMedRecNo.substr(11,1);       
      }else{
         sMedRecNo = sMedRecNo.substr(4,7) + '-' + sMedRecNo.substr(11,1);
      }
      
      document.title = 'Gundersen Lutheran: ' + pg_title + ' for ' + decodeURIComponent(sPtName).replace(/[\+]/g,' ') + ' ' + sMedRecNo ;
    }
}