<style>
div.gridbox_xp table.obj td {
	border-bottom: thin dashed;
	border-right:none;
}
.even{
	background-color: white;
}
.uneven{
	background-color: ghostwhite;
}
</style>
<fieldset>
<div id="pdTabbarContainer" style="position:relative;width:99.9%;height:200px;"></div>
<div id="statsContainer" style="width:97%;height:170px;"></div>
<div id="dataSharingContainer" style="width:97%;height:170px;"></div>
<div id="insuranceContainer" style="width:97%;height:170px;"></div>
<div id="participationContainer" style="width:97%;height:170px;"></div>
<div id="encountersContainer" style="width:97%;height:170px;"></div>
<div id="appointmentsContainer" style="width:97%;height:170px;"></div>
</fieldset>


<div style="float:left;font-size:9pt;">

	<div id="patientTabContainer" style="float:left;width:99%;height:420px;"></div>

	<div id="patientDetailsContainer">
<div style="margin-left:auto;margin-right:auto;font-size:9pt;">
	<div style="float:left;">
		<?=$this->form->renderOpen()?>
		<fieldset><legend><?=__("Patient Information")?></legend>
		<div style="float:left;">
			<div>
			<div style="display:table-cell; vertical-align:middle; height:100px;">
				<img src="<?=$this->baseUrl?>/img/no-person-image.png">
			</div>
			</div>
		</div>
		<div style="float:left;">
			<div style="margin-left:10px;">
			<?=$this->form->formPerson->personIdInput('FormHidden')?>
			<div class="formRow">
			<?=$this->form->formPerson->lastName->renderLabel()?>
			<?=$this->form->formPerson->lastNameInput()?>
			</div>
			<div class="formRow">
			<?=$this->form->formPerson->firstName->renderLabel()?>
			<?=$this->form->formPerson->firstNameInput()?>
			</div>
			<div class="formRow">
			<?$this->form->formPerson->middleName->setAttrib('size',10)?>
			<?=$this->form->formPerson->middleName->renderLabel()?>
			<?=$this->form->formPerson->middleNameInput()?>
			</div>
			<div class="formRow" style="margin-left:20px;">
			<?=$this->form->formPerson->dateOfBirth->renderLabel()?>
			<?=$this->form->formPerson->dateOfBirthInput()?>
			</div>
			<div class="formRow" style="margin-left:20px;">
			<?=$this->form->formPerson->gender->renderLabel()?>
			<?=$this->form->formPerson->genderInput('FormSelect',array("options" => Enumeration::getEnumArray('Gender','key')))?>
			</div>
			<br class="formRowDivider">
			<div class="formRow">
			<?$this->form->recordNumber->setAttrib('size',10)?>
			<?=$this->form->recordNumber->renderLabel()?>
			<?=$this->form->recordNumberInput()?>
			</div>
			<div class="formRow">
			<?=$this->form->formPerson->identifier->renderLabel()?>
			<?=$this->form->formPerson->identifierInput()?>
			</div>
			<div class="formRow">
			<?=$this->form->formPerson->maritalStatus->renderLabel()?>
			<?=$this->form->formPerson->maritalStatusInput('FormSelect',array("options" => Enumeration::getEnumArray('Marital Status','key')))?>
			</div>
			<div class="formRow">
			<?=$this->form->confidentiality->renderLabel()?>
			<?=$this->form->confidentialityInput('FormSelect',array("options" => Enumeration::getEnumArray('Confidentiality','key')))?>
			</div>
			<div class="formRow">
			<?=$this->form->signedHipaaDate->renderLabel()?>
			<?=$this->formDateText('patient[signedHipaaDate]',$this->form->signedHipaaDate->getValue(),array('id'=>'singedHipaaDateInput'))?>
			</div>
					<!--todo duplicate display<b>Marked as Duplicate</b> of<br> brogdon, aletha  #10053<br>
					<button onclick="window.location = '/index.php/main/Patient/edit/unmarkDuplicate/1042177?process=true'; return false;">Remove Duplicate Mark</button>-->
			<br class="formRowDivider">
			<div class="formRow">
			<?=$this->form->formPerson->primaryPracticeId->renderLabel()?>
			<?=$this->form->formPerson->primaryPracticeIdInput('FormSelect',array("options" => $this->facilityIterator->toArray('practiceId','name' )))?>
			</div>
			<div class="formRow">
			<?=$this->form->defaultProvider->renderLabel()?>
			<?=$this->form->defaultProviderInput('FormSelect',array("options" => Provider::getArray()))?>
			</div>
			<div class="formRow">
			<?=$this->form->formPerson->active->renderLabel()?>
			<?=$this->form->formPerson->activeInput('FormCheckbox', array('checked' => 1))?>
			</div>
			<?=$this->form->renderClose()?>
			<div style="text-align:right;">
			<?=$this->form->okInput('FormButton')?>
			</div>
			<!--<input type="submit" />-->
</fieldset>
<fieldset>
	<legend>Phone Numbers</legend>
	<div id="phoneContainer" style="width:80%;height:135px;overflow:scroll;"></div>
<script>
phoneGrid = new dhtmlXGridObject('phoneContainer');
phoneGrid.setImagePath("../img/");
phoneGrid.setHeader('<?=__('Number')?>,<?=__('Type')?>,<?=__('Notes')?>');
phoneGrid.setInitWidths("*,*,*");
phoneGrid.setColTypes("ed,ed,ed");
phoneGrid.setSkin("xp");
var testdata=[
	['342-344-2342','Home','information'],
	['555-555-1212','Emergency',''],
	['8769087000','Mobile',''],
]
phoneGrid.enableAlterCss("even","uneven");
phoneGrid.init();
phoneGrid.parse(testdata,"jsarray");

</script>
</fieldset>
<fieldset>
	<legend>Addresses</legend>
	<div id="addressContainer" style="width:80%;height:135px;overflow:scroll;"></div>
<script>
addressGrid = new dhtmlXGridObject('addressContainer');
addressGrid.setImagePath("../img/");
addressGrid.setHeader('<?=__('Name')?>,<?=__('Type')?>,<?=__('Address')?>,<?=__('City')?>,<?=__('Zip')?>');
addressGrid.setInitWidths("*,*,*,*,*");
addressGrid.setColTypes("ed,ed,ed,ed,ed");
addressGrid.setSkin("xp");
var testdata=[
        ['Parents\' Address','','123','Schenectady','12345'],
        ['main','','123 Main Street','Gaithersburg','20878'],
        ['mailing','Billing','1 main st','Phoenix','85001'],
]
addressGrid.enableAlterCss("even","uneven");
addressGrid.init();
addressGrid.parse(testdata,"jsarray");
</script>
</fieldset>
</div>


	<div id="statsContainer">
		<div class="tab" title="Statistics" tabKey="CPatientTabSet0/statistics">
		<table>
			<tr>
				<td><label>Ethnicity:</label></td>
				<td><select name="patientStatistics[ethnicity]"><option value="Array"></option><option label="Hispanic or Latino" value="1">Hispanic or Latino</option><option label="Not Hispanic or Latino" value="3" selected="selected">Not Hispanic or Latino</option></select></td>
				<td><label>Race:</label></td>
				<td><select name="patientStatistics[race]"><option value="Array"></option><option label="American Indian or Alaska Native" value="1">American Indian or Alaska Native</option><option label="Asian" value="2" selected="selected">Asian</option><option label="Black or African American" value="3">Black or African American</option><option label="Native Hawaiian or other Pacific Islander" value="4">Native Hawaiian or other Pacific Islander</option><option label="White" value="5">White</option><option label="Other" value="6">Other</option><option label="Unknown" value="7">Unknown</option></select></td>
			</tr>
			<tr>
				<td><label>Language:</label></td>
				<td><select name="string[patientStatistics[language]]" id="patientStatistics[language]" extra=" blank=&quot;&quot;"><option label="English" value="English">English</option><option label="Spanish" value="Spanish">Spanish</option><option label="Chinese" value="Chinese">Chinese</option><option label="Japanese" value="Japanese">Japanese</option><option label="Korean" value="Korean">Korean</option><option label="Portuguese" value="Portuguese">Portuguese</option><option label="Russian" value="Russian">Russian</option><option label="Sign Language" value="Sign Language">Sign Language</option><option label="Vietnamese" value="Vietnamese">Vietnamese</option><option label="Tagalog" value="Tagalog">Tagalog</option><option label="Punjabi" value="Punjabi">Punjabi</option><option label="Hindustani" value="Hindustani">Hindustani</option><option label="Armenian" value="Armenian">Armenian</option><option label="Arabic" value="Arabic">Arabic</option><option label="Laotian" value="Laotian">Laotian</option><option label="Hmong" value="Hmong">Hmong</option><option label="Cambodian" value="Cambodian">Cambodian</option><option label="Finnish" value="Finnish">Finnish</option><option label="Other" value="Other">Other</option></select></td>
				<td><label>Migrant Status:</label></td>
				<td><select name="patientStatistics[migrant_status]"><option value="Array"></option><option label="Migrant Worker" value="1" selected="selected">Migrant Worker</option><option label="Seasonal Worker" value="2">Seasonal Worker</option><option label="No" value="3">No</option><option label="other" value="4">other</option></select></td>
				<td><label></label></td>
				<td></td>
			</tr>
			<tr>
				<td><label>Monthly Income:</label></td>
				<td><input name="patientStatistics[monthly_income]" id="ps_monthly_income" value="2000" size=8 maxlength=8></td>
				<td><label>Income:</label></td>
				<td><select name="patientStatistics[income]"><option value="Array"></option><option label="Unknown" value="1">Unknown</option><option label="Under 100% of Poverty" value="2" selected="selected">Under 100% of Poverty</option><option label="100-200% of Poverty" value="3">100-200% of Poverty</option><option label="Above 200% of Poverty" value="4">Above 200% of Poverty</option></select></td>
			</tr>
			<tr>
				<td><label>Family Size:</label></td>
				<td><input name="patientStatistics[family_size]" id="ps_family_size" value="2" size=3 maxlength=3></td>
				<td><label>Number of Adults: </label></td>
				<td><input type='text' name="patientStatistics[number_of_adults]" value="2" id="patientStatistics[number_of_adults]" size="4"></td>
			</tr>
			<tr>
				<td><label>Date of First Encounter:</label></td>
				<td>04/16/2007</td>
				<td><label>Sign in Date: </label></td>
				<td><nobr class="jscal"><input name="patientStatistics[sign_in_date]" value="04/13/2009" size="10" id="_cal_2"><img id="_cal_2_trigger" src="/index.php/Images//stock/set_time.gif?" style="cursor: pointer; vertical-align: top"></nobr>
<script type="text/javascript">Calendar.setup( {inputField:"_cal_2", showsTime: false,ifFormat:"%m/%d/%Y",button:"_cal_2_trigger" }); clni_register_validation_rule('_cal_2','date','alert');</script></td>
			</tr>
			<tr>
				<td><label>Registration Location: </label></td>
				<td>
				    <select name="patientStatistics[registration_location]">
					    <option label="Ak Chin Clinic" value="134629">Ak Chin Clinic</option><option label="Bylas Health Center" value="134762">Bylas Health Center</option><option label="Cibecue Health Center" value="135103">Cibecue Health Center</option><option label="Fallon Tribal Health Center" value="134826">Fallon Tribal Health Center</option><option label="Fort Yuma PHS Indian Hospital" value="135392">Fort Yuma PHS Indian Hospital</option><option label="Ft. Duchesne Health Center" value="135631">Ft. Duchesne Health Center</option><option label="Havasupai Health Station" value="134356">Havasupai Health Station</option><option label="Hopi PHS Indian Hospital" value="135446">Hopi PHS Indian Hospital</option><option label="Hu Hu Kam Memorial Hospital" value="134675">Hu Hu Kam Memorial Hospital</option><option label="Las Vegas Paiute Tribe Health Clinic" value="134872">Las Vegas Paiute Tribe Health Clinic</option><option label="McDermitt Tribal Health Station" value="134849">McDermitt Tribal Health Station</option><option label="Newe Medical Clinic" value="134483">Newe Medical Clinic</option><option label="PARKER INDIAN HOSPITAL" value="135280">PARKER INDIAN HOSPITAL</option><option label="Peach Springs Health Ctr" value="134379">Peach Springs Health Ctr</option><option label="Phoenix Indian Medical Center" value="56537">Phoenix Indian Medical Center</option><option label="Pyramid Lake Health Center" value="134895">Pyramid Lake Health Center</option><option label="Reno/Sparks Health Center" value="134918">Reno/Sparks Health Center</option><option label="Salt River Health Center" value="134191" selected="selected">Salt River Health Center</option><option label="San Carlos PHS Indian Hospital" value="135522">San Carlos PHS Indian Hospital</option><option label="Schurz PHS Indian Hospital" value="135577">Schurz PHS Indian Hospital</option><option label="Southern Bands Health Center" value="135336">Southern Bands Health Center</option><option label="Walker River Tribal Health Clinic" value="134952">Walker River Tribal Health Clinic</option><option label="Washoe Tribal Health Center" value="134975">Washoe Tribal Health Center</option><option label="Wassaja Memorial Health Center" value="134652">Wassaja Memorial Health Center</option><option label="Whiteriver PHS Indian Hospital" value="135654">Whiteriver PHS Indian Hospital</option><option label="Yavapai Apache Health Clinic" value="134698">Yavapai Apache Health Clinic</option><option label="Yerington Tribal Health Center" value="134998">Yerington Tribal Health Center</option>
				    </select>
				</td>
			</tr>
			<tr>
				<td><label>Blood Quantum: </label></td>
				<td><select name="patientStatistics[indian_blood_quantum]" id="patientStatistics[indian_blood_quantum]" extra=""><option label="None" value="None">None</option><option label="Full" value="Full" selected="selected">Full</option><option label="Unknown" value="Unknown">Unknown</option><option label="Unspecified" value="Unspecified">Unspecified</option></select>
                                    </td>
				<td><label>Occupation: </label></td>
				<td><input type='text' name="patientStatistics[occupation]" value="none" id="patientStatistics[occupation]"></td>
			</tr>
			<tr>
				<td><label>Education Level: </label></td>
				<td>
				<select name="patientStatistics[education_level]" id="patientStatistics[education_level]" extra=""><option label="Unknown" value="Unknown">Unknown</option><option label="None-illiterate" value="None-illiterate">None-illiterate</option><option label="Some Elementary Education" value="Some Elementary Education">Some Elementary Education</option><option label="Some Middle School" value="Some Middle School">Some Middle School</option><option label="Some High School" value="Some High School">Some High School</option><option label="High School Degree" value="High School Degree">High School Degree</option><option label="Vocational/Tech School" value="Vocational/Tech School">Vocational/Tech School</option><option label="Some College" value="Some College" selected="selected">Some College</option><option label="Associates Degree" value="Associates Degree">Associates Degree</option><option label="Bachelors Degree" value="Bachelors Degree">Bachelors Degree</option><option label="Post Grad College" value="Post Grad College">Post Grad College</option><option label="Masters Degree" value="Masters Degree">Masters Degree</option><option label="Advanced Degree" value="Advanced Degree">Advanced Degree</option><option label="Other" value="Other">Other</option><option label="Blank" value="Blank">Blank</option></select>
				</td>
				<td><label>Employment Status: </label></td>
				<td>
				<select name="patientStatistics[employment_status]" id="patientStatistics[employment_status]" extra=""><option label="Employed" value="Employed">Employed</option><option label="Unemployed" value="Unemployed" selected="selected">Unemployed</option><option label="Unknown" value="Unknown">Unknown</option><option label="Blank" value="Blank">Blank</option></select>
				</td>
			</tr>
			<tr>
				<td><label>Indian Tribe: </label></td>
				<td colspan="3"><select name="patientStatistics[indian_tribe]" id="patientStatistics[indian_tribe]" extra=""><option label="None" value="None">None</option><option label="Absentee-Shawnee Tribe of Indians of Oklahoma " value="Absentee-Shawnee Tribe of Indians of Oklahoma ">Absentee-Shawnee Tribe of Indians of Oklahoma </option><option label="Agua Caliente Band of Cahuilla Indians of the Agua Caliente Indian Reservation, California " value="Agua Caliente Band of Cahuilla Indians of the Agua Caliente Indian Reservation, California " selected="selected">Agua Caliente Band of Cahuilla Indians of the Agua Caliente Indian Reservation, California </option><option label="Ak Chin Indian Community of the Maricopa (Ak Chin) Indian Reservation, Arizona " value="Ak Chin Indian Community of the Maricopa (Ak Chin) Indian Reservation, Arizona ">Ak Chin Indian Community of the Maricopa (Ak Chin) Indian Reservation, Arizona </option><option label="Alabama-Coushatta Tribes of Texas " value="Alabama-Coushatta Tribes of Texas ">Alabama-Coushatta Tribes of Texas </option><option label="Alabama-Quassarte Tribal Town, Oklahoma " value="Alabama-Quassarte Tribal Town, Oklahoma ">Alabama-Quassarte Tribal Town, Oklahoma </option><option label="Alturas Indian Rancheria, California " value="Alturas Indian Rancheria, California ">Alturas Indian Rancheria, California </option><option label="Apache Tribe of Oklahoma " value="Apache Tribe of Oklahoma ">Apache Tribe of Oklahoma </option><option label="Arapahoe Tribe of the Wind River Reservation, Wyoming " value="Arapahoe Tribe of the Wind River Reservation, Wyoming ">Arapahoe Tribe of the Wind River Reservation, Wyoming </option><option label="Aroostook Band of Micmac Indians of Maine " value="Aroostook Band of Micmac Indians of Maine ">Aroostook Band of Micmac Indians of Maine </option><option label="Assiniboine and Sioux Tribes of the Fort Peck Indian Reservation, Montana " value="Assiniboine and Sioux Tribes of the Fort Peck Indian Reservation, Montana ">Assiniboine and Sioux Tribes of the Fort Peck Indian Reservation, Montana </option></select>
</td>
			</tr>
			<tr>
				<td><input type="submit" value="Save"></td>
			</tr>
		</table>
		</div>

	</div>



		<div id="accountInfo">
			<fieldset><legend>Account Information</legend>
				<p><a href="javascript:viewAccountHistory()">Account History</a></p>
				<table>
				<tr>
					<td><label>Total Billed: </label></td><td style="text-align:right">2944.50</td>
				</tr>
				<tr>
					<td><label>Total Paid: </label></td><td style="text-align:right">271.00</td>
				</tr>
				<tr>
					<td><label>Total Writeoff: </label></td><td style="text-align:right">0.00</td>
				</tr>
				<tr>
					<td><label>Balance: </label></td><td style="border-top: solid 1px black; text-align:right">2673.50</td>
				</tr>
				<tr>
					<td colspan="2">Unpaid Payments</td>
				</tr>
				<tr><th>Date</th><th>Amount</th></tr>
				<tr>
					<td style="color:Red;">10/17/2006</td><td>37.50</td>
				</tr>
				<tr>
					<td style="color:Red;">11/16/2006</td><td>37.50</td>
				</tr>
				<tr>
					<td></td><td style="border-top:solid 1px black;">75.00</td>
				</tr>
				</table>
			</fieldset>
		</div>

<br style="clear:left"/>
<fieldset>
<div id="othersTabContainer" style="position:relative;width:99.9%;height:200px;"></div>
<div id="relatedPeopleContainer" style="width:97%;height:170px;"></div>
<div id="secondaryIdentifiersContainer" style="width:97%;height:170px;"></div>
<div id="nameHistoryContainer" style="width:97%;height:170px;"></div>
<div id="emailAddressesContainer" style="width:97%;height:170px;">
	<table>
		<tr>
			<td>Primary Email</td>
			<td><input type='text' name="person[email]" value=""></td>
		</tr>
		<tr>
			<td>Secondary Email</td>
			<td><input type='text' name="person[secondary_email]" value=""></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td><input type='submit' name="" value="Update"></td>
		</tr>
	</table>
</div>
<div id="secondaryPracticesContainer" style="width:97%;height:170px;">
	<div id="SecondaryPracticeGrid">
		<p>There are no secondary practices for this person.</p>
	</div>
	
	<div id="SecondaryPracticeForm">
		<form id='h3sform' class='generalForm' method='post' enctype='multipart/form-data'>
			<table>
				<tr>
					<td><label for="SecondaryPractice__practice_id">Practice</label></td>
					<td>
						<select name="SecondaryPractice[practice_id]">
							<option></option>
							<option label="Phoenix Service Unit" value="56459">Phoenix Service Unit</option><option label="Elko Service Unit" value="120067">Elko Service Unit</option>
						</select>
					</td>
				</tr>
				<tr>
					<td colspan="2">
						<input type="hidden" name="SecondaryPractice[person_id]" value="1042177" />
						<input type="hidden" name="SecondaryPractice[id]" value="" />
						<input type="submit" value="Save" />
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
<div id="specialNeedsContainer" style="width:97%;height:170px;">
	<table>
		<tr>
			<td><em>Notes</em></td><td>&nbsp;&nbsp;</td><td><em>Options</em></td>

		</tr>
		
		<tr>
			<td><textarea name="person[specialNeedsNote]" id="" rows="5" cols="35"></textarea></td>
			<td></td>
			<td valign="top">Translator Needed: <select name="person[specialNeeds]"></select></td>
		</tr>
	</table>
</div>
</fieldset>


<script>

relatedPeopleGrid = new dhtmlXGridObject('relatedPeopleContainer');
relatedPeopleGrid.setImagePath("../img/");
relatedPeopleGrid.setHeader(',<?=__('Person')?>,<?=__('Relation Of')?>,<?=__('Relation')?>,<?=__('DOB')?>,<?=__('Guarantor?')?>');
relatedPeopleGrid.setInitWidths("10,*,*,*,*,*");
relatedPeopleGrid.setColTypes("ro,ed,ed,ed,ed,ed");
relatedPeopleGrid.setSkin("xp");
var testdata=[
	['1','aletha Brogdons','Grand Parent','Guillermo Bielicki','1995-05-01','Yes (R of P) #1'],
]
relatedPeopleGrid.enableAlterCss("even","uneven");
relatedPeopleGrid.init();
relatedPeopleGrid.parse(testdata,"jsarray");


secondaryIdentifiersGrid = new dhtmlXGridObject('secondaryIdentifiersContainer');
secondaryIdentifiersGrid.setImagePath("../img/");
secondaryIdentifiersGrid.setHeader(',<?=__('Identifier')?>,<?=__('Type')?>');
secondaryIdentifiersGrid.setInitWidths("10,*,*");
secondaryIdentifiersGrid.setColTypes("ro,ed,ed");
secondaryIdentifiersGrid.setSkin("xp");
var testdata=[
	['1','marsha brogdons','Other'],
	['2','marsha brogdons','Other'],
]
secondaryIdentifiersGrid.enableAlterCss("even","uneven");
secondaryIdentifiersGrid.init();
secondaryIdentifiersGrid.parse(testdata,"jsarray");


nameHistoryGrid = new dhtmlXGridObject('nameHistoryContainer');
nameHistoryGrid.setImagePath("../img/");
nameHistoryGrid.setHeader(',<?=__('Date Changed')?>,<?=__('First Name')?>,<?=__('Last Name')?>,<?=__('Middle Initial')?>');
nameHistoryGrid.setInitWidths("10,*,*,*,*");
nameHistoryGrid.setColTypes("ro,ed,ed,ed,ed");
nameHistoryGrid.setSkin("xp");
var testdata=[
	['1','2009-05-13','Aletha','Brogdons','R'],
	['2','2009-05-13','marsha','Brogdons','R'],
	['3','2009-04-30','Aletha','Brogdon','R'],
	['4','2007-05-10','Aletha','Brogdon','Radlinski'],
	['5','2007-05-08','Aletha','Brogdon','Radlinski'],
	['6','2007-05-08','Aletha','O\'Brogdon','Radlinski'],
]
nameHistoryGrid.enableAlterCss("even","uneven");
nameHistoryGrid.init();
nameHistoryGrid.parse(testdata,"jsarray");


othersTab = new dhtmlXTabBar('othersTabContainer');
othersTab.setImagePath('<?=$this->baseUrl?>/img/');
othersTab.setStyle('silver');
othersTab.setHrefMode('ajax');
othersTab.setSkinColors('#FFFFFF,#FFFACD');

othersTab.addTab('relatedPeople','<?=__('Related People')?>','150px');
othersTab.addTab('secondaryIdentifiers','<?=__('Secondary Identifiers')?>','150px');
othersTab.addTab('nameHistory','<?=__('Name History')?>','150px');
othersTab.addTab('emailAddresses','<?=__('Email Addresses')?>','150px');
othersTab.addTab('secondaryPractices','<?=__('Secondary Practices')?>','150px');
othersTab.addTab('specialNeeds','<?=__('Special Needs')?>','150px');
othersTab.setContent('relatedPeople','relatedPeopleContainer');
othersTab.setContent('secondaryIdentifiers','secondaryIdentifiersContainer');
othersTab.setContent('nameHistory','nameHistoryContainer');
othersTab.setContent('emailAddresses','emailAddressesContainer');
othersTab.setContent('secondaryPractices','secondaryPracticesContainer');
othersTab.setContent('specialNeeds','specialNeedsContainer');
othersTab.setTabActive('relatedPeople');


function viewAccountHistory() {
	winSP = globalCreateWindow("windowAccountHistoryId",[],"<?=$this->baseUrl?>/patient.raw/account-history","<?=__('Account History')?>",800,600);
}


patientTab = new dhtmlXTabBar('patientTabContainer');
patientTab.setImagePath('<?=$this->baseUrl?>/img/');
patientTab.setStyle('silver');
patientTab.setHrefMode('ajax');
patientTab.setSkinColors('#FFFFFF,#FFFACD');

patientTab.addTab('patientDetails','<?=__('Patient Details')?>','100px');
patientTab.addTab('stats','<?=__('Statistics')?>','100px');
patientTab.addTab('insurance','<?=__('Insurance')?>','100px');
patientTab.setContent('patientDetails','patientDetailsContainer');
patientTab.setContent('stats','statsContainer');
patientTab.setContent('insurance','insuranceContainer');
patientTab.setTabActive('patientDetails');


insuranceGrid = new dhtmlXGridObject('insuranceContainer');
insuranceGrid.setImagePath("../img/");
insuranceGrid.setHeader('<?=__('Company')?>,<?=__('Program')?>,<?=__('Group Name')?>,<?=__('Group Number')?>,<?=__('Co-pay')?>,<?=__('Subscriber')?>,<?=__('Effective')?>,<?=__('Active')?>');
insuranceGrid.setInitWidths("*,*,*,*,60,80,*,50");
insuranceGrid.setColTypes("ed,ed,ed,ed,ed,ed,ed,ed");
insuranceGrid.setSkin("xp");
var testdata=[  
	['Blue Cross of Arizona','HMO','c71d0','942128','22.00','self','Until 10/16/2009','Yes'],
	['System','Self Pay2','NA','NA','0.00','self','Ended 00/00/0000','Yes'],
	['Medicare','NHIC','11233','12333','15.00','self','Ended 10/31/2006','Yes'],
	['Delta Dental','SourceINS','','','10.00','self','Ended 00/00/0000','Yes'],
	['System','AAT Funding','','','0.00','self','Ended 00/00/0000','Yes'],
	['System','Collections','','','0.00','self','Ended 00/00/0000','Yes'],
	['System','Correction','','','0.00','self','Ended 00/00/0000','Yes'],
	['Blue Cross of Arizona','HMO','ertert','ertert','15.00','relative','Ended 00/00/0000','Yes'],
	['Medicare','NHIC','1123355','12333','15.00','self','Ended 10/31/2006','Yes'],
	['System','Collections','','','0.00','self','Ended 00/00/0000','Yes'],
	['Blue Cross of Arizona','HMO','','','0.00','relative','Ended 00/00/0000','Yes'],
	['System','Collections','','','0.00','self','Ended 00/00/0000','Yes'],
	['Medicare','NHIC','grpo','12344','12.00','relative','Ended 00/00/0000','Yes'],
]
insuranceGrid.enableAlterCss("even","uneven");
insuranceGrid.init();
insuranceGrid.parse(testdata,"jsarray");


participationGrid = new dhtmlXGridObject('participationContainer');
participationGrid.setImagePath("../img/");
participationGrid.setHeader(',<?=__('Name')?>,<?=__('Start')?>,<?=__('End')?>,<?=__('Expires')?>,<?=__('Active')?>');
participationGrid.setInitWidths("20,*,100,100,50,50");
participationGrid.setColTypes("ro,ed,ed,ed,ed,ed");
participationGrid.setSkin("xp");
var testdata=[  
	['1','Adhoc','2007-09-15','2008-09-15','no','yes'],
	['2','New Program Other','2007-05-04','2008-05-04','no','yes'],
	['3','OpenClinica','2008-08-07','0000-00-00','yes','yes'],
	['4','PSU','2007-05-27','2008-05-27','no','yes'],
]
participationGrid.enableAlterCss("even","uneven");
participationGrid.init();
participationGrid.parse(testdata,"jsarray");


encountersGrid = new dhtmlXGridObject('encountersContainer');
encountersGrid.setImagePath("../img/");
encountersGrid.setHeader(',<?=__('Date of Treatment')?>,<?=__('Reason')?>,<?=__('Building')?>,<?=__('Treated By')?>,<?=__('Status')?>');
encountersGrid.setInitWidths("10,*,*,*,*,50");
encountersGrid.setColTypes("ro,ed,ed,ed,ed,ed");
encountersGrid.setSkin("xp");
var testdata=[
	['1','06/11/2009','Provider','Wassaja Memorial Health Center','Corazon Falconer','open'],
	['2','06/10/2009','Provider','Salt River Health Center','Corazon Falconer','closed'],
	['3','04/17/2009','Provider','Newe Medical Clinic','Jfdadf afafafa','open'],
]
encountersGrid.enableAlterCss("even","uneven");
encountersGrid.init();
encountersGrid.parse(testdata,"jsarray");
appointmentsGrid.attachEvent("onRowDblClicked",function(rowId,colIndex) { windowEncounters(); });

function windowEncounters() {
	winSP = globalCreateWindow("windowEncountersId",[],"<?=$this->baseUrl?>/patient.raw/encounter","<?=__('Edit Encounter')?>",800,600);
}


appointmentsGrid = new dhtmlXGridObject('appointmentsContainer');
appointmentsGrid.setImagePath("../img/");
appointmentsGrid.setHeader(',<?=__('Start')?>,<?=__('Time')?>,<?=__('Title')?>,<?=__('Reason')?>,<?=__('Code')?>,<?=__('Provider')?>,<?=__('Location')?>');
appointmentsGrid.setInitWidths("10,*,*,*,*,*,*,*");
appointmentsGrid.setColTypes("ro,ed,ed,ed,ed,ed,ed,ed");
appointmentsGrid.setSkin("xp");
var testdata=[
	['1','07/09/09 08:00','15m','followup','Provider','','Falconer, Corazon','Salt River Health Center -> General Care'],
	['2','05/28/09 08:00','15m','Completed: cough','Provider','COM','Falconer, Corazon','Salt River Health Center -> General Care'],
	['3','05/06/09 08:00','15m','test','Provider','','Gooddoc, Horace','Salt River Health Center -> General Care'],
]
appointmentsGrid.enableAlterCss("even","uneven");
appointmentsGrid.init();
appointmentsGrid.parse(testdata,"jsarray");


pdTabbar = new dhtmlXTabBar('pdTabbarContainer');
pdTabbar.setImagePath('<?=$this->baseUrl?>/img/');
pdTabbar.setStyle('silver');
pdTabbar.setHrefMode('ajax');
pdTabbar.setSkinColors('#FFFFFF,#FFFACD');

pdTabbar.addTab('insurance','<?=__('Insurance Programs')?>','150px');
pdTabbar.addTab('participation','<?=__('Participation')?>','150px');
pdTabbar.addTab('encounters','<?=__('Encounters')?>','150px');
pdTabbar.addTab('appointments','<?=__('Appointments')?>','150px');
pdTabbar.setContent('insurance','insuranceContainer');
pdTabbar.setContent('participation','participationContainer');
pdTabbar.setContent('encounters','encountersContainer');
pdTabbar.setContent('appointments','appointmentsContainer');
pdTabbar.setTabActive('insurance');

</script>



