var acceptPat= "Indicates that a practice is open to new patients and what, if any, restrictions apply."+
" This is self-reported by the practitioner and is updated when the practitioner notifies BCN.";

var accreditation = "BCN requires participating hospitals maintain accreditation by an approved accrediting agency."+
" Verification is done when the provider joins BCN and every three years thereafter. "+
"Approved accrediting agencies are:"+
"<ul class='bullet_square'><li>"+"The Joint Commission (JCAHO) The Joint Commission has been accrediting hospitals for more than 50 years."+
" Its accreditation is a nationwide seal of approval that indicates a hospital meets high performance standards. "+
"For a list of JCAHO accredited hospitals visit: <a target='blank' href='http://www.qualitycheck.org/consumer/searchQCR.aspx'>http://www.qualitycheck.org/consumer/searchQCR.aspx</a>"+
"</li><li>Healthcare Facilities Accreditation Program (HFAP) HFAP has been accrediting healthcare facilities for over"+
" 40 years under Medicare. It is one of only two voluntary accreditation programs in the United States authorized"+
" by the Centers for Medicare & Medicaid Services (CMS), formerly HCFA, to survey hospitals under Medicare. "+
"For a list of HFAP accredited hospitals visit: <a target='blank' href='https://www.do-online.org/index.cfm?PageID=acc_hfhosp#mi'>https://www.do-online.org/index.cfm?PageID=acc_hfhosp#mi</a>"+
"</li><li>CARF (Commission on Accreditation of Rehabilitation Facilities) is a private, not-for-profit organization that "+
"promotes quality rehabilitation services. It does this by establishing standards of quality for organizations to "+
"use as guidelines in developing and offering their programs or services to consumers"+
"<br/>CARF-accredited programs and services have demonstrated that they substantially meet internationally "+
"recognized standards. CARF accreditation means that you can be confident that an organization has made a "+
"commitment to continually enhance the quality of its services and programs, and its focus is on consumer "+
"satisfaction.(<a target='blank' href='http://www.carf.org/Consumer.aspx?Content=ConsumerSearch&ID=7'>http://www.carf.org/Consumer.aspx?Content=ConsumerSearch&ID=7</a>)</li></ul>"


var boardCert= 'Describes a physician who has passed a written and oral examination given by a medical specialty board and who has been certified as a specialist in that area. <br />'+
'Verification is done when the practitioner joins BCN, every three years, or when the certification expires. <br />'+
'For details, go to the links below:'+
'<ul class="bullet_square">'+
'<li>American Board of Medical Specialties (ABMS) - <a target="blank" href="http://www.abms.org/">http://www.abms.org/</a></li>'+
'<li>American Medical Association (AMA) - <a target="blank" href="http://www.ama-assn.org/">http://www.ama-assn.org/</a></li>'+
'<li>American Board of Podiatric Surgery (ABPS) - <a target="blank" href="http://www.abps.org/index.aspx">http://www.abps.org/index.aspx</a></li>'+
'<li>American Board of Podiatric Orthopedics and Primary Podiatric Medicine (ABPOPPM) - <a target="blank" href="http://www.abpoppm.org/">http://www.abpoppm.org/</a></li>'+
'<li>American Board of Oral and Maxillofacial Surgery (ABOMS) - <a target="blank" href="http://www.aboms.org/">http://www.aboms.org/</a></li>'+
'<li>American Board of Sleep Medicine (ABSM) - <a target="blank" href="http://www.absm.org/Diplomates/listing.htm">http://www.absm.org/Diplomates/listing.htm</a></li>'+
'<li>Royal College of Physicians - <a target="blank" href="http://www.rcplondon.ac.uk/Pages/index.aspx">http://www.rcplondon.ac.uk/Pages/index.aspx</a></li>'+
'<li>Royal College of Surgeons of England - <a target="blank" href="http://www.rcseng.ac.uk/">http://www.rcseng.ac.uk/</a></li>'+
'<li>Royal College of Physicians and Surgeons of Canada (RCPSC) - <a target="blank" href="http://www.royalcollege.ca/index_e.php">http://www.royalcollege.ca/index_e.php</a></li></ul>';

var hospAffil= "Identifies where the practitioner provides inpatient care.<br />"+
"  Verification is obtained from the BCN contracted hospital when the practitioner joins BCN and every three years thereafter.";

var langSpoken = "Indication that the practice can communicate with patients whose native language is not English.<br />"+
" Languages are collected when the practitioner joins BCN and every three years thereafter.";

var Specialty = "The field of medicine or surgery in which a practitioner specializes."+
"  Verification is done when the practitioner joins BCN and every three years thereafter."+
"  Verification is also done if the practitioner changes his specialty."+
"  Verification sources include the practitioners training facility, American Board of Medical Specialties (ABMS),"+
" and American Osteopathic Association (AOA). ";


var provType = "A facility engaged in the delivery of health services. "+
"Provider types are non-practitioner providers including but not necessarily limited to hospitals,"+
" urgent-care centers, skilled nursing facilities, home health agencies or outpatient clinics.";

var pcg = "Primary Care Group is an organization of primary care physicians who come together for purposes of "+
"doing business with BCN. Physicians are not necessarily employed by the PCG nor in practice together "+
"but work together to provide health care and support services to BCN members.";

var specCat = "Specialty categories are groupings of related provider specialties combined together to"+
" facilitate physician searches.  Individual specialties are listed within each grouping";

var phyAccep = "Physician Accepts are grouping of people by gender and sex whom the physician accepts for service";

var pcgAffil= "Identifies where the practitioner provides inpatient care.<br />"+
"  Verification is obtained from the BCN contracted hospital when the practitioner joins BCN and every three years thereafter.";


var popupContent = "";
var popWin = null;
function setPopupContent(name){
	if(name == 'SPECIALTY'){
		popupContent = specCat;
	}else if(name == 'BOARDS'){
		popupContent = boardCert;
	}else if(name == 'ACCREDITATION'){
		popupContent = accreditation;
	}else if(name == 'REASON_CODE'){
		popupContent = acceptPat;
	}else if(name == 'HOSPITAL_ID_1'){
		popupContent = hospAffil;
	}else if(name == 'LANGUAGES'){
		popupContent = langSpoken;
	}else if(name == 'FACILITY_TYPE'){
		popupContent = provType;
	}else if(name == 'SUB_PROGRAM'){
		popupContent = pcg;
	}else if(name == 'PHY_ACCEPTS'){
		popupContent = phyAccep;
	}else if(name == 'PCG_ID_1'){
		popupContent = pcgAffil;
	}
	else{
		popupContent = 'Description not available';
	}
}

function popup(title,name){
	if(name == 'SPECIALTY1'){
		if(popWin != null && !popWin.closed ){
			popWin.close();
		}
	}
	if(popWin == null || popWin.closed){
		if(name == 'SPECIALTY1'){
			popWin = window.open('popup_specialty.jsp','hmo','toolbar=no,scrollbars=yes,height=630,width=400,screenx=20,left=20,screeny=20,top=20');
		}else{
			popWin = window.open('popup.jsp','hmo','toolbar=no,scrollbars=yes,height=1,width=400,screenx=20,left=20,screeny=20,top=20');
		}
		
		var theDate = new Date();
		setTimeout("changeTitle('" + title + "','"+name+"')",300);

	}else{
		changeTitle(title,name);
	}
	popWin.focus();
}

function changeTitle(title, name) {
	if(name != 'SPECIALTY1'){
	setPopupContent(name);


	    popWin.document.title = title;
	    popWin.document.getElementById("help-content").innerHTML = popupContent;
	    popWin.document.getElementById("help-page-title").innerHTML = title;
	    //set the heading
	    
	    ////clearContent(popWin.document.getElementById("help-page-title"));
	    ////addText('help-page-title',title,'help-page-title1',popWin);
	    //set the actual contents
	    ////clearContent(popWin.document.getElementById("help-content"));
	    ////addText('help-content',popupContent,'help-content1',popWin);
	    //popWin.moveTo(0,0);
	    var ht = popWin.document.body.scrollHeight+120;
	    var actht = popWin.screen.availHeight - 10;
	
		if(ht > actht ){
			ht = actht;
		}
		popWin.resizeTo(400,ht);
	}
	popWin.focus();
}

//Method used instead of innerHTML
function addText(el,strText, newID,popWin) {
  // create a DIV, called eDiv as Element Div
  eDIV = popWin.document.createElement("div");
  //assign an ID to the element because you may need to access it again
  eDIV.setAttribute("id", newID);
  // add a text node to the element.
  eDIV.appendChild(popWin.document.createTextNode(strText));
  // Now that we have created everything let’s add it to our DOM
  popWin.document.getElementById(el).appendChild(eDIV);
}
function DOMgetHTML(el) {
// No problem if it’s a text node
    if (el.nodeType == 3) return el.nodeValue;
    var txt = new Array(),i=0;
// If there is more to it, then let’s gather it all.
   while(el.childNodes[i]) {
     txt[txt.length] = DOMgetHTML(el.childNodes[i]);
     i++;
   }
   // return the array as a string
   return txt.join("");
}
// gather all the content of an Element as a string.
//mText = DOMgetHTML(document.getElementById("myDIV"));

function clearContent(el) {
  // first clone the object, without it’s child elements.
  nEl = el.cloneNode(false);
  // Pop the new element in before the old one.
  el.parentNode.insertBefore(nEl,el);
  // Now get rid of the one that has all that icky content
  el.parentNode.removeChild(el);
}
//clearContent(document.getElementById("myDiv"));
function copyNode(source, dest) {
  // Get source content
  sEl = document.getElementById(source).cloneNode(true);
  // remove your destination existing content
  clearContent(document.getElementById(dest));
  // add source content onto dest content
  document.getElementById(dest).appendChild(sEl);
}
function addCert(popWin){
	data = new Array("American Board of Medical Specialties (AMBS) - ",
"American Medical Association (AMA) - ",
"American Board of Podiatric Surgery (ABPS) - ",
"American Board of Podiatric Orthopedics and Primary Podiatric Medicine (ABPOPPM) - ",
"American Board of Oral and Maxillofacial Surgery (ABOMS) - ");

data_links = new Array("http://www.abms.org/",
"http://www.ama-assn.org/",
"http://www.abps.org/index.aspx",
"http://www.abpoppm.org/",
"http://www.aboms.org/");

 // create the UL element that our LI elements will descend from
eUL = popWin.document.createElement("ul");
eUL.setAttribute("class","bullet_square");
// initialize the eLI variable as an array
eLI = new Array();
// loop over the length of the "data" array
for(i=0;i<data.length;i++) {
	// create an LI, this time as a member of your array
	eLI[i] = popWin.document.createElement("li");
	// append the value of data[i] to the LI as a text node
	eLI[i].appendChild(popWin.document.createTextNode(data[i]));
	// append the LI to the UL
	eUL.appendChild(eLI[i]);
}
eUL.setAttribute("class","bullet");
// append the UL to the "mContainer" element.
popWin.document.getElementById("help-content").appendChild(eUL);

}
function showHideSpan(itemID,isShow)
{
    if(isShow){
    	document.getElementById(itemID).style.display = 'block';
    }else{
    	document.getElementById(itemID).style.display = 'none';
    }
}

function switchShowHideSpan(itemID)
{
    if(document.getElementById(itemID).style.display == 'none'){
    	document.getElementById(itemID).style.display = 'block';
    }else{
    	document.getElementById(itemID).style.display = 'none';
    }
}

function showHideHrs(itemID,isShow)
{

    if(isShow){
    	document.getElementById(itemID).style.visibility = 'visible';
    }else{
    	document.getElementById(itemID).style.visibility = 'hidden';
    }
}