//******************************************************************************
//* Created By: Jack Liao                       
//* Created On: 7/15/2007                       
//* ---------------------------------------------------------------------------- 
//* Description:                                
//*    This is the main javascript library for  
//*    all Arbor Research web sites.            
//* ---------------------------------------------------------------------------- 
//* HISTORY (MM/DD/YYYY NAME: CHANGE DESCRIPTION)
//*   7/15/2009 Jack: Created initial sets of common functions that
//*                   is based on DOPPSLink application. 
//******************************************************************************


// Recursively find its parent with matching keyword using DOM
function findParentNode(obj, matchPart) {
	var re = new RegExp(matchPart);
	var parent = obj.parentNode;
	if (parent && parent != null) {
		if (!parent.id || parent.id == null)
			parent = findParentNode(parent, matchPart);
		else if (!re.test(parent.id))
			parent = findParentNode(parent, matchPart);
	}
	else 
		parent = obj;
	
	return parent;
}

// Put the cursor at the end of text in a textbox
function setCursorToEndOfText(tbid) {
    var textbox = document.getElementById(tbid);
    if(textbox != null && textbox.value.length > 0) {
        var fieldRange = textbox.createTextRange();
        fieldRange.moveStart('character', textbox.value.length);
        fieldRange.collapse();
        fieldRange.select();
    } else if(textbox != null) {
        // when textbox is empty, then just focus inside it
        textbox.focus();
    }
}

// gets the browser screen view area total width
function getBrowserScreenWidth() {
   if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    return window.innerWidth;
   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientWidth;
   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    return document.body.clientWidth;
   } else {
    return 0;
   }
}

// gets the browser screen view area total height
function getBrowserScreenHeight() {
   if( typeof(window.innerHeight) == 'number' ) {
    //Non-IE
    return window.innerHeight;
   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    return document.documentElement.clientHeight;
   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    return document.body.clientHeight;
   } else {
    return 0;
   }
}

// test if passed-in "obj" is an Array
function is_array(obj){
	return obj instanceof Array;
}

function is_in_array(arr, obj) {
    if(is_array(arr) && arr.length > 0) {
        for(var i=0; i<arr.length; i++) {
            if(arr[i] == obj) return true;
        }
    }
    return false;
}

// converts a boolean value to integer 1 or 0
// true --> 1, false --> 0
function ConvertBoolTo01(tf) {
    if(tf) {
        return 1;
    }
    return 0;
}

// clears all input elements inside a div
function clearDivContent(div_id) {
    var div = document.getElementById(div_id);
    if(div != null) {
        var inputs = div.getElementsByTagName("input");
        for(var i=0; i<inputs.length; i++) {
            if(inputs[i].type == "text") {
                inputs[i].value = "";
            }
            else if(inputs[i].type == "hidden") {
                inputs[i].value = "";
            }
        }
    }
}

// Show a popup on top of a gray layer
// the gray layer covers the whole page, so the user can't interact with the form until the popup is closed.
// the popup is at the center of the page
function showModalPopup(popup_id) {
    var div1 = document.getElementById("modalPtDiv");
    if(div1 == null) {
        div1 = document.createElement("DIV");
        div1.id = "modalPtDiv";
        div1.className = "transparentLayer";
        document.body.appendChild(div1);
    }
    
    var div2 = document.getElementById(popup_id);
    if(div2 != null) {
        div1.style.zIndex = 1000;
        div1.style.display = "block";
        div1.style.visibility = "visible";
        if(document.body.scrollHeight ) {
           div1.style.height = document.body.scrollHeight + "px";
        }
        div2.style.zIndex = div1.style.zIndex + 1;
        div2.style.position = "absolute";
        div2.style.display = "block";
        div2.style.visibility = "visible";
        // IMPORTANT: we always display div first, so that we can get its offsetWidth and offsetHeight
        var x = Math.floor((getBrowserScreenWidth() - div2.offsetWidth)/2);
        var y = Math.floor((getBrowserScreenHeight() - div2.offsetHeight)/2);
        if(x < 0) x = 0;
        if (y < 0) y = 0;
        y = y + $(document).scrollTop();
        div2.style.left = x + "px";
        div2.style.top = y + "px";   
    }
}

// Hide the popup and the gray layer.
function hideModalPopup(popup_id) {
    var div1 = document.getElementById("modalPtDiv");
    var div2 = document.getElementById(popup_id);
    if(div1 != null) {
      div1.style.display = "none";
      div1.style.visibility = "hidden";
    }
    if(div2 != null) {
      div2.style.display = "none";
      div2.style.visibility = "hidden";
    }	
}

// trim the leading and trailing character specified
 function trim(string, ch) {
    // leading
    while(string.charAt(0) == ch) {
        string = string.substring(1);
    }
    // trailing
    while(string.charAt(string.length-1) == ch) {
        string = string.substring(0, string.length - 1);
    }
    return string;
 }
 
 // test if a character is a digit
 function isDigit(c) {
    return ((c >= "0") && (c <= "9"))
 }

 // test if a string is integer
 function isInteger(s) {
    var i;
    for (i = 0; i < s.length; i++) {
	     var c = s.charAt(i);
         if (!isDigit(c)) return false;
    }
    return true;
 }
 
 // test if a string only contains alphabet [a-z]
 function isAlphabet(s) {
    var pattern = /^[A-Za-z]$/;
    for(var i=0; i<s.length; i++) {
        if(!s.charAt(i).match(pattern)) return false;
    }
    return true;
 }
 
 function IsValidDayForMonth(month, day, year) {
   var leapYear = new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
   var regularYear = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
 
   var maxDays;
   if (IsLeapYear(year))
      maxDays = leapYear[month - 1];
   else
      maxDays = regularYear[month - 1];
    
   if(day > maxDays || day < 1)
      return false;
 
   return true;
 }
 
 function IsLeapYear(year)
 {
   return new Date(year,2-1,29).getDate() == 29;
 }
 
 
 // define an iframe for fixing the bug of select box appearing above the message div
 var popupIFrame = null;
   
 function createIFrame(iFrame_id) {
   var new_iframe = document.createElement("IFRAME");
   new_iframe.id = iFrame_id;
   new_iframe.style.filter = "alpha(opacity=0)";
   document.body.appendChild(new_iframe);
   return new_iframe;
 }

 function hideIFrame() {
   // destroy the iframe when hiding the div
   if(popupIFrame != null)
     document.body.removeChild(popupIFrame);
   popupIFrame = null;
 }
 
function showIFrame(div) {
  // create an iframe that has the same position and size as div, so that the 
  // div will be above the select box
  if(popupIFrame == null) {
  //		popupIFrame = document.createElement("IFRAME");
  //		popupIFrame.id = "floatIFrame";
    popupIFrame = createIFrame("floatIFrame");
    popupIFrame.style.zIndex=div.style.zIndex - 1;
    popupIFrame.style.position="absolute";
    popupIFrame.style.left = div.offsetLeft + "px";
    popupIFrame.style.top = div.offsetTop + "px";
    popupIFrame.style.width = div.offsetWidth + "px";
    popupIFrame.style.height = div.offsetHeight + "px";
  //		popupIFrame.style.filter = "alpha(opacity=0)";
  //		document.body.appendChild(popupIFrame);
  }
}

function convertStringToType(value, data_type) {
	if(value != null && value.length > 0) {
	  switch(data_type.toLowerCase()) {
			case "float":
				return parseFloat(localizeNumberToENUS(value));
				
			case "int":
				return parseInt(value);
				
			case "datetime":
				return new Date(value);
	  }
  }
  return null;
}

function localizeNumberToENUS(val) {
  // convert 1,43 to 1.43
  // since client side doesn't allow number group seperator, it is safe to just 
  // change "," to "."
  return val.replace(",", ".");
}

function set_dropdown_options(option_str, ddl) {
    if(ddl != null && option_str.length > 0) {
        //if(ddl.options.length > 0) {
            RemoveAllOptionsInDropDown(ddl);
        //}
                
        var options = option_str.split(';');
        for(var i=0; i<options.length; i++) {
            var vals = options[i].split('|');
            var opt = document.createElement("option");
            opt.text = vals[0];
            // vals[2] indicates if it is a N/A option
//            if(vals[2] == "0") {
                opt.value = vals[1];
//                opt.selected = true;
//            } else {
//                opt.value = "NA";
//            }
            ddl.options.add(opt);
        }
        //ddl.click();
//        RecordDropDownSelectedValue(ddl, $get("selectedDdlBatch"));
    }
}

function RemoveAllOptionsInDropDown(ddl) {
    if(ddl != null)
        while(ddl.options.length > 0)
            ddl.options.remove(ddl.options.length - 1);
}

// convert the special chars in vb format to its original ascii format
 function convertSpecialCharsFromVB(str) {
    str = str.replace(/Chr\(34\)/g, '"');
    str = str.replace(/Chr\(44\)/g, ",");
    str = str.replace(/Chr\(58\)/g, ":");
    str = str.replace(/Chr\(13\)/g, "\r");
    str = str.replace(/Chr\(10\)/g, "\n");
    return str
 }
 
 // convert the special chars in its original ascii format to vb format
 function convertSpecialCharsToVB(str) {
    str = str.replace(/\"/g, "Chr(34)");
    str = str.replace(/,/g, "Chr(44)");
    str = str.replace(/:/g, "Chr(58)");
    str = str.replace(/&/g, "Chr(38)");
    str = str.replace(/\|/g, "Chr(124)");
    return str
 }
 
 // Global Enum variable for error types
 var errorTypes = {None:0, Information:1, Warn:2, Error:3};
 
 function MessagePopup(msg, btn_text, error_type) {
    var div = document.getElementById("standard_msg_popup");
    if(div == null) { // if not exist, create one
        div = document.createElement("DIV");
        div.id = "standard_msg_popup";
        document.body.appendChild(div);
    }
    div.style.border = "solid 2px #003366";
    div.style.backgroundColor = "#ffffff";
    div.style.padding = "2px";
    div.style.maxWidth = "500px";
    if(btn_text == null || btn_text.length <= 0) btn_text = "Close";
    
    div.innerHTML = "<table><tr>" + GetImageHTMLString(error_type) + "<td>" + msg + "</td></tr></table>";
    div.innerHTML += "<br style='line-height:8px;'/><div style='text-align:center;'><a class='button' style='cursor:default;' onclick=\"hideModalPopup('" + div.id + "');\">" + btn_text + "</a></div><br/>";
    showModalPopup(div.id);
 }

 function MessagePopup2(title, msg, btn_text, error_type) {
     var strTeamTable = "<table width='450px'><tr><td style=background-color:#003366;><p style=color:White; font-size:14px; padding:10px;>&nbsp;&nbsp;&nbsp;" + title + "</p></p></td></tr><tr><td valign=top style=border: solid 1px lightgray;>";
     strTeamTable = strTeamTable + "<span style=font-weight: normal;>" + msg + "</span></td></tr></table>";


     var div = document.getElementById("standard_msg_popup");
     if (div == null) { // if not exist, create one
         div = document.createElement("DIV");
         div.id = "standard_msg_popup";
         document.body.appendChild(div);
     }
     div.style.border = "solid 2px #003366";
     div.style.backgroundColor = "#ffffff";
     div.style.padding = "2px";
     div.style.maxWidth = "500px";
     if (btn_text == null || btn_text.length <= 0) btn_text = "Close";

     div.innerHTML = "<table><tr>" + GetImageHTMLString(error_type) + "<td>" + strTeamTable + "</td></tr></table>";
     div.innerHTML += "<br style='line-height:8px;'/><div style='text-align:center;'><a class='button' style='cursor:default;' onclick=\"hideModalPopup('" + div.id + "');\">" + btn_text + "</a></div><br/>";
     showModalPopup(div.id);
 }
 
 function ConfirmPopup(msg, btn_clicked, ok_btn_text, cancel_btn_text, error_type) {
//    var action = "";
//    if(event) action = event.srcElement.toString().replace("javascript:", "");
  
    var div = document.getElementById("custom_confirm_popup");
    if(div == null) { // if not exist, create one
        div = document.createElement("DIV");
        div.id = "custom_confirm_popup";
        document.body.appendChild(div);
    }
    div.style.border = "solid 2px #003366";
    div.style.backgroundColor = "#ffffff";
    div.style.padding = "8px";
    div.style.maxWidth = "400px";
    if(ok_btn_text == null || ok_btn_text.length <= 0) ok_btn_text = "Continue";
    if(cancel_btn_text == null || cancel_btn_text.length <= 0) cancel_btn_text = "Cancel";
    
    div.innerHTML = "<table><tr>" + GetImageHTMLString(error_type) + "<td>" + msg + "</td></tr></table>";
    div.innerHTML += "<br/><br/><div style='text-align:center;'><a class='button' style='cursor:default;' onclick=\"ClickButton('" + btn_clicked.id + "');\">&nbsp;&nbsp;" + ok_btn_text + "&nbsp;&nbsp;</a>&nbsp;<a class='button' style='cursor:default;' onclick=\"hideModalPopup('" + div.id + "');\">&nbsp;&nbsp;" + cancel_btn_text + "&nbsp;&nbsp;</a></div><br/>";
    showModalPopup(div.id);
    
    return false;  // always return false to block postback. The Continue button click will trigger the postback for the same event.
 }
 
 function ClickButton(id) {
    var button = document.getElementById(id);
    if(button != null) {
        var str = button.onclick.toString();
        // remove "return ConfirmPopup(...);"
        str = str.replace(/return ConfirmPopup\(.*\);/i, "");
        button.onclick = str;
        button.click();
    }
 }
 
 // To use this function, you need to have "images" folder at the root level,
 // and have 3 image files in it: alert.gif, info.gif and error_medium.gif
 function GetImageHTMLString(error_type) {
    var image_indicator = "";
    if(error_type != null) {
        if(error_type == 1) image_indicator = "<td valign='top'><img src='" + GetServerRootPath() + "/images/info.gif' /></td>";
        else if(error_type == 2) image_indicator = "<td valign='top'><img src='" + GetServerRootPath() + "/images/alert.gif' /></td>";
        else if(error_type == 3) image_indicator = "<td valign='top'><img src='" + GetServerRootPath() + "/images/error_medium.gif' /></td>";
    }
    return image_indicator;
 }
 
 // To use this function, create a HTML hidden field in the master page or banner user control
 // with id="hidden_server_path", and use the "Request.ApplicationPath" to set the hidden field value
 function GetServerRootPath() {
    var hidden = document.getElementById("hidden_server_path");
    if(hidden != null) {
        return hidden.value;
    }
    return "";
 }
 
 function getCurrentFocusedElementByEvent(e) {
    if(!e) e=event;
    return (e.target) ? e.target : e.srcElement;
 }
 
 function getTargetActionElementID(current_focused_id) {
    if(element_action_mapping != null && element_action_mapping.length>0 && current_focused_id != null) {
        for(var i=0; i<element_action_mapping.length; i++) {
            var map = element_action_mapping[i].split('|');
            var source = map[0];
            var target = map[1];
            if(source.toLowerCase() == current_focused_id.toLowerCase()) {
                return target;
            }
        }
    }
    return "";
}


//Declare bios here//
var title = "title";
var img = "img";
var blurb = "blurb";
var strBioTable = "<table width='450px'><tr><td style=background-color:#003366;><p style=color:White; font-size:14px; padding:10px;>&nbsp;&nbsp;&nbsp;" + title + "</p></td></tr><tr><td valign=top style=border: solid 1px lightgray;>";
strBioTable = strBioTable + "<table align=left cellpadding=0 cellspacing=0><tr><td>" + img + "</td>";
strBioTable = strBioTable + "<td width=10><table border=0 cellpadding=0 cellspacing=0><tr><td width=10></td></tr></table></td>";
strBioTable = strBioTable + "</tr><tr><td height=8px></td></tr></table><span style=font-weight: normal;>" + blurb + "</span></td></tr></table>";


//merion bio//
var strtitleBM = "Robert M. Merion, MD, FACS";
var strimgBM = "<img src=images/BobMerion.jpg id=bobmphoto align=left />";
var strbobm = "Robert M. Merion, MD, FACS, is President of Arbor Research, Professor of Surgery at the University of Michigan (UM), and emeritus President of the American Society of Transplant Surgeons (ASTS). He serves as the principal investigator of the National Institutes of Health (NIH)-funded <a href='http://www.nih-a2all.org' target='_blank'>Adult to Adult Living Donor Liver Transplantation Study</a> (A2ALL) and the <a href='http://www.nih-livingdonor.org' target='_blank'>Renal and Lung Living Donors Evaluation Study</a> (RELIVE). Dr. Merion has also served as the clinical transplant director of the U.S. Department of Health and Human Services-funded Scientific Registry of Transplant Recipients (SRTR). At UM, he directs the transplant fellowship training program. His previous positions at UM include chief of the Division of Transplantation and director of the Transplant Center.";

var strBM = strBioTable.replace(title, strtitleBM);
strBM = strBM.replace(img, strimgBM);
strBM = strBM.replace(blurb, strbobm);


//wolfe bio//
var strtitleBW = "Robert A. Wolfe, PhD";
var strimgBW = "<img src=images/BobWolfe.jpg id=bobmphoto align=left />";
//var strbobw = "Robert A. Wolfe, PhD, is Vice President of Arbor Research and a Professor Emeritus of Biostatistics at the University of Michigan (UM) School of Public Health. He is principal investigator of the Centers for Medicare & Medicaid Services (CMS) End-Stage Renal Disease <a href='http://www.arborresearch.org/ESRD.aspx'>(ESRD) Quality Measures Development and Maintenance Support project</a>. He also is co-investigator of the <a href='http://www.dopps.org/' target='_blank'>Dialysis Outcomes and Practice Patterns Study</a> (DOPPS) and deputy project director of the Clinical Outcomes of Live Organ Donors &#45; Data Coordinating Center, funded by the National Institutes of Health (NIH). Dr. Wolfe served as principal investigator of the U.S. Department of Health and Human Services-funded Scientific Registry of Transplant Recipients (SRTR). He was founder and director of the UM Kidney Epidemiology and Cost Center (KECC); co-principal investigator and director of biostatistics for the NIH-funded United States Renal Data System (USRDS) from 1988 to 1997; and USRDS director from 1997 to 1999.";
var strbobw = "Robert A. Wolfe, PhD, is a professor emeritus of biostatistics at the University of Michigan (UM) School of Public Health. He served as a vice president of Arbor Research from 2005 to 2011. During this time, he was principal investigator of the Centers for Medicare & Medicaid Services (CMS) End-Stage Renal Disease <a href='http://www.arborresearch.org/ESRD.aspx'>(ESRD) Quality Measures Development and Maintenance Support project</a> and the US Department of Health and Human Services-funded Scientific Registry of Transplant Recipients (SRTR). He was founder and director of the UM Kidney Epidemiology and Cost Center (KECC); co-principal investigator and director of biostatistics for the NIH-funded United States Renal Data System (USRDS) from 1988 to 1997; and USRDS director from 1997 to 1999. He has produced over 210 peer-reviewed publications, including seminal work on dialysis treatments and outcomes, transplant outcomes, and standardized mortality ratios. Dr. Wolfe has made substantial contributions to the statistical theory of survival analysis and to empirical evidence-based research regarding patients with kidney disease."

var strBW = strBioTable.replace(title, strtitleBW);
strBW = strBW.replace(img, strimgBW);
strBW = strBW.replace(blurb, strbobw);

//Ramirez bio//
var strtitleSR = "Sylvia Ramirez, MD, MPH, MBA";
var strimgSR = "<img src=images/SilviaRamirez.jpg id=bobmphoto align=left />";
var strsilviar = "Sylvia P. B. Ramirez, MD, MPH, MBA, is Vice President of Global Research and Development at Arbor Research. She is a clinical nephrologist and a population epidemiologist with nearly 20 years of pediatric clinical care, nephrology, and transplant experience. She is principal investigator of the <a href='http://www.arborresearch.org/ESRD_DMDemo.aspx#Qip'>Quality Incentive Payment Demonstration</a> project, co-director of the End Stage Renal Disease <a href='http://www.arborresearch.org/ESRD.aspx'>(ESRD) Quality Measures Development and Maintenance Support project</a>, and was the principal investigator of the <a href='http://www.arborresearch.org/ESRD_DMDemo.aspx'>Evaluation of ESRD Disease Management</a> Demonstration, all funded by the Centers for Medicare & Medicaid Services (CMS). She also is a co-investigator of the <a href='http://www.dopps.org' target='_blank'>Dialysis Outcomes and Practice Patterns Study</a> (DOPPS). Her past accomplishments include developing, implementing, and overseeing screening and educational programs for the National Kidney Foundation (NKF) of Singapore.";

var strSR = strBioTable.replace(title, strtitleSR);
strSR = strSR.replace(img, strimgSR);
strSR = strSR.replace(blurb, strsilviar);

//robinson bio //
var strtitleBR = "Bruce Robinson, MD, MS, FACP";
var strimgBR = "<img src=images/BruceRobinson.JPG id=bobmphoto align=left />";
var strbruce = "Bruce M. Robinson, MD, MS, FACP, is Vice President of Clinical Research at Arbor Research and Adjunct Assistant Professor of Medicine at the University of Michigan (UM). He is the principal investigator of the current phase of the <a href='http://www.dopps.org' target='_blank'>Dialysis Outcomes and Practice Patterns Study</a> (DOPPS) and the Chronic Kidney Disease Outcomes and Practice Patterns Study (CKDopps). He is a co-investigator of the Centers for Medicare & Medicaid Services (CMS) End-Stage Renal Disease <a href='http://www.arborresearch.org/ESRD.aspx' >(ESRD) Measures Development and Maintenance Support project</a>. He also contributes to the National Kidney Disease Surveillance Initiative and the Chronic Renal Insufficiency Cohort Study. Dr. Robinson is the past recipient of several National Institutes of Health (NIH) career development awards.";

var strBR = strBioTable.replace(title, strtitleBR);
strBR = strBR.replace(img, strimgBR);
strBR = strBR.replace(blurb, strbruce);

//Dickinson bio//
var strtitleDD = "David Dickinson, MA";
var strimgDD = "<img src=images/DavidDickinson.JPG id=bobmphoto align=left />";
var strdavid = "David M. Dickinson, MA, is Vice President of Information and Operations at Arbor Research, where he started as director of information services and a senior research analyst in 1998. He has extensive experience in the design and use of analysis databases for economic and medical outcomes research. He coordinates the database design and electronic data collection functionality (ArborLink) for the <a href='http://www.dopps.org' target='_blank'>Dialysis Outcomes and Practice Patterns Study</a> (DOPPS) and the National Institutes of Health (NIH)-funded Adult to Adult Living Donor Liver Transplantation Study (A2ALL), in addition to managing multiple research and administrative responsibilities. He oversaw the adaptation of hundreds of gigabytes of operational transplant data into analysis files for the U.S. Department of Health and Human Services-funded Scientific Registry of Transplant Recipients (SRTR). His work in econometrics and medical research includes positions with the Urban Institute and the University of Michigan (UM).";

var strDD = strBioTable.replace(title, strtitleDD);
strDD = strDD.replace(img, strimgDD);
strDD = strDD.replace(blurb, strdavid);

//Port bio //
var strtitleFP = "Friedrich K. Port, MD, MS";
var strimgFP = "<img src=images/port_02_scaled.jpg id=bobmphoto align=left />";
var strfritz = "Friedrich K. Port, MD, MS, FACP, is a Senior Research Scientist at Arbor Research, Emeritus Professor of Medicine (Nephrology) and Epidemiology at the University of Michigan (UM) Schools of Medicine and Public Health, and former President of Arbor Research. He is co-investigator of the <a href='http://www.dopps.org' target='_blank'>Dialysis Outcomes and Practice Patterns Study</a> (DOPPS) and has served as principal investigator for the Centers for Medicare & Medicaid Services (CMS)-funded Quality Incentive Payment Demonstration project, the Scientific Registry of Transplant Recipients (SRTR), the <a href='http://www.dopps.org' target='_blank'>DOPPS</a>, and several demonstration projects for CMS. Dr. Port served as deputy director of the National Institutes of Health (NIH)-funded United States Renal Data System (USRDS) Coordinating Center from 1988 to 1999, and is the recipient of prestigious awards from the American Society of Nephrology (ASN, Scribner Award) and the National Kidney Foundation (NKF, Seldin Award). ";

var strFP = strBioTable.replace(title, strtitleFP);
strFP = strFP.replace(img, strimgFP);
strFP = strFP.replace(blurb, strfritz);

//Pisoni bio//
var strtitleRP = "Ron Pisoni, PhD, MS";
var strimgRP = "<img src=images/RonPisoni.jpg id=bobmphoto align=left />";
var strron = "Ronald L. Pisoni, PhD, MS, is a Senior Research Scientist at Arbor Research, and Deputy Principal Investigator for the <a href='http://www.dopps.org' target='_blank'>Dialysis Outcomes and Practice Patterns Study</a> (DOPPS). He has held key roles in the DOPPS since its international expansion in 1997. He earned a PhD from Wayne State University in biochemistry in 1981, completed post-doctoral studies at the VA Outpatient Clinic, Boston/Harvard Medical School and the University of Michigan (UM), and an MS in Clinical Research Design and Statistical Analysis from the UM School of Public Health in 1997. Before joining Arbor Research, he served as an assistant research scientist faculty member in the Department of Pediatrics and the Department of Internal Medicine at UM from 1987-1997. ";
var strRP = strBioTable.replace(title, strtitleRP);
strRP = strRP.replace(img, strimgRP);
strRP = strRP.replace(blurb, strron);

//Barr bio//
var strtitleMB = "Mark Barr, MD";
var strimgMB = "<img src=images/MarkBarr.jpg id=bobmphoto align=left />";
var strmark = "Mark L. Barr, M.D. is a tenured Associate Professor of Surgery in the Division of Cardiothoracic Surgery at the University of Southern California. He has served as President of the International Society for Heart and Lung Transplantation (ISHLT), as Chair of the Thoracic Committee of the American Society of Transplant Surgeons (ASTS), and on the Board of Directors of the ISHLT, the ASTS, and the American Society of Transplantation. Dr. Barr currently is the Chair of the UNOS Thoracic Transplantation Committee and is a member of the Advisory Committee on Transplantation under the auspices of the Cabinet Secretary of the Department of Health and Human Services. He has served on scientific review boards for the NIAID, NHLBI, and NCRR of the National Institutes of Health, and is a Deputy Editor of the <i>American Journal of Transplantation</i>.";
var strMB = strBioTable.replace(title, strtitleMB);
strMB = strMB.replace(img, strimgMB);
strMB = strMB.replace(blurb, strmark);

//DeOreo bio//
var strtitlePD = "Peter DeOreo, MD";
var strimgPD = "<img src=images/DeOreo.gif id=bobmphoto align=left />";
var strPeter = "Peter B. DeOreo, MD is the Chief of Medical Affairs and Quality assurance for the Centers for Dialysis Care.  The Centers are located in the greater Cleveland area.  Dr. DeOreo is a Clinical Professor of Medicine at Case Western Reserve University and is a member of the Division of Nephrology of University Hospitals Case Medical Center of Cleveland. He is the chairman of the Medical Review Board of Networks 9 and 10.   He served as chairman of the Vascular Access Advisory Panel of the MRB.  He was the vice-chairman of the DOQI Anemia work group.  He served as chairman of the Network Ad Hoc Dialysis Adequacy Task Force and MRB Patient Safety Sub-committee.  He has published in the areas of quality improvement, health related quality of life, dialysis adequacy, and financial and regulatory aspects of ESRD care.";
var strPD = strBioTable.replace(title, strtitlePD);
strPD = strPD.replace(img, strimgPD);
strPD = strPD.replace(blurb, strPeter);

//McClellan bio//
var strtitleWM = "William McClellan, MD, MPH";
var strimgWM = "<img src=images/McClellan.gif id=bobmphoto align=left />";
var strWilliam = "Dr. William M. McClellan is Professor of Medicine and Epidemiology at Emory University in Atlanta, Georgia. He completed medical school at the University of Alabama at Birmingham, his internship and residency in Internal Medicine at the Hospital of the University of Pennsylvania and his fellowship in renal medicine at the University of California in San Francisco. He received a MPH degree from Emory University.  He has published extensively on chronic kidney disease epidemiology, and health services and outcomes research. His recent work includes investigation of geographic clustering of pre-hemodialysis care, poverty and outcomes of chronic kidney disease; and studies of arteriovenous fistula use among ESRD patients. His current work focuses on studies of CKD among participants in the Renal REGARDS cohort, a population-based (n=30,000) sample of the US population. ";
var strWM = strBioTable.replace(title, strtitleWM);
strWM = strWM.replace(img, strimgWM);
strWM = strWM.replace(blurb, strWilliam);

//Michael bio//
var strtitleMM = "Maureen Michael, BSN, MBA";
var strimgMM = "<img src=images/Michael.gif id=bobmphoto align=left />";
var strMaureen = "<p>Maureen A. Michael, CEO recently retired from Central Florida Kidney Centers, Inc.   She has a Bachelor of Science Degree in Nursing and a Masters Degree in Business Administration.</p> <p> She has worked in the dialysis industry over 30 years.  During that time she has served as President of both the National Renal Administrators Association and the Florida Renal Administrators Associaton.  She continues to serve on several Boards of Directors including Arbor Research, NRAA, ESRD Network 7, University of Central Florida Nursing Advisory Board, and NRAA&#39;s Group Purchasing Organization. </p>";
var strMM = strBioTable.replace(title, strtitleMM);
strMM = strMM.replace(img, strimgMM);
strMM = strMM.replace(blurb, strMaureen);

//Pietroski bio//
var strtitleRPski = "Richard Pietroski, MS";
var strimgRPski = "<img src=images/Pietroski.gif id=bobmphoto align=left />";
var strRichard = "<p>Richard Pietroski, Gift of Life&#39;s CEO since 2008, manages every aspect of Michigan&#39;s only organ recovery organization and its 200-plus employees. Rich, who is passionate about organ and tissue donation, works with transplant centers, hospital administrators, elected officials and community leaders to inspire more organ donors and bolster the number of transplants - and lives saved - in Michigan.</p><p>Rich also talks with state legislators about the importance of organ donation and fights to pass laws that improve the process. </p><p>In 2004, Rich became a tissue recipient when doctors repaired his right shoulder with tendons from a 21-year-old police officer who died in the line of duty.</p>";
var strRPski = strBioTable.replace(title, strtitleRPski);
strRPski = strRPski.replace(img, strimgRPski);
strRPski = strRPski.replace(blurb, strRichard);

//Roos bio//
var strtitlePRoos = "Phil Roos, MBA";
var strimgPRoos = "<img src=images/Roos.gif id=bobmphoto align=left />";
var strPhil = "<p>Phil is an expert on innovation and branding, a successful entrepreneur, advisor to a number of not-for-profit as well as publicly traded organizations, and an active advocate for environmentally sustainable economic development and health and wellness. He was the Managing Director of <strong>GfK Strategic Innovation</strong>, the practice area formed by the acquisition of <strong>Arbor Strategy Group (ASG)</strong>.  Phil founded <strong>ASG</strong> in 1998, creating a consultancy with recognized expertise in strategic brand innovation, creative ideation, concept development and delivering actionable growth strategies.</p><p>Phil has extensive consulting experience across consumer products, retail/food service, finance, healthcare, and technology.  He also has significant client-side experience, holding various senior line-management positions within the consumer products industry.  Phil earned a BBA from the University of Michigan and a MBA from Harvard. He is also a Certified Public Accountant.</p>";
var strPRoos = strBioTable.replace(title, strtitlePRoos);
strPRoos = strPRoos.replace(img, strimgPRoos);
strPRoos = strPRoos.replace(blurb, strPhil);

//Straube bio//
var strtitleBStraube = "Barry M. Straube, M.D.";
var strimgBStraube = "<img src=images/Straube.gif id=bobmphoto align=left />";
var strBarry = "<p>Barry M. Straube, M.D., is the Immediate Past (Retired) Chief Medical Officer for the Centers for Medicare & Medicaid Services (CMS), as well as the Immediate Past (Retired) Director of the CMS Office of Clinical Standards & Quality (OCSQ).  For the past six years, he was the most senior clinical advisor to the CMS Administrator and CMS leadership.<br /><br />Educated at Princeton University (A.B. Degree, magna cum laude, Phi Beta Kappa) and the University of Michigan Medical School (M.D. degree), he completed an Internal Medicine Residency at California Pacific Medical Center in San Francisco, and a Renal Fellowship at Tufts University-New England Medical Center in Boston. He is Board Certified in Internal Medicine and Nephrology. From 1982-1994 he was a medical leader, including serving as Chief of the Division of Nephrology and as a member of the Departments of Internal Medicine and the Department of Transplantation, at California Pacific Medical Center in San Francisco. He was Vice President of Quality Improvement at Health Net, the fourth largest national HMO at the time, from 1994 to 1999. Subsequently, he served as the CMS Chief Medical Officer at CMS for Region IX (CA, AZ, NV, HI, and the far Pacific Territories). He has had leadership roles in hospitals, physician organizations, HMOs, and many national quality initiatives. He retired from CMS February 1, 2011, and is considering new career opportunities while spending time with family, consulting, speaking and writing.</p>";
var strBStraube = strBioTable.replace(title, strtitleBStraube);
strBStraube = strBStraube.replace(img, strimgBStraube);
strBStraube = strBStraube.replace(blurb, strBarry);


//Turenne bio//
var strtitleMTurenne = "Marc N. Turenne, PhD";
var strimgMTurenne = "<img src=images/Turenne07.gif id=bobmphoto align=left />";
var strMarc = "<p>Marc N. Turenne, PhD, senior research scientist, is the project director for three initiatives sponsored by the Centers for Medicare & Medicaid Services: End-Stage Renal Disease <a href='http://www.arborresearch.org/ESRD.aspx'>(ESRD) Quality Measures Development and Maintenance Support</a>, Analytic and Operations Support for the Implementation of the ESRD Quality Incentive Program, and Technical Support for the Development of a Prospective Payment System for Federally Qualified Health Centers. Dr. Turenne is also the principal investigator on an R01 grant from the National Institute on Minority Health and Health Disparities. Before joining Arbor Research in 2010, he was an assistant research scientist in the Department of Health Management and Policy at the University of Michigan (UM) School of Public Health and a member of the UM Kidney Epidemiology and Cost Center. He received his doctorate in health services organization and policy, with a concentration in economics, from UM in 2003.</p>";
var strMTurenne = strBioTable.replace(title, strtitleMTurenne);
strMTurenne = strMTurenne.replace(img, strimgMTurenne);
strMTurenne = strMTurenne.replace(blurb, strMarc);


//Declare bios here//
var TeamTitle = "TeamTitle";
var TeamDescription = "TeamDescription";
var strTeamTable = "<table width='450px'><tr><td style=background-color:#003366;><p style=color:White; font-size:14px; padding:10px;>&nbsp;&nbsp;&nbsp;" + TeamTitle + "</p></td></tr><tr><td valign=top style=border: solid 1px lightgray;>";
strTeamTable = strTeamTable + "<span style=font-weight: normal;>" + TeamDescription + "</span></td></tr></table>";


//Team Description -- Research Analysts//
var strTeamTitle_ResearchAnalysts = "Research Analysts";
var strTeamDescription_ResearchAnalysts = "<p>The analytic team is responsible for all data analyses, and its members are proficient in a variety of statistical techniques, including regression, survival analysis, longitudinal methods, hierarchical methods, and power analysis. Analysts provide expertise in biostatistics, epidemiology, economics, and other relevant disciplines and contribute to the development of peer-reviewed manuscripts, abstracts, and reports.</p>";
var strMessage_ResearchAnalysts = strTeamTable.replace(TeamTitle, strTeamTitle_ResearchAnalysts);
strMessage_ResearchAnalysts = strMessage_ResearchAnalysts.replace(TeamDescription, strTeamDescription_ResearchAnalysts);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);

//Team Description -- Applications Development//
var strTeamTitle_ApplicationsDevelopment = "Applications Development";
var strTeamDescription_ApplicationsDevelopment = "<p>The applications development team designs the customized software used to communicate research findings and coordinate study protocols. Team members are responsible for engineering, developing, and maintaining Windows and web-based customized applications.</p>";
var strMessage_ApplicationsDevelopment = strTeamTable.replace(TeamTitle, strTeamTitle_ApplicationsDevelopment);
strMessage_ApplicationsDevelopment = strMessage_ApplicationsDevelopment.replace(TeamDescription, strTeamDescription_ApplicationsDevelopment);
