
function Clinic() {
	//retain scope
	var oThis = this;
	 // Return Vars
    this.totalResults;

	// Office Info
	var officeId;
	this.officeMarker;
	this.officePhoto;
	//this.officeDescription;
	this.officeInstitutionId;
	this.officeInstitutionName;
	this.officeDeptId;
	this.officeDeptName;
	this.officeAddress;
	this.officeCity;
	this.officeCounty;
	this.officePostal;
	this.officeDistance;
	this.officeLat;
	this.officeLong;
	this.officeContact;
	this.officePhone;
	this.officeFax;
	this.officeEmail;
	this.officeWeb;
	this.officeStartYear;
	this.officeCTBC;
	this.officeCTBCemail;
	this.offerAvailable;
	this.volumaAvailable;
	this.officeBio;
	//mike
	//this.officeSmile;
	this.officeRecordId;
	this.officeTier;
	this.officeTierType;
	this.officeHasPhoto;
	
	// Physician Info
	this.physicianId;
	this.physicianName;
	this.physicianUniversity;
	this.physicianDegree;
	
	//Services and Features
	this.services = [];
	this.specialties = [];
	this.languages = [];
	this.treatments = [];
	this.products = [];
	this.locations = [];
	this.hours = [];
	
	// Methods
	this.showAddressPanel = buildAddressPanel;
	this.showServicesPanel = buildServicesPanel;
	this.showOfferPanel = buildOfferPanel;
	this.showFormatedAddess = showProperAddress;
	this.showDisplayName = getDisplayName;
	this.showOfferVoucher = buildOffer;
	this.showBioOverlay = buildBio;
	this.showCallOverlay = buildRequestCall;
	this.setId = setId;
	this.returnId = returnId;
	this.returnRow = returnResultLI;
	this.trimStringRight = trimRight;
	
	/* Get | Set ID */
	
	function setId(tmpId) {
		officeId = tmpId;
	}
	
	function returnId() {
		return officeId;
	}
	
	/* Tab Overlay Footer 
	    Display as Footer on every tab */
	//mike
	function buildTabFooter(tmpToAddress, showCallback, showBio, hasOffer, hasSmile, tmpid) { 
	    var tmpFooterDiv = document.createElement("div");
	    tmpFooterDiv.id = "tabFooter";
	    tmpFooterDiv.className = "clearfix";
	    
	    /* Contact info */		
		var contactTools = document.createElement("ul");
		
		/* View Biography Link */
		if (showBio == "True") {
		    var tmpBio = document.createElement("li");
		    tmpBio.className = "panelBio";
		    var tmpBioLink = document.createElement("a");
		    tmpBioLink.setAttribute('rel',officeId);
		    tmpBioLink.onclick = function(){
		    	if(Locator.Config.enableTracking){
		    		s.products =  ';' + oThis.officeDeptId;
		    		//scAjaxEvent(Locator.Config.scBioDetailClick + ",prodView", Locator.Config.scEvarDisplayName, oThis.showDisplayName(), Locator.Config.scEvarPractitionerName, oThis.physicianName, Locator.Config.scEvarAccountNumber, oThis.officeDeptId);
		    		s.products = '';
		    	}
		    	Locator.showBioForm(this.getAttribute('rel'));
		    };
		    tmpBioLink.href = "javascript: void(0);";
		    tmpBioLinkTxt = document.createTextNode(Locator.Config.viewBioLinkLabel);
		    tmpBioLink.appendChild(tmpBioLinkTxt);
		    tmpBio.appendChild(tmpBioLink);
		    contactTools.appendChild(tmpBio);
		}
		
		/* Request a Call Link LEGACY
		if (showCallback == "True") {
		    var tmpReqCall = document.createElement("li");
		    if (  	 == "False") {
		        tmpReqCall.className = "panelCTBC last";
		    } else {
		        tmpReqCall.className = "panelCTBC";
		    }
		    
		    var tmpReqCallLink = document.createElement("a");
		    tmpReqCallLink.href = "javascript: Locator.showCallForm(" + officeId + ");";
		    tmpReqCallLinkTxt = document.createTextNode(Locator.Config.viewCTBCLabel);
		    tmpReqCallLink.appendChild(tmpReqCallLinkTxt);
		    tmpReqCall.appendChild(tmpReqCallLink);
		    contactTools.appendChild(tmpReqCall);
		} else {
		    if (tmpBio && hasOffer == "False") {
		        tmpBio.className = "panelBio last";
		    } 
		}*/
		
		if (tmpBio && hasOffer == "False") {
		    tmpBio.className = "panelBio last";
		} 

		
		/* View Offer Link */
		if (hasOffer == "True") {
		    var tmpViewOffer = document.createElement("li");
		    tmpViewOffer.className = "panelOffer last";
		    var tmpViewOfferLink = document.createElement("a");
		    tmpViewOfferLink.href = "javascript: Locator.selTab(2," + tmpid + ");";
		    tmpViewOfferLinkTxt = document.createTextNode(Locator.Config.viewOfferLabel);
		    tmpViewOfferLink.appendChild(tmpViewOfferLinkTxt);
		    tmpViewOffer.appendChild(tmpViewOfferLink);
		    contactTools.appendChild(tmpViewOffer);
		}
		
		/* Horizontal Rule */
		var tmpGrayLine = document.createElement("div");
		tmpGrayLine.className = "tabline";
		tmpGrayLine.innerHTML = "<!-- -->";
		
		tmpFooterDiv.appendChild(contactTools);
		tmpFooterDiv.appendChild(tmpGrayLine);
		
		/* Request a Call Link */
		if (showCallback == "True") {
			var tmpCallback = document.createElement("div");
			tmpCallback.id = "panel_callback";
			
			var tmpCallbackCopy = document.createElement("div");
			tmpCallbackCopy.className = "f_copy";
			tmpCallbackCopy.innerHTML = Locator.Config.viewCTBCLabel;
			
			var tmpCallbackCta = document.createElement("a");
			tmpCallbackCta.className = "f_cta";
			tmpCallbackCta.setAttribute('rel',officeId);
			tmpCallbackCta.onclick = function(){ //Track Request Consultation click
				if(Locator.Config.enableTracking){
					scAjaxEvent(Locator.Config.scConsultationClick, Locator.Config.scEvarAccountNumber, oThis.officeDeptId);
				}
				Locator.showCallForm(this.getAttribute('rel'));
			};
			tmpCallbackCta.href = "javascript:void(0);"; //Locator.showCallForm(" + tmpOfficeId + ");";
			tmpCallbackCta.innerHTML = Locator.Config.viewCTBCLinkText;
			
			tmpCallback.appendChild(tmpCallbackCopy);
			tmpCallback.appendChild(tmpCallbackCta);
			
			tmpFooterDiv.appendChild(tmpCallback);
		}
		
		/* Directions Input Form */
		var tmpDirectionsForm = document.createElement("form");
		tmpDirectionsForm.id = "getDirections";
		tmpDirectionsForm.action = Locator.Config.pathToGoogleMaps[Locator.Config.activeIndex];
		tmpDirectionsForm.target = "_blank";
		var tmpDirectionsLabel = document.createElement("label");
		tmpDirectionsLabel.id = "startAddressLabel";
		var tmpDirectionsLabelTxt = document.createTextNode(Locator.Config.startDirectionsLabel);
		tmpDirectionsLabel.appendChild(tmpDirectionsLabelTxt);
		
		var tmpDirectionsInput = document.createElement("input");
		tmpDirectionsInput.id = "gmaps_form_query";
		tmpDirectionsInput.type = "text";
		tmpDirectionsInput.name = "q";
		
		var tmpDirectionsDest = document.createElement("input");
		tmpDirectionsDest.type = "hidden";
		tmpDirectionsDest.id = "d_daddr";
		tmpDirectionsDest.value = tmpToAddress;
		
		var tmpDirectionsSubmit = document.createElement("input");
		tmpDirectionsSubmit.id = "addressSubmit";
		tmpDirectionsSubmit.name="button";
		tmpDirectionsSubmit.type="button";
		tmpDirectionsSubmit.onclick = function() {
			if(Locator.Config.enableTracking){ scAjaxEvent(Locator.Config.scDirectionsClick, Locator.Config.scEvarAccountNumber, oThis.officeDeptId);}
			Locator.submitDirections(officeId); 
		};

		// Put together form
		tmpDirectionsForm.appendChild(tmpDirectionsLabel);
		tmpDirectionsForm.appendChild(tmpDirectionsInput);
		tmpDirectionsForm.appendChild(tmpDirectionsDest);
		tmpDirectionsForm.appendChild(tmpDirectionsSubmit);
		
		
		tmpFooterDiv.appendChild(tmpDirectionsForm);
		
		return tmpFooterDiv;
	}
	
	
	/* Panels */
	
	function buildAddressPanel() {
		var tmpAddressPanel = document.createElement("div");
		tmpAddressPanel.id = "addressPanel";
		tmpAddressPanel.className = "clearfix panel";
		
		/* Doctor Info */
		var tmpInfoDiv = document.createElement('div');
		tmpInfoDiv.id = "addressInfo";
		tmpInfoDiv.className = "clearfix";
		var tmpDL = document.createElement("dl");
		var tmpDT = document.createElement("dt");
		var tmpDoctorNameText = document.createTextNode(this.showDisplayName());
		tmpDT.appendChild(tmpDoctorNameText);
		tmpDL.appendChild(tmpDT);
		
		/* Institution Name */
		var tmpInstName = document.createElement("dd");
		var tmpInstNameTxt = document.createTextNode(this.officeInstitutionName);
		tmpInstName.appendChild(tmpInstNameTxt);
		if (this.officeInstitutionName != "") {
		    tmpDL.appendChild(tmpInstName);
		}
		
		/* Address */
		var tmpAddress = document.createElement("dd");
		var tmpAddressText = document.createTextNode(this.showFormatedAddess());
		tmpAddress.style.paddingBottom = "10px";
		tmpAddress.appendChild(tmpAddressText);
		tmpDL.appendChild(tmpAddress);
		
		/* Phone */
		var tmpPhone = document.createElement("dd");
		var tmpPhoneTxt = document.createTextNode(Locator.Config.telephonePrefixLabel + this.officePhone);
		tmpPhone.appendChild(tmpPhoneTxt);
		if (this.officePhone != "") {
		    tmpDL.appendChild(tmpPhone);
		}
		/* Email */
		var tmpEmail = document.createElement("dd");
		var tmpEmailTxt = document.createTextNode(this.officeEmail);
		tmpEmail.appendChild(tmpEmailTxt);
		tmpDL.appendChild(tmpEmail);
		
		/* Primary Contact */
		var tmpContact = document.createElement("dd");
		var tmpContactTxt = document.createTextNode(Locator.Config.primarayContactLabel + this.officeContact);
		tmpContact.appendChild(tmpContactTxt);
		if (this.officeContact != "") {
		    tmpDL.appendChild(tmpContact);
		}
		
		/* Website */
		var tmpWeb = document.createElement("dd");
		var tmpWebTxt = document.createTextNode(this.officeWeb);
		var tmpWebLink = document.createElement("a");
		tmpWebLink.appendChild(tmpWebTxt);
		tmpWebLink.onclick = function(){
			//Track website click
			if(Locator.Config.enableTracking){ 
				scAjaxEvent(Locator.Config.scWebsiteClick, Locator.Config.scEvarAccountWebsite, oThis.officeWeb, Locator.Config.scEvarAccountNumber, oThis.officeDeptId);
			}
	   	};
		tmpWebLink.href = this.officeWeb;
		tmpWebLink.target = "_blank";
		tmpWeb.appendChild(tmpWebLink);
		if (this.officeWeb != "") {
		    tmpDL.appendChild(tmpWeb);
		}
		
		/* Distance 
		var tmpDistance = document.createElement("dd");
		var tmpDistanceTxt = document.createTextNode(Locator.Config.labelDistance + this.officeDistance + Locator.Config.distanceUnitOfMeasure);
		tmpDistance.appendChild(tmpDistanceTxt);
		tmpDL.appendChild(tmpDistance);
		*/
		
		//Photo
		//Create empty photo container and put photo in photodrop for analysis.
		var tmpPhotoDropDiv = document.getElementById("photoDrop");
		Locator.clearContainer(tmpPhotoDropDiv);
	    var tmpAddressPhotoDiv = document.createElement("div");
	    tmpAddressPhotoDiv.id = "addressPhoto";
	    
	    if (this.officeHasPhoto == "True") {
	        var tmpAddressPhoto = document.createElement("img");
	        tmpAddressPhoto.src = Locator.Config.photoDataPath + "?id=" + this.officeRecordId;
	        tmpPhotoDropDiv.appendChild(tmpAddressPhoto);
	    } else {
	        var tmpDefaultImage = document.createElement("img");
	        tmpDefaultImage.src = Locator.Config.defaultClinicPhoto;
	        tmpAddressPhotoDiv.appendChild(tmpDefaultImage);
	    }
	        
		tmpInfoDiv.appendChild(tmpDL);
		tmpInfoDiv.appendChild(tmpAddressPhotoDiv);
		
		if (this.officeTierType != "a" && this.officeTierType != "b"){
		    this.officeBio = "false";
		    this.officeCTBC = "false";
		    //mike
		    //this.officeSmile = "false";
		    this.offerAvailable = "false";
		}
		
		tmpAddressPanel.appendChild(tmpInfoDiv);
		tmpAddressPanel.appendChild(buildTabFooter(this.showFormatedAddess(),this.officeCTBC, this.officeBio, this.offerAvailable, /*mikethis.officeSmile,*/ this.returnId()));	
		return tmpAddressPanel; 	
	}
	
	function buildServicesPanel () {
	
		var servicesDiv = document.createElement("div");
		servicesDiv.id = "servicesPanel";
		servicesDiv.className = "clearfix panel";
		
		var servicesList = document.createElement("dl");
		servicesList.id = "servicesListing";
		
		var servicesDoctorName = document.createElement("dt");
		var servicesDoctorNameText = document.createTextNode(this.showDisplayName());
		servicesDoctorName.appendChild(servicesDoctorNameText);
		servicesList.appendChild(servicesDoctorName);
		
		var numTreatments = this.treatments.length;
		var actualTreatments = 0;
		
		/* Treatments List */
		var treatmentsOffered = document.createElement("dd");
		treatmentsOfferedTextStrong = document.createElement("strong");
		treatmentsOfferedText = document.createTextNode(Locator.Config.treatmentsOfferedLabel);
		treatmentsOfferedTextStrong.appendChild(treatmentsOfferedText);
		treatmentsOffered.appendChild(treatmentsOfferedTextStrong);
		    // Cycle through treatments and output list to services offered
			for (b=0; b < numTreatments; b++) {
				if ((b + 1) == numTreatments) {
				    var tmpTreatment = document.createTextNode(this.treatments[b].name);
				} else {
				    var tmpTreatment = document.createTextNode(this.treatments[b].name + ", ");
				}
				if (this.treatments[b].name.length > 0){
				    actualTreatments ++
				    treatmentsOffered.appendChild(tmpTreatment);
				}
			}
	    if (actualTreatments > 0) {
		    servicesList.appendChild(treatmentsOffered);
		} else { // no data to display so show default message instead
		    var tmpDefaultMessage = document.createElement("dd");
		    tmpDefaultMessageText = document.createTextNode(Locator.Config.noServicesDataText.replace(/DISPLAYNAME/, this.showDisplayName()));
		    tmpDefaultMessage.appendChild(tmpDefaultMessageText);
		    servicesList.appendChild(tmpDefaultMessage);
		}
		
		/* Build Tab */
		var tmpServicesInfoDiv = document.createElement('div');
		tmpServicesInfoDiv.id = "servicesInfo";
		tmpServicesInfoDiv.appendChild(servicesList);
		servicesDiv.appendChild(tmpServicesInfoDiv);
		servicesDiv.appendChild(buildTabFooter(this.showFormatedAddess(),this.officeCTBC,this.officeBio,this.offerAvailable,/*mikethis.officeSmile,*/this.returnId()));
		
		return servicesDiv;
	}
	/* Offer Panel */
	function buildOfferPanel () {
		var offerDiv = document.createElement("div");
		offerDiv.id = "offerPanel";
		offerDiv.className = "clearfix panel";
		
		var panelDoctorName = document.createElement("div");
		var panelDoctorNameText = document.createTextNode(this.showDisplayName());
		panelDoctorName.className = "doc_name clearfix";
		panelDoctorName.appendChild(panelDoctorNameText);
		
		var offerTab = document.createElement("dl");
		offerTab.id = "offerTab";
		offerTab.className = "clearfix";
		
		var tmpOfficeId = this.returnId();
		
		// free certificate panel area
		var offerArea = document.createElement("dt");
		if (this.offerAvailable == "True") {
			offerArea.className = "available";
			
			var tmpOfferHead = document.createElement("div");
			tmpOfferHead.className = "p_head";
			
			var tmpOfferCopy = document.createElement("div");
			tmpOfferCopy.className = "p_copy";
			var tmpOfferCopyText = document.createTextNode(Locator.Config.offerAvailableText);
			tmpOfferCopy.appendChild(tmpOfferCopyText);
			
			var tmpOfferCta = document.createElement("div");
			tmpOfferCta.className = "p_cta";
			var tmpOfferCtaLink = document.createElement("a");
			tmpOfferCtaLink.href = "javascript:Locator.showOfferForm(" + tmpOfficeId+ ")";
			tmpOfferCta.appendChild(tmpOfferCtaLink);
			
			offerArea.appendChild(tmpOfferHead);
			offerArea.appendChild(tmpOfferCopy);
			offerArea.appendChild(tmpOfferCta);
		} else {
			offerArea.className = "unavailable";
		}
		
		// request a call panel area
		var callArea = document.createElement("dd");
		if (this.officeCTBC == "True") {
			callArea.className = "available";
			
			var tmpCallHead = document.createElement("div");
			tmpCallHead.className = "p_head";
			
			var tmpCallCopy = document.createElement("div");
			tmpCallCopy.className = "p_copy";
			var tmpCallCopyText = document.createTextNode(Locator.Config.offerCallPanelText);
			tmpCallCopy.appendChild(tmpCallCopyText);
			
			var tmpCallCta = document.createElement("div");
			tmpCallCta.className = "p_cta";
			var tmpCallCtaLink = document.createElement("a");
			tmpCallCtaLink.setAttribute('rel',tmpOfficeId);
			tmpCallCtaLink.onclick = function(){ //Track Request Consultation click " +
				if(Locator.Config.enableTracking){ scAjaxEvent(Locator.Config.scConsultationClick, Locator.Config.scEvarAccountNumber, oThis.officeDeptId);}
				Locator.showCallForm(this.getAttribute('rel'));
			};
			
			tmpCallCtaLink.href = "javascript:void(0);"; //Locator.showCallForm(" + tmpOfficeId + ");";
			tmpCallCta.appendChild(tmpCallCtaLink);

			
			callArea.appendChild(tmpCallHead);
			callArea.appendChild(tmpCallCopy);
			callArea.appendChild(tmpCallCta);
		} else {
			callArea.className = "unavailable";
		}
		
		var offerInfoDiv = document.createElement("div");
		offerInfoDiv.id = "offerInfo";
		offerInfoDiv.className = "clearfix";
		offerInfoDiv.appendChild(panelDoctorName);
		
		// if no offer or callback form available:
		if (this.officeCTBC == "True" || this.offerAvailable == "True") {
			offerTab.appendChild(offerArea);
			offerTab.appendChild(callArea);
			offerInfoDiv.appendChild(offerTab);
		} else {
			var tmpNoOfferText = document.createElement("p");
			tmpNoOfferText.appendChild(document.createTextNode(Locator.Config.offerUnavailableText + this.showDisplayName()));
			offerInfoDiv.appendChild(tmpNoOfferText);
			offerInfoDiv.className = "clearfix nonada";
		}
		
		offerDiv.appendChild(offerInfoDiv);
		offerDiv.appendChild(buildTabFooter(this.showFormatedAddess(),"False","False","False", "False", this.returnId()));
		
		return offerDiv;
	}
	
	/* General Methods */
	
	function showProperAddress () {
		var newAddy = "";
	    var addyElements = [];
	    addyElements.length = 0;
	    if (this.officeAddress.length > 0) {
	        addyElements.push(this.officeAddress);
	    }
	    if (this.officeCity.length > 0) {
	        addyElements.push(this.officeCity);
	    }
	    if (this.officeCounty.length > 0) {
	        addyElements.push(this.officeCounty);
	    }
	    if (this.officePostal.length > 0) {
	        addyElements.push(this.officePostal);
	    }
	    newAddy = addyElements.join(", ");	
		return newAddy;	
	}
	// Removes [numChar] from right of tmpString and returns trimmed string
	function trimRight(tmpString, numChar) {
	    var tmpReturnString;
	    var tmpStringTrimTo = tmpString.length - (numChar +1);
	    tmpReturnString = tmpString.slice(0, tmpStringTrimTo);
	    return tmpReturnString;
	}
	function getDisplayName() {
	    var tmpDisplayName = "";
	    if (this.physicianName.length > 0) {
		    tmpDisplayName = this.physicianName;
		} else if (this.officeInstitutionName.length > 0) {
		    tmpDisplayName = this.officeInstitutionName;
		} else {
		    tmpDisplayName = Locator.Config.noDisplayNameText;
		}
		return tmpDisplayName;
	}
	
	
	/* Results List */
	
	function returnResultLI (isLast) {
		var tmpLI = document.createElement("li");
		tmpLI.id = "listresult" + officeId;
		
		var tmpAnchor = document.createElement("a");
		tmpAnchor.href = "javascript:Locator.viewOverlay(" + officeId + ")";
		
		var tmpImage = document.createElement("img");
		var letter = String.fromCharCode("a".charCodeAt(0) + this.returnId());
		if (this.officeTier == "true") {
		    tmpImage.src = Locator.Config.pathToResultTierMarkers + letter + Locator.Config.resultmarkerExtension;
		} else {
		    tmpImage.src = Locator.Config.pathToResultMarkers + letter + Locator.Config.resultmarkerExtension;
		}
		tmpImage.width = Locator.Config.resultMarkerWidth;
		tmpImage.height = Locator.Config.resultMarkerHeight;
		
		tmpAnchor.appendChild(tmpImage);
		
		/* Doctor Info */
		var tmpDoctorName = document.createElement("b");
		var tmpDoctorNameText = document.createTextNode(this.showDisplayName());
		var tmpDoctorDetails = document.createTextNode(" - " + this.showFormatedAddess());
		tmpDoctorName.appendChild(tmpDoctorNameText);
		var tmpDL = document.createElement("dl");
		var tmpDT = document.createElement("dt");
		tmpDT.appendChild(tmpDoctorName);
		tmpDT.appendChild(tmpDoctorDetails);
		
		tmpDL.appendChild(tmpDT);
		
		// Put the icons in the DD and float
		var tmpBioIcon = document.createElement("dd");
		var tmpCallIcon = document.createElement("dd");
		//mike
		var tmpSmileIcon = document.createElement("dd");
		var tmpOfferIcon = document.createElement("dd");
		var tmpVolumaIcon = document.createElement("dd");
		
		if (this.officeBio == "True" && (this.officeTierType == "a" || this.officeTierType == "b")){
		    var tmpBioImage = document.createElement("img");
		    tmpBioImage.src = Locator.Config.bioIconSrc;
		    tmpBioImage.title = Locator.Config.bioIconTitle;
		    tmpBioIcon.appendChild(tmpBioImage);
		}
		if (this.officeCTBC == "True" && (this.officeTierType == "a" || this.officeTierType == "b")){
		    var tmpCallImage = document.createElement("img");
		    tmpCallImage.id = Locator.Config.ctbcIconId;
		    tmpCallImage.src = Locator.Config.ctbcIconSrc;
		    tmpCallImage.title = Locator.Config.ctbcIconTitle;
		    tmpCallIcon.appendChild(tmpCallImage);
		}
		/*MIKE
		if (this.officeSmile == "True" && (this.officeTierType == "a" || this.officeTierType == "b")){
		    var tmpSmileImage = document.createElement("img");
		    tmpSmileImage.src = Locator.Config.smileIconSrc;
		    tmpSmileImage.title = Locator.Config.smileIconTitle;
		    tmpSmileIcon.appendChild(tmpSmileImage);
		}
		*/
		if (this.offerAvailable == "True" && (this.officeTierType == "a" || this.officeTierType == "b")){
		    var tmpOfferImage = document.createElement("img");
		    tmpOfferImage.src = Locator.Config.offerIconSrc;
		    tmpOfferImage.title = Locator.Config.offerIconTitle;
		    tmpOfferIcon.appendChild(tmpOfferImage);
		}

		// if the voluma icon exists, put it
		for(var g=0, prod_len=this.products.length;g<prod_len;g++){
		    if(this.products[g].id == 4 && (this.officeTierType == "a" || this.officeTierType == "b")){
		        var tmpVolumaImage = document.createElement("img");
		        tmpVolumaImage.src = Locator.Config.volumaIconSrc;
		        tmpVolumaImage.title = Locator.Config.volumaIconTitle;
		        tmpVolumaIcon.appendChild(tmpVolumaImage);
		    }
		    if(this.products[g].id == 19 && (this.officeTierType == "a" || this.officeTierType == "b")){
		        var tmpSmileImage = document.createElement("img");
		    	tmpSmileImage.src = Locator.Config.smileIconSrc;
		   	 	tmpSmileImage.title = Locator.Config.smileIconTitle;
		    	tmpSmileIcon.appendChild(tmpSmileImage);
		    }

		}
		tmpDL.appendChild(tmpBioIcon);
		tmpDL.appendChild(tmpCallIcon);
		//mike
		tmpDL.appendChild(tmpSmileIcon);
		tmpDL.appendChild(tmpOfferIcon);
		tmpDL.appendChild(tmpVolumaIcon);
		tmpLI.appendChild(tmpAnchor);
		tmpLI.appendChild(tmpDL);
		
		var tmpIsTier = true;
		if (this.officeTier == "false"){
		    tmpIsTier = false;
		}
		// First and last classes
		if(officeId == 0){
		    tmpLI.className = "lrtop";
		} else if (isLast){
		    tmpLI.className = "lrlast";
		}
		// Hover
		tmpLI.onmouseover = function(){ Element.addClassName(this, 'hover') }
		tmpLI.onmouseout = function(){ Element.removeClassName(this, 'hover') }
		tmpLI.onclick = function(e){
			var oEvent = Locator.Utils.getEvent(e); 
			Locator.viewOverlay(officeId, this.officeTitle, tmpIsTier, oEvent); 
		}
		
		return tmpLI;
	}
	
	/* Offer/Voucher Overlay */
	
	function buildOffer() {
		var tmpOfferDiv = document.createElement("div");
		tmpOfferDiv.id = "offerVoucher";
		
		var tmpOfferArea = document.createElement("div");
		tmpOfferArea.id = "voucherArea";
		
		var tmpOfferInfo = document.createElement("dl");
		var tmpOfferName = document.createElement("dt");
		var tmpOfferNameText = document.createTextNode(this.showDisplayName());
		tmpOfferName.appendChild(tmpOfferNameText);
		tmpOfferInfo.appendChild(tmpOfferName);
		var tmpOfferInst = document.createElement("dd");
		var tmpOfferInstBold = document.createElement("strong");
		var tmpOfferInstText = document.createTextNode(this.officeInstitutionName);
		tmpOfferInstBold.appendChild(tmpOfferInstText);
		tmpOfferInst.appendChild(tmpOfferInstBold);
		tmpOfferInfo.appendChild(tmpOfferInst);
		var tmpOfferAddr = document.createElement("dd");
		var tmpOfferAddrText = document.createTextNode(this.showFormatedAddess());
		tmpOfferAddr.appendChild(tmpOfferAddrText);
		tmpOfferInfo.appendChild(tmpOfferAddr);
		var tmpOfferPhone = document.createElement("dd");
		var tmpOfferPhoneText = document.createTextNode(Locator.Config.telephonePrefixLabel + this.officePhone);
		tmpOfferPhone.appendChild(tmpOfferPhoneText);
		tmpOfferInfo.appendChild(tmpOfferPhone);
		
		tmpOfferArea.appendChild(tmpOfferInfo);
		
		tmpOfferDiv.appendChild(tmpOfferArea);
		
		tmpOfferPrint = document.createElement("input");
		tmpOfferPrint.id = "voucherPrint";
		tmpOfferPrint.type = "image";
		tmpOfferPrint.src = "/Style%20Library/images/btn_Print.gif";
		tmpOfferPrint.onclick = function(){ window.print() }
		
		tmpOfferDiv.appendChild(tmpOfferPrint);
		
		return tmpOfferDiv;
	}
	
	/* Request A Call */
	function buildRequestCall() {
	    
	    var tmpRequestCallDiv = document.createElement("div");
	    tmpRequestCallDiv.id = "requestCall";
	    
	    var tmpImgDropDiv = document.getElementById(Locator.Config.overlayHeadlineDrop);
	    tmpImgDropDiv.innerHTML = "";
	    var tmpHeadlineImg = document.createElement("img");
	    tmpHeadlineImg.src = Locator.Config.racHeadlinePath;
	    if (Locator.Config.racHeadlinePath.length > 0){
	        tmpImgDropDiv.appendChild(tmpHeadlineImg);
	    }
	    
	    //Headline
	    var tmpHeadline = document.createElement("h1");
	    var tmpHeadlineText = document.createTextNode(Locator.Config.racForm.labelHeadline);
	    if (Locator.Config.racForm.labelHeadline.length > 0){
	        tmpHeadline.appendChild(tmpHeadlineText);
	    }
	    
	    //Intro
	    var tmpClinicInfo = document.createElement("div");
	    tmpClinicInfo.id = "clinicInfo";
	    
	    var tmpCTop = document.createElement("div");
	    tmpCTop.id = "ciTop";
	    
	    var tmpCContent = document.createElement("div");
	    tmpCContent.id = "ciContent";
	    
	    var tmpIntroDiv = document.createElement("div");
	    tmpIntroDiv.id = "requestCallIntro";
	    var tmpIntroHeadline = document.createElement("h1");
	    var tmpIntroHeadlineText = document.createTextNode(this.showDisplayName());
	    tmpIntroHeadline.appendChild(tmpIntroHeadlineText);
	    tmpIntroDiv.appendChild(tmpIntroHeadline);
	    
	    var tmpIntroCopy = document.createElement("p");
	    var tmpIntroCopyText = document.createTextNode(Locator.Config.racForm.labelIntroText.replace(/DISPLAYNAME/, this.showDisplayName()));
	    tmpIntroCopy.appendChild(tmpIntroCopyText);
	    tmpIntroDiv.appendChild(tmpIntroCopy);
	    
	    tmpCContent.appendChild(tmpIntroDiv);
	    
	    var tmpCBtm = document.createElement("div");
	    tmpCBtm.id = "ciBtm";
	    
	    tmpClinicInfo.appendChild(tmpCTop);
	    tmpClinicInfo.appendChild(tmpCContent);
	    tmpClinicInfo.appendChild(tmpCBtm);
	    
	    
	    
	    
	    //Form note and error spans
	    var tmpNoteSpan = document.createElement("span");
	    tmpNoteSpan.className = "formNote";
	    var tmpNoteSpanText = document.createTextNode(Locator.Config.racForm.labelFieldsRequired);
	    tmpNoteSpan.appendChild(tmpNoteSpanText);
	    
	    var tmpErrorSpan = document.createElement("span");
	    tmpErrorSpan.id = "formError";
	    
	    //Form
	    var tmpCallbackForm = document.createElement("form");
	    tmpCallbackForm.id = "requestCallForm";
	    tmpCallbackForm.name = "requestCallForm";
	    
	    //First Name
	    var tmpFirstName = document.createElement("div");
	    tmpFirstName.className = "fieldPair";
	  
	    var tmpFirstNameLabel = document.createElement("div");
	    tmpFirstNameLabel.className = "fieldLabel";
	    tmpFirstNameLabel.id = "label_fname";
	    var tmpFirstNameLabelText = document.createTextNode(Locator.Config.racForm.labelFirstName);
	    tmpFirstNameLabel.appendChild(tmpFirstNameLabelText);
	    
	    var tmpFirstNameField = document.createElement("div");
	    tmpFirstNameField.className = "field";
	    var tmpFirstNameInputBkg = document.createElement("div");
	    tmpFirstNameInputBkg.className = "fieldBackground";
	    var tmpFirstNameInput = document.createElement("input");
	    tmpFirstNameInput.id = "fname";
	    tmpFirstNameInput.type = "text";
	    tmpFirstNameInput.name = "fname";
	    tmpFirstNameInput.maxLength = "30";
	    tmpFirstNameInput.className = "hasBackground";
	    tmpFirstNameInputBkg.appendChild(tmpFirstNameInput);
	    tmpFirstNameField.appendChild(tmpFirstNameInputBkg);
	    
	    tmpFirstName.appendChild(tmpFirstNameLabel);
	    tmpFirstName.appendChild(tmpFirstNameField);
	    tmpCallbackForm.appendChild(tmpFirstName);
	    
	    //Last Name
	    var tmpLastName = document.createElement("div");
	    tmpLastName.className = "fieldPair";
	    var tmpLastNameInputBkg = document.createElement("div");
	    tmpLastNameInputBkg.className = "fieldBackground";
	    var tmpLastNameInput = document.createElement("input");
	    tmpLastNameInput.id = "lname";
	    tmpLastNameInput.type = "text";
	    tmpLastNameInput.name = "lname";
	    tmpLastNameInput.maxLength = "30";
	    tmpLastNameInput.className = "hasBackground";
	    var tmpLastNameLabel = document.createElement("div");
	    tmpLastNameLabel.className = "fieldLabel";
	    tmpLastNameLabel.id = "label_lname";
	    var tmpLastNameLabelText = document.createTextNode(Locator.Config.racForm.labelLastName);
	    tmpLastNameLabel.appendChild(tmpLastNameLabelText);
	    
	    var tmpLastNameField = document.createElement("div");
	    tmpLastNameField.className = "field";
	    tmpLastNameInputBkg.appendChild(tmpLastNameInput);
	    tmpLastNameField.appendChild(tmpLastNameInputBkg);
	    
	    tmpLastName.appendChild(tmpLastNameLabel);
	    tmpLastName.appendChild(tmpLastNameField);
	    tmpCallbackForm.appendChild(tmpLastName);
	    
	    //Email
	    var tmpEmail = document.createElement("div");
	    tmpEmail.className = "fieldPair";
	  
	    var tmpEmailLabel = document.createElement("div");
	    tmpEmailLabel.className = "fieldLabel";
	    tmpEmailLabel.id = "label_email";
	    var tmpEmailLabelText = document.createTextNode(Locator.Config.racForm.labelEmail);
	    tmpEmailLabel.appendChild(tmpEmailLabelText);
	    
	    var tmpEmailInputBkg = document.createElement("div");
	    tmpEmailInputBkg.className = "fieldBackground";
	    
	    var tmpEmailField = document.createElement("div");
	    tmpEmailField.className = "field";
	    var tmpEmailInput = document.createElement("input");
	    tmpEmailInput.id = "email";
	    tmpEmailInput.type = "text";
	    tmpEmailInput.name = "email";
	    tmpEmailInput.maxLength = "50";
	    tmpEmailInput.className = "hasBackground";
	    tmpEmailInputBkg.appendChild(tmpEmailInput);
	    tmpEmailField.appendChild(tmpEmailInputBkg);
	    
	    tmpEmail.appendChild(tmpEmailLabel);
	    tmpEmail.appendChild(tmpEmailField);
	    tmpCallbackForm.appendChild(tmpEmail);
	    
	    //Confirm Email
	    var tmpConfirmEmail = document.createElement("div");
	    tmpConfirmEmail.className = "fieldPair";
	  
	    var tmpConfirmEmailLabel = document.createElement("div");
	    tmpConfirmEmailLabel.className = "fieldLabel";
	    tmpConfirmEmailLabel.id = "label_confirmemail";
	    var tmpConfirmEmailLabelText = document.createTextNode(Locator.Config.racForm.labelConfirmEmail);
	    tmpConfirmEmailLabel.appendChild(tmpConfirmEmailLabelText);
	    
	    var tmpConfirmEmailInputBkg = document.createElement("div");
	    tmpConfirmEmailInputBkg.className = "fieldBackground";
	    
	    var tmpConfirmEmailField = document.createElement("div");
	    tmpConfirmEmailField.className = "field";
	    var tmpConfirmEmailInput = document.createElement("input");
	    tmpConfirmEmailInput.id = "confirmemail";
	    tmpConfirmEmailInput.type = "text";
	    tmpConfirmEmailInput.name = "confirmemail";
	    tmpConfirmEmailInput.maxLength = "50";
	    tmpConfirmEmailInput.className = "hasBackground";
	    tmpConfirmEmailInputBkg.appendChild(tmpConfirmEmailInput);
	    tmpConfirmEmailField.appendChild(tmpConfirmEmailInputBkg);
	    
	    tmpConfirmEmail.appendChild(tmpConfirmEmailLabel);
	    tmpConfirmEmail.appendChild(tmpConfirmEmailField);
	    tmpCallbackForm.appendChild(tmpConfirmEmail);
	    
	    //Telephone
	    var tmpTelephone = document.createElement("div");
	    tmpTelephone.className = "fieldPair";
	  
	    var tmpTelephoneLabel = document.createElement("div");
	    tmpTelephoneLabel.className = "fieldLabel";
	    tmpTelephoneLabel.id = "label_telephone";
	    var tmpTelephoneLabelText = document.createTextNode(Locator.Config.racForm.labelTelephone);
	    tmpTelephoneLabel.appendChild(tmpTelephoneLabelText);
	    
	    var tmpTelephoneInputBkg = document.createElement("div");
	    tmpTelephoneInputBkg.className = "fieldBackground";
	    
	    var tmpTelephoneField = document.createElement("div");
	    tmpTelephoneField.className = "field";
	    var tmpTelephoneInput = document.createElement("input");
	    tmpTelephoneInput.id = "telephone";
	    tmpTelephoneInput.type = "text";
	    tmpTelephoneInput.name = "telephone";
	    tmpTelephoneInput.maxLength = "30";
	    tmpTelephoneInput.className = "hasBackground";
	    tmpTelephoneInputBkg.appendChild(tmpTelephoneInput);
	    tmpTelephoneField.appendChild(tmpTelephoneInputBkg);
	    
	    tmpTelephone.appendChild(tmpTelephoneLabel);
	    tmpTelephone.appendChild(tmpTelephoneField);
	    tmpCallbackForm.appendChild(tmpTelephone);
	    
	    //Contact Time
	    var tmpContactTime = document.createElement("div");
	    tmpContactTime.className = "fieldPair";
	  
	    var tmpContactTimeLabel = document.createElement("div");
	    tmpContactTimeLabel.className = "fieldLabel";
	    tmpContactTimeLabel.id = "label_contacttime";
	    var tmpContactTimeLabelText = document.createTextNode(Locator.Config.racForm.labelContactTime);
	    tmpContactTimeLabel.appendChild(tmpContactTimeLabelText);
	    
	    var tmpContactTimeField = document.createElement("div");
	    tmpContactTimeField.className = "field";
	    var tmpContactTimeInput = document.createElement("select");
	    tmpContactTimeInput.id = "contacttime";
	    tmpContactTimeInput.name = "contacttime";
	    var tmpContactOptions = [];
	    tmpContactOptions.push(Locator.Config.racForm.labelSelectTime,"9 AM - 12 PM","12 PM - 3 PM","3 PM - 6 PM","6 PM - 9 PM");
	    for (i=0; i<tmpContactOptions.length; i++) {
	        var tmpOption = document.createElement("option");
	        tmpOption.text = tmpContactOptions[i];
	        tmpOption.value = i;
	        try {
	            tmpContactTimeInput.add(tmpOption, null); 
	        } catch (ex) {
	            tmpContactTimeInput.add(tmpOption); 
	        }
	    }
	    tmpContactTimeField.appendChild(tmpContactTimeInput);
	    
	    tmpContactTime.appendChild(tmpContactTimeLabel);
	    tmpContactTime.appendChild(tmpContactTimeField);
	    tmpCallbackForm.appendChild(tmpContactTime);
	    
	    //Year and Month Born
	    var tmpBorn = document.createElement("div");
	    tmpBorn.className = "fieldPair";
	    tmpBorn.style.clear = "left";
	  
	    var tmpBornLabel = document.createElement("div");
	    tmpBornLabel.className = "fieldLabel";
	    tmpBornLabel.id = "label_born";
	    var tmpBornLabelText = document.createTextNode(Locator.Config.racForm.labelBornDate);
	    tmpBornLabel.appendChild(tmpBornLabelText);
	    
	    var tmpBornField = document.createElement("div");
	    tmpBornField.className = "field";
	        
	    // Year Select
	    var tmpYearBornInput = document.createElement("select");
	    tmpYearBornInput.id = "yearborn";
	    tmpYearBornInput.name = "yearborn";
	    var tmpYearBornOptions = [];
	    var tmpCurrentTime = new Date();
	    var tmpCurrentYear = tmpCurrentTime.getFullYear();
	    tmpYearBornOptions.push(Locator.Config.racForm.labelSelectYear);
	    for (h=0; h<100; h++) {
	        tmpYearBornOptions.push(tmpCurrentYear - h);
	    }
	    for (i=0; i<tmpYearBornOptions.length; i++) {
	        var tmpOption = document.createElement("option");
	        tmpOption.text = tmpYearBornOptions[i];
	        tmpOption.value = tmpYearBornOptions[i];
	        try {
	            tmpYearBornInput.add(tmpOption, null); 
	        } catch (ex) {
	            tmpYearBornInput.add(tmpOption); 
	        }
	    }
	    tmpBornField.appendChild(tmpYearBornInput);
	    
	    tmpBorn.appendChild(tmpBornLabel);
	    tmpBorn.appendChild(tmpBornField);
	    /* YEAR BORN REMOVED - 16wk CR 
	    tmpCallbackForm.appendChild(tmpBorn);*/
	    
	    //Gender
	    var tmpGender = document.createElement("div");
	    tmpGender.className = "fieldPair";
	    //tmpGender.style.clear = "right";
	  
	    var tmpGenderLabel = document.createElement("div");
	    tmpGenderLabel.className = "fieldLabel";
	    tmpGenderLabel.id = "label_gender";
	    var tmpGenderLabelText = document.createTextNode(Locator.Config.racForm.labelGender);
	    tmpGenderLabel.appendChild(tmpGenderLabelText);
	    
	    var tmpGenderField = document.createElement("div");
	    tmpGenderField.className = "field";
	    var tmpGenderInput = document.createElement("select");
	    tmpGenderInput.id = "gender";
	    tmpGenderInput.name = "gender";
	    var tmpGenderOptions = [];
	    tmpGenderOptions.push(Locator.Config.racForm.labelSelectGender,Locator.Config.racForm.labelOptionFemale,Locator.Config.racForm.labelOptionMale);
	    for (i=0; i<tmpGenderOptions.length; i++) {
	        var tmpOption = document.createElement("option");
	        tmpOption.text = tmpGenderOptions[i];
	        tmpOption.value = i;
	        try {
	            tmpGenderInput.add(tmpOption, null); 
	        } catch (ex) {
	            tmpGenderInput.add(tmpOption); 
	        }
	    }
	    tmpGenderField.appendChild(tmpGenderInput);
	    
	    tmpGender.appendChild(tmpGenderLabel);
	    tmpGender.appendChild(tmpGenderField);
	    /* GENDER REMOVED - 16wk CR
	    tmpCallbackForm.appendChild(tmpGender); */
	    
	    //Spacer
	    var tmpSpacerDiv = document.createElement("div");
	    tmpSpacerDiv.className = "clear";
	    tmpSpacerDiv.style.width = "350px";
	    //tmpCallbackForm.appendChild(tmpSpacerDiv);
	    
	    //Survey Questions (Not Required For Validation Engine)
	    var tmpSurvey = document.createElement("div");
	    tmpSurvey.id = "surveyQuestions";
	    
	    var tmpSurveyLabel = document.createElement("div");
	    tmpSurveyLabel.id = "label_survey";
	    tmpSurveyLabel.innerHTML = Locator.Config.racForm.labelSurveyHeadline;
	    
	    var numTreatments = this.treatments.length;
	    var numProducts = this.products.length;
	    
	        // Survey Area 1
	    var tmpSurveyArea1 = document.createElement("div");
	    tmpSurveyArea1.className = "surveyArea";
	    var tmpSurveyQuestionHeader = document.createElement("span");
	    tmpSurveyQuestionHeader.className = "surveyHeader";
	    var tmpSurveyQuestionHeaderText = document.createTextNode(Locator.Config.racForm.labelSurveyFacial);
	    tmpSurveyQuestionHeader.appendChild(tmpSurveyQuestionHeaderText);
	    tmpSurveyArea1.appendChild(tmpSurveyQuestionHeader);
	    
	    var tmpFaceQuestions = 0;
	            
	    // append survey question to survey area
	    for(y=0;y<numTreatments;y++) {
	        if (this.treatments[y].id == 1) {
	            tmpFaceQuestions ++;
	            tmpSurveyArea1.appendChild(buildSurveyQuestion(this.treatments[y].name,this.treatments[y].category,this.treatments[y].id));
	        }
	    }
	    // append survey question to survey area
	    for(a=0;a<numProducts;a++) {
	    	// juvederm ultra product id = 3
	        if (this.products[a].id == 3) {
	            tmpFaceQuestions ++;
	            tmpSurveyArea1.appendChild(buildSurveyQuestion(this.products[a].name,"Products",this.products[a].id));
	        // voluma product id = 4
	        } else if (this.products[a].id == 4) {
	            tmpFaceQuestions ++;
	            tmpSurveyArea1.appendChild(buildSurveyQuestion(this.products[a].name,"Products",this.products[a].id));
	        }
	    }
		// build final facial question
		tmpSurveyArea1.appendChild(buildSurveyQuestion("Other Treatments","Facial",0));

	    
	        // Survey Area 2 ONLY OUTPUT IF treatment.category "breast" is found
	    var showBreastSurvey = false; // assume false
	    // loop through array and find "breast" in a category
	    for(z=0;z<numTreatments;z++) {
	        if (this.treatments[z].category == "Breast") {
	            showBreastSurvey = true;
	        }
	    }
	        
	    var tmpSurveyArea2 = document.createElement("div");
	    tmpSurveyArea2.className = "surveyArea";
	    var tmpSurveyArea2QuestionHeader = document.createElement("span");
	    tmpSurveyArea2QuestionHeader.className = "surveyHeader";
	    var tmpSurveyArea2QuestionHeaderText = document.createTextNode(Locator.Config.racForm.labelSurveyBreast);
	    tmpSurveyArea2QuestionHeader.appendChild(tmpSurveyArea2QuestionHeaderText);
	    tmpSurveyArea2.appendChild(tmpSurveyArea2QuestionHeader);
	            // Question 1
	    var SA2Q1 = document.createElement("span");
	    SA2Q1.className = "surveyQuestion";
	    var SA2Q1Field = document.createElement("input");
	    SA2Q1Field.type = "checkbox";
	    SA2Q1Field.name = "Breast";
	    SA2Q1Field.id = "0";
	    var SA2Q1Label = document.createElement("label");
	    var SA2Q1LabelText = document.createTextNode(Locator.Config.racForm.labelSurveyBreastQ1);
	    SA2Q1Label.appendChild(SA2Q1LabelText);
	    SA2Q1.appendChild(SA2Q1Field);
	    SA2Q1.appendChild(SA2Q1Label);
	    tmpSurveyArea2.appendChild(SA2Q1);
	            // Question 2
	    var SA2Q2 = document.createElement("span");
	    SA2Q2.className = "surveyQuestion";
	    var SA2Q2Field = document.createElement("input");
	    SA2Q2Field.type = "checkbox";
	    SA2Q2Field.name = "Breast";
	    SA2Q2Field.id = "1";
	    var SA2Q2Label = document.createElement("label");
	    var SA2Q2LabelText = document.createTextNode(Locator.Config.racForm.labelSurveyBreastQ2);
	    SA2Q2Label.appendChild(SA2Q2LabelText);
	    SA2Q2.appendChild(SA2Q2Field);
	    SA2Q2.appendChild(SA2Q2Label);
	    tmpSurveyArea2.appendChild(SA2Q2);
	            // Question 3
	    var SA2Q3 = document.createElement("span");
	    SA2Q3.className = "surveyQuestion";
	    var SA2Q3Field = document.createElement("input");
	    SA2Q3Field.type = "checkbox";
	    SA2Q3Field.name = "Breast";
	    SA2Q3Field.id = "2";
	    var SA2Q3Label = document.createElement("label");
	    var SA2Q3LabelText = document.createTextNode(Locator.Config.racForm.labelSurveyBreastQ3);
	    SA2Q3Label.appendChild(SA2Q3LabelText);
	    SA2Q3.appendChild(SA2Q3Field);
	    SA2Q3.appendChild(SA2Q3Label);
	    tmpSurveyArea2.appendChild(SA2Q3);
	            // Question 4
	    var SA2Q4 = document.createElement("span");
	    SA2Q4.className = "surveyQuestion";
	    var SA2Q4Field = document.createElement("input");
	    SA2Q4Field.type = "checkbox";
	    SA2Q4Field.name = "Breast";
	    SA2Q4Field.id = "3";
	    var SA2Q4Label = document.createElement("label");
	    var SA2Q4LabelText = document.createTextNode(Locator.Config.racForm.labelSurveyBreastQ4);
	    SA2Q4Label.appendChild(SA2Q4LabelText);
	    SA2Q4.appendChild(SA2Q4Field);
	    SA2Q4.appendChild(SA2Q4Label);
	    tmpSurveyArea2.appendChild(SA2Q4);
	            // Question 5
	    var SA2Q5 = document.createElement("span");
	    SA2Q5.className = "surveyQuestion";
	    var SA2Q5Field = document.createElement("input");
	    SA2Q5Field.type = "checkbox";
	    SA2Q5Field.name = "Breast";
	    SA2Q5Field.id = "4";
	    var SA2Q5Label = document.createElement("label");
	    var SA2Q5LabelText = document.createTextNode(Locator.Config.racForm.labelSurveyBreastQ5);
	    SA2Q5Label.appendChild(SA2Q5LabelText);
	    SA2Q5.appendChild(SA2Q5Field);
	    SA2Q5.appendChild(SA2Q5Label);
	    tmpSurveyArea2.appendChild(SA2Q5);
	            // Question 6
	    var SA2Q6 = document.createElement("span");
	    SA2Q6.className = "surveyQuestion";
	    var SA2Q6Field = document.createElement("input");
	    SA2Q6Field.type = "checkbox";
	    SA2Q6Field.name = "Breast";
	    SA2Q6Field.id = "5";
	    var SA2Q6Label = document.createElement("label");
	    var SA2Q6LabelText = document.createTextNode(Locator.Config.racForm.labelSurveyBreastQ6);
	    SA2Q6Label.appendChild(SA2Q6LabelText);
	    SA2Q6.appendChild(SA2Q6Field);
	    SA2Q6.appendChild(SA2Q6Label);
	    tmpSurveyArea2.appendChild(SA2Q6);
	    
	    tmpSurvey.appendChild(tmpSurveyLabel);
	    
	    if (tmpFaceQuestions > 0) {
	        tmpSurvey.appendChild(tmpSurveyArea1);
	    }
	    /* REMOVE BREAST SURVEY
	    if (showBreastSurvey){
	        tmpSurvey.appendChild(tmpSurveyArea2);
	    }*/
	    
	    tmpCallbackForm.appendChild(tmpSurvey);
	    
	    //Spacer
	    var tmpSubmitSpacer = document.createElement("div");
	    tmpSubmitSpacer.className = "clear";
	    tmpCallbackForm.appendChild(tmpSubmitSpacer);
	    
	    //Submit Button
	    var tmpSubmit = document.createElement("div");
	    tmpSubmit.className = "fieldPair";
	    var tmpSubmitLabel = document.createElement("div");
	    tmpSubmitLabel.className = "fieldLabel";
	    tmpSubmitLabel.id = "label_submit";
	    tmpSubmitLabel.innerHTML = "&nbsp;";
	    
	    var tmpSubmitField = document.createElement("div");
	    tmpSubmitField.className = "field";
	    var tmpSubmitInput = document.createElement("input");
	    tmpSubmitInput.type = "button";
	    tmpSubmitInput.id = "racSubmit";
	    tmpSubmitInput.value = Locator.Config.racForm.labelSubmit;
	    var tmpBlahdity = this.officeInstitutionId;
	    var tmpBlahdity2 = this.officeDeptId;
	    var tmpBlahdity3 = this.physicianId;
	    tmpSubmitInput.onclick = function(){ checkRequestForm(officeId);} 
	    tmpSubmitField.appendChild(tmpSubmitInput);
	    
	    tmpSubmit.appendChild(tmpSubmitLabel);
	    tmpSubmit.appendChild(tmpSubmitField);
	    tmpCallbackForm.appendChild(tmpSubmit);
	    
	    //Form Methods
	    //tmpCallbackForm.onsubmit = function(){ return checkRequestForm() }
	    
	    //Append All Elements To Main DIV
	    tmpRequestCallDiv.appendChild(tmpHeadline);
	    tmpRequestCallDiv.appendChild(tmpClinicInfo);
	    tmpRequestCallDiv.appendChild(tmpNoteSpan);
	    tmpRequestCallDiv.appendChild(tmpErrorSpan);
	    tmpRequestCallDiv.appendChild(tmpCallbackForm);
	    
	    return tmpRequestCallDiv;
	}
	
	function buildSurveyQuestion(tmpName, tmpCategory, tmpId) {
	    var tmpSurveyQuestion = document.createElement("span");
	    tmpSurveyQuestion.className = "surveyQuestion";
	    
	    var tmpSurveyQuestionField = document.createElement("input");
	    tmpSurveyQuestionField.type = "checkbox";
	    tmpSurveyQuestionField.name = tmpCategory;
	    tmpSurveyQuestionField.id = tmpId;
	    
	    var tmpSurveyQuestionLabel = document.createElement("label");
	    var tmpSurveyQuestionLabelText = document.createTextNode(tmpName);
	    tmpSurveyQuestionLabel.appendChild(tmpSurveyQuestionLabelText);
		tmpSurveyQuestionLabel.htmlFor = tmpId;
		tmpSurveyQuestionLabel.style.cursor = "pointer";
	    
	    tmpSurveyQuestion.appendChild(tmpSurveyQuestionField);
	    tmpSurveyQuestion.appendChild(tmpSurveyQuestionLabel);
	    
	    return tmpSurveyQuestion;
	}
	
	/* Bio Overlay */
	function buildBio() {
	    var tmpBioDiv = document.createElement("div");
	    tmpBioDiv.id = "clinicBio";
	    
	    //headline image to drop, text headline in body, none, or both:
	    var tmpImgDropDiv = document.getElementById(Locator.Config.overlayHeadlineDrop);
	    tmpImgDropDiv.innerHTML = "";
	    var tmpHeadlineImg = document.createElement("img");
	    tmpHeadlineImg.src = Locator.Config.bioHeadlinePath;
	    if (Locator.Config.bioHeadlinePath.length > 0){
	        tmpImgDropDiv.appendChild(tmpHeadlineImg);
	    }
	    
	    var tmpBioHeadline = document.createElement("h1");
	    var tmpBioHeadlineText = document.createTextNode(Locator.Config.bioForm.labelHeadline);
	    tmpBioHeadline.appendChild(tmpBioHeadlineText);
	    
	    var tmpBioHeadlineCopy = document.createElement("span");
	    tmpBioHeadlineCopy.id = "bioHeadlineCopy";
	    var tmpBioHeadlineCopyText = document.createTextNode(Locator.Config.bioForm.labelHeadlineCopy);
	    tmpBioHeadlineCopy.appendChild(tmpBioHeadlineCopyText);
	    
	    // Clinic Info Area (name,address,contact info, and photo);
	    var tmpBioClinicInfo = document.createElement("div");
	    tmpBioClinicInfo.id = "clinicInfo";
	    
	    var tmpBioClinicInfoTop = document.createElement("div");
	    tmpBioClinicInfoTop.id = "ciTop";
	    
	    var tmpBioClinicInfoMid = document.createElement("div");
	    tmpBioClinicInfoMid.id = "ciContent";
	    // General Info Data
	    var tmpBioInfoData = document.createElement("dl");
	    var tmpBioConsultantName = document.createElement("dt");
	    var tmpBioConsultantNameText = document.createTextNode(this.showDisplayName());
	    tmpBioConsultantName.appendChild(tmpBioConsultantNameText);
	    tmpBioInfoData.appendChild(tmpBioConsultantName);
	    
	    var tmpBioDepartmentName = document.createElement("dd");
	    var tmpBioDepartmentNameBold = document.createElement("strong");
	    var tmpBioDepartmentNameText = document.createTextNode(this.officeDeptName);
	    tmpBioDepartmentNameBold.appendChild(tmpBioDepartmentNameText);
	    tmpBioDepartmentName.appendChild(tmpBioDepartmentNameBold);
	    tmpBioInfoData.appendChild(tmpBioDepartmentName);
	    
	    var tmpBioOfficeAddress = document.createElement("dd");
	    var tmpBioOfficeAddressText = document.createTextNode(this.officeAddress);
	    tmpBioOfficeAddress.appendChild(tmpBioOfficeAddressText);
	    tmpBioInfoData.appendChild(tmpBioOfficeAddress);
	    
	    var tmpBioOfficeAddress2 = document.createElement("dd");
	    var tmpBioOfficeAddress2Text = document.createTextNode(this.officeCity + ", " + this.officePostal);
	    tmpBioOfficeAddress2.appendChild(tmpBioOfficeAddress2Text);
	    tmpBioInfoData.appendChild(tmpBioOfficeAddress2);
	    
	    var tmpBioTelephone = document.createElement("dd");
	    var tmpBioTelephoneText = document.createTextNode(Locator.Config.telephonePrefixLabel + this.officePhone);
	    tmpBioTelephone.appendChild(tmpBioTelephoneText);
	    if (this.officePhone != "") {
	        tmpBioInfoData.appendChild(tmpBioTelephone);
	    }
	    
	    var tmpBioWebsite = document.createElement("dd");
	    var tmpBioWebsiteText = document.createTextNode(this.officeWeb);
	    tmpBioWebsite.appendChild(tmpBioWebsiteText);
	    if (this.officeWeb != "") {
	        tmpBioInfoData.appendChild(tmpBioWebsite);
	    }
	    
	    // Clinic Info Photo
	    var tmpPhysicianPhotoDiv = document.createElement("div");
	    tmpPhysicianPhotoDiv.id = "clinicPhoto";
	    var tmpPhysicianPhoto = document.createElement("img");
	    tmpPhysicianPhoto.src = Locator.Config.photoDataPath + "?id=" + this.officeRecordId;
	    //Create empty photo container and put photo in photodrop for analysis.
		var tmpPhotoDropDiv = document.getElementById("photoDrop");
		Locator.clearContainer(tmpPhotoDropDiv);
	    
	    if (this.officeHasPhoto == "True") {
	        tmpPhotoDropDiv.appendChild(tmpPhysicianPhoto);
	    } else {
	        var tmpDefaultImage = document.createElement("img");
	        tmpDefaultImage.src = Locator.Config.defaultClinicPhoto;
	        tmpPhysicianPhotoDiv.appendChild(tmpDefaultImage);
	    }
	    
	    tmpBioClinicInfoMid.appendChild(tmpBioInfoData);
	    tmpBioClinicInfoMid.appendChild(tmpPhysicianPhotoDiv);
	    
	    var tmpBioClinicInfoBtm = document.createElement("div");
	    tmpBioClinicInfoBtm.id = "ciBtm";
	    
	    tmpBioClinicInfo.appendChild(tmpBioClinicInfoTop);
	    tmpBioClinicInfo.appendChild(tmpBioClinicInfoMid);
	    tmpBioClinicInfo.appendChild(tmpBioClinicInfoBtm);
	    
	    var tmpBioGeneralInfo = document.createElement("div");
	    tmpBioGeneralInfo.id = "generalInfo";
	    tmpBioGeneralInfo.className = "hasBackground";
	    
	    // General Info Specialties
	    var tmpSpecialties = document.createElement("span");
	    tmpSpecialties.id = "specialties";
	    var tmpSpecialtiesHeadline = document.createElement("strong");
	    var tmpSpecialtiesHeadlineText = document.createTextNode(Locator.Config.bioForm.labelSpecialty);
	    tmpSpecialtiesHeadline.appendChild(tmpSpecialtiesHeadlineText);
	    var tmpSpecialtiesBreak = document.createElement("br");
	    
	    var tmpSpecialtiesText = "";
	    var tmpSpecialtyCount = 0;
	    
	    var tmpNumSpecialties = this.specialties.length;
	    for (a=0;a<tmpNumSpecialties;a++) {
	        if (this.specialties[a].name != "") {
                tmpSpecialtiesText += this.specialties[a].name + ", ";
                tmpSpecialtyCount += 1;
	        }
	    }
	    
	    if (tmpSpecialtyCount > 0) {
	        tmpSpecialtiesText = this.trimStringRight(tmpSpecialtiesText, 1);
	    }
	    var tmpSpecialtiesData = document.createTextNode(tmpSpecialtiesText);
	    
	    tmpSpecialties.appendChild(tmpSpecialtiesHeadline);
	    tmpSpecialties.appendChild(tmpSpecialtiesBreak);
	    tmpSpecialties.appendChild(tmpSpecialtiesData);
	    
	    // General Info Misc Info
	    var tmpMiscInfoDiv = document.createElement("div");
	    tmpMiscInfoDiv.id = "miscInfo";
	    
	    // University
	    if (this.physicianUniversity != "") {
	        var tmpUniversityDiv = document.createElement("div");
	        tmpUniversityDiv.className = "infoPair";
	        
	        var tmpUniversityLabel = document.createElement("div");
	        tmpUniversityLabel.className = "infoLabel";
	        var tmpUniversityLabelText = document.createTextNode(Locator.Config.bioForm.labelUniversity);
	        tmpUniversityLabel.appendChild(tmpUniversityLabelText);
	        
	        var tmpUniversityInfo = document.createElement("div");
	        tmpUniversityInfo.className = "info";
	        var tmpUniversityInfoText = document.createTextNode(this.physicianUniversity);
	        tmpUniversityInfo.appendChild(tmpUniversityInfoText);
	        
	        tmpUniversityDiv.appendChild(tmpUniversityLabel);
	        tmpUniversityDiv.appendChild(tmpUniversityInfo);
	        
	        tmpMiscInfoDiv.appendChild(tmpUniversityDiv);
	    }
	    // Degree
	    if (this.physicianDegree != "") {
	        var tmpDegreeDiv = document.createElement("div");
	        tmpDegreeDiv.className = "infoPair";
	        
	        var tmpDegreeLabel = document.createElement("div");
	        tmpDegreeLabel.className = "infoLabel";
	        var tmpDegreeLabelText = document.createTextNode(Locator.Config.bioForm.labelDegree);
	        tmpDegreeLabel.appendChild(tmpDegreeLabelText);
	        
	        var tmpDegreeInfo = document.createElement("div");
	        tmpDegreeInfo.className = "info";
	        var tmpDegreeInfoText = document.createTextNode(this.physicianDegree);
	        tmpDegreeInfo.appendChild(tmpDegreeInfoText);
	        
	        tmpDegreeDiv.appendChild(tmpDegreeLabel);
	        tmpDegreeDiv.appendChild(tmpDegreeInfo);
	        
	        tmpMiscInfoDiv.appendChild(tmpDegreeDiv);
	    }
	    // Languages
	    var tmpLanguagesDiv = document.createElement("div");
        tmpLanguagesDiv.className = "infoPair";
        
        var tmpLanguagesLabel = document.createElement("div");
        tmpLanguagesLabel.className = "infoLabel";
        var tmpLanguagesLabelText = document.createTextNode(Locator.Config.bioForm.labelLanguages);
        tmpLanguagesLabel.appendChild(tmpLanguagesLabelText);
        
        var tmpLanguagesInfo = document.createElement("div");
        tmpLanguagesInfo.className = "info";
        tmpLanguagesInfoData = "";
        
        var tmpLanguagesCount = 0;
	    var tmpNumLanguages = this.languages.length;
        for (b=0;b<tmpNumLanguages;b++) {
            if (this.languages[b].name != "") {
                tmpLanguagesInfoData += this.languages[b].name + ", ";
                tmpLanguagesCount += 1;
            }
        }
        if (tmpLanguagesCount > 1) {
            tmpLanguagesInfoData = this.trimStringRight(tmpLanguagesInfoData, 1);
        }
        tmpLanguagesInfoText = document.createTextNode(tmpLanguagesInfoData);
        tmpLanguagesInfo.appendChild(tmpLanguagesInfoText);
        
        tmpLanguagesDiv.appendChild(tmpLanguagesLabel);
	    tmpLanguagesDiv.appendChild(tmpLanguagesInfo);
        
        if (tmpLanguagesCount != 0) {
            tmpMiscInfoDiv.appendChild(tmpLanguagesDiv);
        }
	    
	    // Build General Info Area 
	    if (tmpSpecialtyCount > 0) {
	        tmpBioGeneralInfo.appendChild(tmpSpecialties);
	    }
	    tmpBioGeneralInfo.appendChild(tmpMiscInfoDiv);
	    
	    /* OPTIONAL DIVS ------------------------------------
	    --------------------------------------------------- */
	    
	    var optionalDivs = [];
	    
	    // Office Hours
	    var bioHoursExist = true;
	    var tmpBioOfficeHoursDiv = document.createElement("div");
	    tmpBioOfficeHoursDiv.id = "hours";
	    
	    var tmpBioOfficeHoursHeadline = document.createElement("span");
	    tmpBioOfficeHoursHeadline.id = "hoursHeadline";
	    var tmpBioOfficeHoursHeadlineText = document.createTextNode(Locator.Config.bioForm.labelHours);
	    tmpBioOfficeHoursHeadline.appendChild(tmpBioOfficeHoursHeadlineText);
	    
	    var tmpBioHourDataDiv = document.createElement("div");
	    tmpBioHourDataDiv.id = "hourData";
	    
	    var numHours = this.hours.length;
	    for (c=0;c<numHours;c++) {
	        // First check there is data in every field
	        if (this.hours[c].day == "" || this.hours[c].time == "") {
	            bioHoursExist = false; // Returns FALSE if ANY fields are blank
	        }
	        var bioHourDataColumn = document.createElement("div");
	        if (c == (numHours - 1)) {
	            bioHourDataColumn.className = "hourColumn last";
	        } else {
	            bioHourDataColumn.className = "hourColumn";
	        }
	        
	        var bioHourDataTop = document.createElement("div");
	        bioHourDataTop.className = "hourTop";
	        var bioHourDataTopText = document.createTextNode(this.hours[c].day);
	        bioHourDataTop.appendChild(bioHourDataTopText);
	        
	        var bioHourDataBtm = document.createElement("div");
	        bioHourDataBtm.className = "hourBtm";
		var strHours = this.hours[c].time.split(",");
		for(var g=0, hrs_len=strHours.length;g<hrs_len;g++){
			bioHourDataBtm.innerHTML += strHours[g];
			bioHourDataBtm.innerHTML += '<br/>';
		}
	        //var bioHourDataBtmText = document.createTextNode(this.hours[c].time);
	        //bioHourDataBtm.appendChild(bioHourDataBtmText);
	        
	        bioHourDataColumn.appendChild(bioHourDataTop);
	        bioHourDataColumn.appendChild(bioHourDataBtm);
	        tmpBioHourDataDiv.appendChild(bioHourDataColumn);
	        
	    }
	    
	    tmpBioOfficeHoursDiv.appendChild(tmpBioOfficeHoursHeadline);
	    tmpBioOfficeHoursDiv.appendChild(tmpBioHourDataDiv);
	    
	    if (bioHoursExist) {
	        optionalDivs.push(tmpBioOfficeHoursDiv);
	    }
	    
	    // Treatments
	    var bioTreatmentsExist = false;
	    var tmpBioTreatmentsDiv = document.createElement("div");
	    tmpBioTreatmentsDiv.id = "treatments";
	    
	    var tmpBioTreatmentsColumn1 = document.createElement("div");
	    tmpBioTreatmentsColumn1.className = "columnOne";
	    var tmpBioTreatmentsColumn1Text = document.createTextNode(Locator.Config.bioForm.labelTreatments);
	    tmpBioTreatmentsColumn1.appendChild(tmpBioTreatmentsColumn1Text);
	    
	    var tmpBioTreatmentsColumn2 = document.createElement("div");
	    tmpBioTreatmentsColumn2.className = "columnTwo";
	    var numTreatments = this.treatments.length;
	    var treatmentsHTML = "";
	    for (d=0;d<numTreatments;d++) {
	        if (this.treatments[d].name != "") {
	            treatmentsHTML += this.treatments[d].name + "<br>";
	            bioTreatmentsExist = true;
	        }
	    }
	    tmpBioTreatmentsColumn2.innerHTML = treatmentsHTML;
	    
	    tmpBioTreatmentsDiv.appendChild(tmpBioTreatmentsColumn1);
	    tmpBioTreatmentsDiv.appendChild(tmpBioTreatmentsColumn2);
	    
	    if (bioTreatmentsExist) {
	        optionalDivs.push(tmpBioTreatmentsDiv);
	    }
	    
	    // Services 
	    var bioServicesExist = false;
	    var tmpBioServicesDiv = document.createElement("div");
	    tmpBioServicesDiv.id = "services";
	    
	    var tmpBioServicesColumn1 = document.createElement("div");
	    tmpBioServicesColumn1.className = "columnOne";
	    var tmpBioServicesColumn1Text = document.createTextNode(Locator.Config.bioForm.labelServices);
	    tmpBioServicesColumn1.appendChild(tmpBioServicesColumn1Text);
	    
	    var tmpBioServicesColumn2 = document.createElement("div");
	    tmpBioServicesColumn2.className = "columnTwo";
	    var numServices = this.services.length;
	    var servicesHTML = "";
	    for (e=0;e<numServices;e++) {
	        if (this.services[e].name != "") {
	            servicesHTML += this.services[e].name + "<br>";
	            bioServicesExist = true;
	        }
	    }
	    tmpBioServicesColumn2.innerHTML = servicesHTML;
	    
	    tmpBioServicesDiv.appendChild(tmpBioServicesColumn1);
	    tmpBioServicesDiv.appendChild(tmpBioServicesColumn2);
	    
	    if (bioServicesExist) {
	        optionalDivs.push(tmpBioServicesDiv);
	    }
	    
	    // Products
	    var bioProductsExist = false;
	    var tmpBioProductsDiv = document.createElement("div");
	    tmpBioProductsDiv.id = "products";
	    
	    var tmpBioProductsColumn1 = document.createElement("div");
	    tmpBioProductsColumn1.className = "columnOne";
	    var tmpBioProductsColumn1Text = document.createTextNode(Locator.Config.bioForm.labelProducts);
	    tmpBioProductsColumn1.appendChild(tmpBioProductsColumn1Text);
	    
	    var tmpBioProductsColumn2 = document.createElement("div");
	    tmpBioProductsColumn2.className = "columnTwo";
	    var numProducts = this.products.length;
	    var productsHTML = "";
	    for (e=0;e<numProducts;e++) {
	        if (this.products[e].name != "") {
	            productsHTML += this.products[e].name + "<br>";
	            bioProductsExist = true;
	        }
	    }
	    tmpBioProductsColumn2.innerHTML = productsHTML;
	    
	    tmpBioProductsDiv.appendChild(tmpBioProductsColumn1);
	    tmpBioProductsDiv.appendChild(tmpBioProductsColumn2);
	    
	    if (bioProductsExist) {
	        optionalDivs.push(tmpBioProductsDiv);
	    }
	    
	    /* BUILD FORM ------------------------------------
	    --------------------------------------------------- */
	    if (Locator.Config.bioForm.labelHeadline.length > 0){
	        tmpBioDiv.appendChild(tmpBioHeadline);
	    }
	    tmpBioDiv.appendChild(tmpBioHeadlineCopy);
	    tmpBioDiv.appendChild(tmpBioClinicInfo);
	    tmpBioDiv.appendChild(tmpBioGeneralInfo);
	    
	    // Build Optional Divs
	    var numOptionalDivs = optionalDivs.length;
	    var numOptStart = 1;
	    for(z=0;z<numOptionalDivs;z++) {
	        if (z%2 == 0) {
	            tmpBioDiv.appendChild(optionalDivs[z]);
	        } else {
	            var tmpDivToAppend = optionalDivs[z];
	            tmpDivToAppend.className = "hasBackground";
	            tmpBioDiv.appendChild(tmpDivToAppend);
	        }
	    }
	    //Spacer 
	    var tmpSpacer = document.createElement("div");
	    tmpSpacer.className = "spacer";
	    // Return to map link
	    var tmpReturnLink = document.createElement("a");
	    tmpReturnLink.id = "lnkCloseBio";
	    tmpReturnLink.href = "javascript: (Locator.closeMapOverlay());";
	    tmpReturnLink.appendChild(document.createTextNode(Locator.Config.bioForm.labelReturn));
	    
	    tmpBioDiv.appendChild(tmpSpacer);
	    tmpBioDiv.appendChild(tmpReturnLink);
	    
	    return tmpBioDiv;
	}
	
}