//Global Variables
var toDis;
// Thiru
//Hospital card - start
function removerpropertyName(id)
{ 
	document.getElementById(id).childNodes[0].style.display="none";
}

function Sendacknowledge()
{   
    var InHonorOfRadioList = getFormRadioButtonList("InHonorOf");
    var InMemoryOfRadioList = getFormRadioButtonList("InMemoryOf");
    var useMemorialCheckboxList = getFormCheckboxList("MemoralGift");
    if (useMemorialCheckboxList[0].checked == true)
    {
        getElementByPD_Id("NameAck").setAttribute("PD_isRequiredValue","true");
        getElementByPD_Id("AddressAck").setAttribute("PD_isRequiredValue","true");
        getElementByPD_Id("CityAck").setAttribute("PD_isRequiredValue","true");
        getElementByPD_Id("StateAck").setAttribute("PD_isRequiredValue","true");
        getElementByPD_Id("ZipAck").setAttribute("PD_isRequiredValue","true");	
        labelchange('OnlineDonation',0);
        document.getElementById('lblNameAck').innerHTML="";
		document.getElementById('lblNameAck').innerHTML='<font class="reqAstric">*</font>'+"Name";
		document.getElementById('lblAddressAck').innerHTML="";
		document.getElementById('lblAddressAck').innerHTML='<font class="reqAstric">*</font>'+"Address";
		document.getElementById('lblCityAck').innerHTML="";
		document.getElementById('lblCityAck').innerHTML='<font class="reqAstric">*</font>'+"City";
		document.getElementById('lblStateAck').innerHTML="";
		document.getElementById('lblStateAck').innerHTML='<font class="reqAstric">*</font>'+"State";
		document.getElementById('lblZipAck').innerHTML="";
		document.getElementById('lblZipAck').innerHTML='<font class="reqAstric">*</font>'+"Zip Code";   
		
        InMemoryOfRadioList[0].checked=false;
        InMemoryOfRadioList[0].disabled=false;
            
        InHonorOfRadioList[0].checked=false;
        InHonorOfRadioList[0].disabled=false; 
        
        getElementByPD_Id("InHonorOfName").value="";
        getElementByPD_Id("InMemoryOfName").value="";
        
    }
    else if (useMemorialCheckboxList[0].checked == false)	
    { 
        getElementByPD_Id("NameAck").setAttribute("PD_isRequiredValue","false");
        getElementByPD_Id("AddressAck").setAttribute("PD_isRequiredValue","false");
        getElementByPD_Id("CityAck").setAttribute("PD_isRequiredValue","false");
        getElementByPD_Id("StateAck").setAttribute("PD_isRequiredValue","false");
        getElementByPD_Id("ZipAck").setAttribute("PD_isRequiredValue","false");	
        
        document.getElementById('lblNameAck').innerHTML="";
        document.getElementById('lblNameAck').innerHTML="Name";
		document.getElementById('lblAddressAck').innerHTML="";
		document.getElementById('lblAddressAck').innerHTML="Address";
		document.getElementById('lblCityAck').innerHTML="";
		document.getElementById('lblCityAck').innerHTML="City";
		document.getElementById('lblStateAck').innerHTML="";
		document.getElementById('lblStateAck').innerHTML="State";
		document.getElementById('lblZipAck').innerHTML="";
		document.getElementById('lblZipAck').innerHTML="Zip Code";       
        //labelchange('OnlineDonation',0);
        
        InMemoryOfRadioList[0].checked=false;
        InMemoryOfRadioList[0].disabled=true;
            
        InHonorOfRadioList[0].checked=false;
        InHonorOfRadioList[0].disabled=true; 
        
        getElementByPD_Id("InHonorOfName").disabled=true;
        getElementByPD_Id("InMemoryOfName").disabled=true;
        
        getElementByPD_Id("InHonorOfName").value="";
        getElementByPD_Id("InMemoryOfName").value="";
    }
}

function OptionYesClick()
{	
    var radioList = getFormRadioButtonList("YesNoOption");
    radioList[0].setAttribute("clickvalue","1");
    radioList[1].setAttribute("clickvalue","0");
   
    //document.getElementById('BaseNehsAutoForm17_YesNoOption_0').setAttribute("clickvalue","1");
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_1').setAttribute("clickvalue","0");	
}

function OptionNoClick()
{	
    var radioList = getFormRadioButtonList("YesNoOption");
    radioList[0].setAttribute("clickvalue","0");
    radioList[1].setAttribute("clickvalue","1");   
  
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_0').setAttribute("clickvalue","0");
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_1').setAttribute("clickvalue","1");	
}

function OptionYesClickPreReg()
{	
    var radioList = getFormRadioButtonList("YesNoOption");
    radioList[0].setAttribute("clickvalue","1");
    radioList[1].setAttribute("clickvalue","0");	
    
    document.getElementById('continue').src = "/css/images/btnContinueD.gif";   
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_0').setAttribute("clickvalue","1");
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_1').setAttribute("clickvalue","0");	
}

function OptionNoClickPreReg()
{	
    var radioList = getFormRadioButtonList("YesNoOption");
    radioList[0].setAttribute("clickvalue","0");
    radioList[1].setAttribute("clickvalue","1");	
    
    document.getElementById('continue').src = "/css/images/btnContinueD.gif"; 
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_0').setAttribute("clickvalue","0");
	//document.getElementById('BaseNehsAutoForm17_YesNoOption_1').setAttribute("clickvalue","1");	
}

function insuranceClick()
{
	 document.getElementById('applicationCont').src = "/css/images/btnContinueD.gif"; 
}


function addElement() 
{ 	
	//var ni = document.getElementById('divPatient Information');
	//var newdiv = document.createElement('div'); 
	//var divIdName = 'mybutDiv'; 
	//newdiv.setAttribute('id',divIdName);
	////newdiv.innerHTML = '<input type="button" onclick="checkappointment()" name="Continue" id="continue" value="CONTINUE">'; 

	//newdiv.innerHTML = '<div class="contactInfoButtonArea"><input type="image" src="/css/images/btnContinueD.gif" onclick="checkappointment(); return false;" id="continue" NAME="Continue" /></div>'
	//ni.appendChild(newdiv); 
    
    var newelement=document.createElement('div');
	var oldelement=document.getElementById('divEmployer');
	newelement.setAttribute('id', 'continuebutton')
	newelement.innerHTML ='<input type="image" src="/css/images/btnContinue.gif" onclick="checkappointment(); return false;" id="continue" NAME="Continue" class="hospitalContinue" />';
	oldelement.parentNode.insertBefore(newelement,oldelement);
	
	//To display Emergency Contact Label as heading added by thiru on 19/07/2007 - start		
		
	var newelementemergency=document.createElement('div');
    var olddivelement=document.getElementById('div1st Emergency Contact (Next of Kin)');
    newelementemergency.setAttribute('id','divlblEmergency')
    newelementemergency.innerHTML='<h3>EMERGENCY CONTACT INFORMATION</h3><br>';
    olddivelement.parentNode.insertBefore(newelementemergency,olddivelement);
	
	//To display Emergency Contact Label as heading added by thiru on 19/07/2007 - end
	
}

function addElementPreRegister() 
{ 	
	//var ni = document.getElementById('divPatient Information');
	//var newdiv = document.createElement('div'); 
	//var divIdName = 'mybutDiv'; 
	//newdiv.setAttribute('id',divIdName);
	//newdiv.innerHTML = '<div class="contactInfoButtonArea"><input type="image" src="/css/images/btnContinue.gif" onclick="checkappointmentPreregister(); return false;" id="continue" NAME="Continue" class="hospitalContinue" /></div>'
	//ni.appendChild(newdiv); 	
	
	//To display Emergency Contact Label as heading added by thiru on 19/07/2007 - start		
		
	var newelementemergency=document.createElement('div');
    var olddivelement=document.getElementById('div1st Emergency Contact (Next of Kin)');
    newelementemergency.setAttribute('id','divlblEmergency')
    newelementemergency.innerHTML='<h3>EMERGENCY CONTACT INFORMATION</h3><br>';
    olddivelement.parentNode.insertBefore(newelementemergency,olddivelement);
	
	//To display Emergency Contact Label as heading added by thiru on 19/07/2007 - end
}

function addElementinsurance()
{
    if (document.getElementById('myinsbutDiv'))
    { }
    else
    {
	    var ni = document.getElementById('divInsurance Information');
	    var newdiv = document.createElement('div'); 
	    var divIdName = 'myinsbutDiv'; 
	    newdiv.setAttribute('id',divIdName);
	    //newdiv.innerHTML = '<input type="button" onclick="checkInsurance()" name="ContinueIns" id="continueIns" value="CONTINUE">'; 

	    newdiv.innerHTML ='<div class="contactInfoButtonArea"><input type="image" src="/css/images/btnContinue.gif" onclick="checkInsurance(); return false;" id="applicationCont" NAME="applicationCont" class="hospitalContinue" /></div>';
	    ni.appendChild(newdiv); 	
	}
}

function addElementinsurancePre()
{
    if (document.getElementById('myinsbutDiv'))
    { }
    else
    {
	    var ni = document.getElementById('divInsurance Information');
	    var newdiv = document.createElement('div'); 
	    var divIdName = 'myinsbutDiv'; 
	    newdiv.setAttribute('id',divIdName);
	    //newdiv.innerHTML = '<input type="button" onclick="checkInsurance()" name="ContinueIns" id="continueIns" value="CONTINUE">'; 

	    newdiv.innerHTML ='<div class="contactInfoButtonArea"><input type="image" src="/css/images/btnContinue.gif" onclick="checkInsurancePre(); return false;" id="applicationCont" NAME="applicationCont" class="hospitalContinue" /></div>';
	    ni.appendChild(newdiv); 	
	}
}

function checkappointmentPreregister()
{
	//if (document.getElementById('BaseNehsAutoForm17_HaveyoubeentoaBeverlyHospitalMember_0').checked)
	var yesNoRadioList = getFormRadioButtonList("YesNoOption");
	var employerStatusRadioList = getFormRadioButtonList("EmploymentStatus");
	
	var subscriberIN1Table = getFormTable("IsthePatienttheSubscriberIN1");
	var subscriberIN2Table = getFormTable("IsthePatienttheSubscriberIN2");
	var subscriberIN3Table = getFormTable("IsthePatienttheSubscriberIN3");
	var subscriberIN4Table = getFormTable("IsthePatienttheSubscriberIN4");	
  	var employerStatusTable = getFormTable("EmploymentStatus");
  	
  	   
	//if (document.getElementById('BaseNehsAutoForm17_YesNoOption_0').getAttribute("clickvalue")==1)
	if (yesNoRadioList[0].getAttribute("clickvalue")==1)
	{
		//document.getElementById('divAppointment Information').style.display = "none";
		document.getElementById('divEmployer').style.display = "none";
		document.getElementById('div1st Emergency Contact (Next of Kin)').style.display = "none";
		document.getElementById('div2nd Emergency Contact (Person to Notify)').style.display = "none";
		document.getElementById('divInsurance Information').style.display = "none";
		
		if (document.getElementById('divInsurance 1'))
		{
		    document.getElementById('divInsurance 1').style.display = "none";
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divInsurance 2'))
		{
		    document.getElementById('divInsurance 2').style.display = "none";
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN2Table.setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divInsurance 3'))
		{
		    document.getElementById('divInsurance 3').style.display = "none";
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN2Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN3Table.setAttribute("PD_isRequiredValue","false");
		    
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divInsurance 4'))
		{
		    document.getElementById('divInsurance 4').style.display = "none";
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN2Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN3Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN4Table.setAttribute("PD_isRequiredValue","false");
		    
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN4').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divGuarantor`s Information'))
		{
		    document.getElementById('divGuarantor`s Information').style.display = "none";
		    getElementByPD_Id("FirstNameGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("LastNameGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("AddressGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("CityGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("StateGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("ZipCodeGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("RelationshiptoPatientGU").setAttribute("PD_isRequiredValue","false");
		}
		
		//if (document.getElementById("BaseNehsAutoForm17_EmploymentStatus"))
		if (employerStatusTable)
		{
		    //document.getElementById("BaseNehsAutoForm17_EmploymentStatus").setAttribute("PD_isRequiredValue","false");
		    
		    getElementByPD_Id("NameEmp").setAttribute("PD_isRequiredValue","false");
		    Removerequiredhospital();
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//    document.getElementById('divAppointment Information.').style.display = "none";
		//}
				
		document.getElementById('formButtonSubmit').style.display = "block";
		if (document.getElementById('mythankDiv'))
		{		    
			var ni = document.getElementById('mybutDiv');
	      	var olddiv = document.getElementById('mythankDiv'); 
			ni.removeChild(olddiv); 
		}
		addElementthankyouPrereg();			
		
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass');		
		//var ageParent = elements[2];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[3];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[4];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[5];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		//var ageParent = elements[6];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[7];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[8];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[9];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[10];		
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[11];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[12];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[13];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[14];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');		
		var ageParent = elements[15];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
        var ageParent = elements[16];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		
		if (document.getElementById('bulletlineai'))
		{
		  document.getElementById('bulletlineai').innerHTML="";
		  document.getElementById('bulletlineai').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('divAppointment Information');
		    newelement.setAttribute('id', 'bulletlineai')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
	}
	else if(yesNoRadioList[0].getAttribute("clickvalue") == 0)	
	{	
	   
		//document.getElementById('divAppointment Information').style.display = "block";
		
		
		document.getElementById('divEmployer').style.display = "block";
		document.getElementById('div1st Emergency Contact (Next of Kin)').style.display = "block";
		document.getElementById('div2nd Emergency Contact (Person to Notify)').style.display = "block";
		document.getElementById('divInsurance Information').style.display = "block";
		
	
		
		if (document.getElementById('formButtonSubmit'))
		{
		    document.getElementById('formButtonSubmit').style.display = "none";
		}
		
		if (document.getElementById('mythankDiv'))
		{
			    var ni = document.getElementById('divAppointment Information');
		        var olddiv = document.getElementById('mythankDiv'); 
			    ni.removeChild(olddiv); 		
		}	

		addElementinsurancePre();
		labelchange("PreRegister",1);	
		
		
		if (document.getElementById('bulletlineemp'))
		{
		    document.getElementById('bulletlineemp').innerHTML="";
		    document.getElementById('bulletlineemp').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{		
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('divEmployer');
		    newelement.setAttribute('id', 'bulletlineemp')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
		if (document.getElementById('bulletlineNTK'))
		{
		    document.getElementById('bulletlineNTK').innerHTML="";
		    document.getElementById('bulletlineNTK').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{		
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('div1st Emergency Contact (Next of Kin)');
		    newelement.setAttribute('id', 'bulletlineNTK')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
		if (document.getElementById('bulletlinePTN'))
		{
		    document.getElementById('bulletlinePTN').innerHTML="";
		    document.getElementById('bulletlinePTN').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{				
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('div2nd Emergency Contact (Person to Notify)');
		    newelement.setAttribute('id', 'bulletlinePTN')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
		if (document.getElementById('bulletlineini'))
		{
		    document.getElementById('bulletlineini').innerHTML="";
		    document.getElementById('bulletlineini').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{			    
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance Information');
	        newelement.setAttribute('id', 'bulletlineini')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
		}		
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		var ageParent = elements[9];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
	}	
	 document.getElementById('continue').src = "/css/images/btnContinue.gif";
}

function checkappointment()
{ 
    var yesNoRadioList = getFormRadioButtonList("YesNoOption");
	var employerStatusRadioList = getFormRadioButtonList("EmploymentStatus");
	
	var subscriberIN1Table = getFormTable("IsthePatienttheSubscriberIN1");
	var subscriberIN2Table = getFormTable("IsthePatienttheSubscriberIN2");
	var subscriberIN3Table = getFormTable("IsthePatienttheSubscriberIN3");
	var subscriberIN4Table = getFormTable("IsthePatienttheSubscriberIN4");	
  	var employerStatusTable = getFormTable("EmploymentStatus");
   
	//if (document.getElementById('BaseNehsAutoForm17_YesNoOption_0').value==1)
	//if (document.getElementById('BaseNehsAutoForm17_YesNoOption_0').getAttribute("clickvalue")==1)
	if(yesNoRadioList[0].getAttribute("clickvalue")==1)
	{	
		document.getElementById('divEmployer').style.display = "none";
		document.getElementById('div1st Emergency Contact (Next of Kin)').style.display = "none";
		document.getElementById('div2nd Emergency Contact (Person to Notify)').style.display = "none";
		document.getElementById('divInsurance Information').style.display = "none";
		
		if (document.getElementById('divInsurance 1'))
		{
		    document.getElementById('divInsurance 1').style.display = "none";
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divInsurance 2'))
		{
		    document.getElementById('divInsurance 2').style.display = "none";
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN2Table.setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divInsurance 3'))
		{
		    document.getElementById('divInsurance 3').style.display = "none";
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN2Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN3Table.setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divInsurance 4'))
		{
		    document.getElementById('divInsurance 4').style.display = "none";
		    
		    subscriberIN1Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN2Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN3Table.setAttribute("PD_isRequiredValue","false");
		    subscriberIN4Table.setAttribute("PD_isRequiredValue","false");
		    
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","false");
		    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN4').setAttribute("PD_isRequiredValue","false");
		}
		
		if (document.getElementById('divGuarantor`s Information'))
		{
		    document.getElementById('divGuarantor`s Information').style.display = "none";
		    getElementByPD_Id("FirstNameGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("LastNameGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("AddressGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("CityGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("StateGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("ZipCodeGU").setAttribute("PD_isRequiredValue","false");
            getElementByPD_Id("RelationshiptoPatientGU").setAttribute("PD_isRequiredValue","false");
		}
		
		
		if (employerStatusTable)
		{
		    //document.getElementById("BaseNehsAutoForm17_EmploymentStatus").setAttribute("PD_isRequiredValue","false");
		    employerStatusTable.setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("NameEmp").setAttribute("PD_isRequiredValue","false");
		  
		}
		
		//if (document.getElementById("BaseNehsAutoForm17_EmploymentStatus"))
		//{
		//   document.getElementById("BaseNehsAutoForm17_EmploymentStatus").setAttribute("PD_isRequiredValue","false");
		//    getElementByPD_Id("NameEmp").setAttribute("PD_isRequiredValue","false");
	    //}
	    
		if (document.getElementById('divAppointment Information'))
		{
		    document.getElementById('divAppointment Information').style.display = "none";
		}	
		
		document.getElementById('formButtonSubmit').style.display = "block";
		//document.getElementById('continue').style.disabled="false";		
				
		if (document.getElementById('mythankDiv'))
		{
		var ni = document.getElementById('continuebutton');
	    var olddiv = document.getElementById('mythankDiv'); 
		ni.removeChild(olddiv); 		
		}
		
		addElementthankyou();
		
		if (document.getElementById('mythankDivemp'))
		{
		    Removerequiredhospital();
			var ni = document.getElementById('continuebutton');
	      		var olddiv = document.getElementById('mythankDivemp'); 
			ni.removeChild(olddiv); 
		}
		
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		//var ageParent = elements[2];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[3];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[4];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[5];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		//var ageParent = elements[6];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[7];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[8];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[9];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[10];		
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[11];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[12];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[13];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[14];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[15];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');		
		
	}	
	//else if (document.getElementById('BaseNehsAutoForm17_YesNoOption_0').getAttribute("clickvalue")==0)
	else if (yesNoRadioList[0].getAttribute("clickvalue")==0)
	{	
		document.getElementById('divEmployer').style.display = "block";
		
		document.getElementById('divlblEmergency').style.display = "block";
		document.getElementById('div1st Emergency Contact (Next of Kin)').style.display = "block";
		document.getElementById('div2nd Emergency Contact (Person to Notify)').style.display = "block";
		document.getElementById('divInsurance Information').style.display = "block";
		//document.getElementById('divInsurance 1').style.display = "block";
		//document.getElementById('divInsurance 2').style.display = "block";
		//document.getElementById('divInsurance 3').style.display = "block";
		//document.getElementById('divInsurance 4').style.display = "block";
		//document.getElementById('divGuarantor`s Information').style.display = "block";
		//document.getElementById('divAppointment Information').style.display = "block";		
		
		if (document.getElementById('formButtonSubmit'))
		{
		    document.getElementById('formButtonSubmit').style.display="none";
		}	
		if (document.getElementById('mythankDiv'))
		{
		    var ni = document.getElementById('continuebutton');
	        var olddiv = document.getElementById('mythankDiv'); 
		    ni.removeChild(olddiv); 		
		}
		if (document.getElementById('mythankDivemp'))
		{
			var ni = document.getElementById('continuebutton');
	      	var olddiv = document.getElementById('mythankDivemp'); 
			ni.removeChild(olddiv); 
		}
		
		labelchange("Hospital",1);
		addElementinsurance();
		addElementtextbeforeemp();
		/*
		if (document.getElementById('bulletlineemp'))
		{
		    document.getElementById('bulletlineemp').innerHTML="";
		    document.getElementById('bulletlineemp').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{		
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('divEmployer');
		    newelement.setAttribute('id', 'bulletlineemp')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		*/
		if (document.getElementById('bulletlineNTK'))
		{
		    document.getElementById('bulletlineNTK').innerHTML="";
		    document.getElementById('bulletlineNTK').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{		
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('divlblEmergency');
		    newelement.setAttribute('id', 'bulletlineNTK')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
		if (document.getElementById('bulletlinePTN'))
		{
		    document.getElementById('bulletlinePTN').innerHTML="";
		    document.getElementById('bulletlinePTN').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{				
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('div2nd Emergency Contact (Person to Notify)');
		    newelement.setAttribute('id', 'bulletlinePTN')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
		if (document.getElementById('bulletlineini'))
		{
		    document.getElementById('bulletlineini').innerHTML="";
		    document.getElementById('bulletlineini').innerHTML ='<div class="bulletClass"></div>';
		}
		else
		{			    
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance Information');
	        newelement.setAttribute('id', 'bulletlineini')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		
	}
	 document.getElementById('continue').src = "/css/images/btnContinue.gif"; 
}

function OptionIN1YesClick()
{
	//alert("Please write java script");
	//getElementByPD_Id('SubscriberFirstNameIN1').disabled="true";
}

function OptionIN1NoClick()
{
	//alert("Please write java script");
	//getElementByPD_Id('SubscriberFirstNameIN1').disabled="false";
}

function checkInsurance()
{
    var insuranceRadioList = getFormRadioButtonList("HowmanyHealthInsurance");
	var employerStatusRadioList = getFormRadioButtonList("EmploymentStatus");
	
	var subscriberIN1Table = getFormTable("IsthePatienttheSubscriberIN1");
	var subscriberIN2Table = getFormTable("IsthePatienttheSubscriberIN2");
	var subscriberIN3Table = getFormTable("IsthePatienttheSubscriberIN3");
	var subscriberIN4Table = getFormTable("IsthePatienttheSubscriberIN4");	
  	 	
	if (insuranceRadioList[0].checked)
	{
	     if(browserSniffer(2, 0))
        {   //ff
        }
        else
        {
		    addElementtextbeforeemp();
	    }	 
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "none";
		document.getElementById('divInsurance 3').style.display = "none";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display="block";
		
		if (document.getElementById('divAppointment Information'))
		{
		    document.getElementById('divAppointment Information').style.display="block";
		}
		
		if (document.getElementById('mythankDivEmp'))
		{
		    var ni = document.getElementById('continuebutton');
	        var olddiv = document.getElementById('mythankDivEmp'); 
		    ni.removeChild(olddiv); 		
		}	
		
		//document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");				 
		subscriberIN1Table.setAttribute("PD_isRequiredValue","true");				 
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		
	
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		//var ageParent = elements[1];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
		}	
	}
	else if (insuranceRadioList[1].checked)
	{	
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "block";
		document.getElementById('divInsurance 3').style.display = "none";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display="block";
		if (document.getElementById('divAppointment Information'))
		{
			document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//document.getElementById('divAppointment Information.').style.display="block";
		//}
        
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","true");
		subscriberIN1Table.setAttribute("PD_isRequiredValue","true");
		subscriberIN2Table.setAttribute("PD_isRequiredValue","true");
		
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		
		if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN2').parentNode.previousSibling.className="";
		}
	}
	else if (insuranceRadioList[2].checked)
	{
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "block";
		document.getElementById('divInsurance 3').style.display = "block";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display="block";
		if (document.getElementById('divAppointment Information'))
		{
		document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//document.getElementById('divAppointment Information.').style.display="block";
		//}
		
	    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","true");
	    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","true");
	    subscriberIN1Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN2Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN3Table.setAttribute("PD_isRequiredValue","true");
	    
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
        
        if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN3').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN3').parentNode.previousSibling.className="";
        }
	}
	else if (insuranceRadioList[3].checked)
	{
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "block";
		document.getElementById('divInsurance 3').style.display = "block";
		document.getElementById('divInsurance 4').style.display = "block";
		document.getElementById('divGuarantor`s Information').style.display="block";
		if (document.getElementById('divAppointment Information'))
		{
		document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//document.getElementById('divAppointment Information.').style.display="block";
		//}
		
		//document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","true");
	    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN4').setAttribute("PD_isRequiredValue","true");
        
        subscriberIN1Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN2Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN3Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN4Table.setAttribute("PD_isRequiredValue","true");
	    
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN4').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN4').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		
        if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN3').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN3').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN4').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN4').parentNode.previousSibling.className="";
        }
	}
	   if (document.getElementById('bulletlineins1'))
	    { 
	        document.getElementById('bulletlineins1').innerHTML="";
	        document.getElementById('bulletlineins1').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {     
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('divInsurance 1');
		    newelement.setAttribute('id', 'bulletlineins1')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		       
	    if (document.getElementById('bulletlineIN2'))
	    { 
	        document.getElementById('bulletlineIN2').innerHTML="";
	        document.getElementById('bulletlineIN2').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance 2');
	        newelement.setAttribute('id', 'bulletlineIN2')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    if (document.getElementById('bulletlineIN3'))
	    { 
	        document.getElementById('bulletlineIN3').innerHTML="";
	        document.getElementById('bulletlineIN3').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance 3');
	        newelement.setAttribute('id', 'bulletlineIN3')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    if (document.getElementById('bulletlineIN4'))
	    { 
	        document.getElementById('bulletlineIN4').innerHTML="";
	        document.getElementById('bulletlineIN4').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance 4');
	        newelement.setAttribute('id', 'bulletlineIN4')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    
	    if (document.getElementById('bulletlineGU'))
	    { 
	       document.getElementById('bulletlineGU').innerHTML="";	      
	       document.getElementById('bulletlineGU').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {   
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divGuarantor`s Information');
	        newelement.setAttribute('id', 'bulletlineGU')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeGU').parentNode.previousSibling.className="";
		}
      
	    
	    //if (document.getElementById('divAppointment Information.'))
	    //{
	    //    if (document.getElementById('bulletlineAII'))
	   //     { 
	   //         document.getElementById('bulletlineAII').innerHTML="";
	    //        document.getElementById('bulletlineAII').innerHTML='<div class="bulletClass"></div>';
	    //   }
	    //    else
	    //    {
		//        var newelement=document.createElement('div');
		//        var oldelement=document.getElementById('divAppointment Information.');
		//       newelement.setAttribute('id', 'bulletlineAII')
		//        newelement.innerHTML ='<div class="bulletClass"></div>';
		//        oldelement.parentNode.insertBefore(newelement,oldelement);
	    //    }
	    //}
	    
    	    if (document.getElementById('divAppointment Information'))
    	    {
    	          var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 		          
		          //var ageParent = elements[2];
		          //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
    	        if (document.getElementById('bulletline'))
    	        { 
    	            document.getElementById('bulletline').innerHTML="";
    	            document.getElementById('bulletline').innerHTML='<div class="bulletClass"></div>';
    	        }
    	        else
    	        {
    		        var newelement=document.createElement('div');
    		        var oldelement=document.getElementById('divAppointment Information');
    		        newelement.setAttribute('id', 'bulletline')
    		        newelement.innerHTML ='<div class="bulletClass"></div>';
    		        oldelement.parentNode.insertBefore(newelement,oldelement);
    	        }
    	    }
	    
        //getElementByPD_Id('PersontoNotify').className = "personToNotify1";
     
        
    if  (insuranceRadioList[0].checked)
    {
        document.getElementById("bulletlineIN2").parentNode.removeChild(document.getElementById("bulletlineIN2"));
		document.getElementById("bulletlineIN3").parentNode.removeChild(document.getElementById("bulletlineIN3"));
		document.getElementById("bulletlineIN4").parentNode.removeChild(document.getElementById("bulletlineIN4"));
	}
	else if  (insuranceRadioList[1].checked)
    {     
		document.getElementById("bulletlineIN3").parentNode.removeChild(document.getElementById("bulletlineIN3"));
		document.getElementById("bulletlineIN4").parentNode.removeChild(document.getElementById("bulletlineIN4"));
    }
    else if  (insuranceRadioList[2].checked)
    {    		
		document.getElementById("bulletlineIN4").parentNode.removeChild(document.getElementById("bulletlineIN4"));
    }
    
	document.getElementById('formButtonSubmit').style.display="block";
	document.getElementById('applicationCont').src = "/css/images/btnContinue.gif";
}

function checkInsurancePre()
{
    var insuranceRadioList = getFormRadioButtonList("HowmanyHealthInsurance");
	var employerStatusRadioList = getFormRadioButtonList("EmploymentStatus");
	
	var subscriberIN1Table = getFormTable("IsthePatienttheSubscriberIN1");
	var subscriberIN2Table = getFormTable("IsthePatienttheSubscriberIN2");
	var subscriberIN3Table = getFormTable("IsthePatienttheSubscriberIN3");
	var subscriberIN4Table = getFormTable("IsthePatienttheSubscriberIN4");	
  	  	
	if (insuranceRadioList[0].checked)
	{	
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "none";
		document.getElementById('divInsurance 3').style.display = "none";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display="block";
		
		if (document.getElementById('divAppointment Information'))
		{
		    document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//    document.getElementById('divAppointment Information.').style.display="block";		
		//}
		
		if (document.getElementById('mythankDivEmp'))
		{
		    var ni = document.getElementById('continuebutton');
	        var olddiv = document.getElementById('mythankDivEmp'); 
		    ni.removeChild(olddiv); 		
		}	
		
		//document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");				 
		subscriberIN1Table.setAttribute("PD_isRequiredValue","true");				 
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		
	
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		//var ageParent = elements[1];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
		}	
	}
	else if (insuranceRadioList[1].checked)
	{	
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "block";
		document.getElementById('divInsurance 3').style.display = "none";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display="block";
		if (document.getElementById('divAppointment Information'))
		{
			document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//document.getElementById('divAppointment Information.').style.display="block";
		//}
        
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","true");
		subscriberIN1Table.setAttribute("PD_isRequiredValue","true");
		subscriberIN2Table.setAttribute("PD_isRequiredValue","true");
		
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		
		if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN2').parentNode.previousSibling.className="";
		}
	}
	else if (insuranceRadioList[2].checked)
	{
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "block";
		document.getElementById('divInsurance 3').style.display = "block";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display="block";
		if (document.getElementById('divAppointment Information'))
		{
		document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//document.getElementById('divAppointment Information.').style.display="block";
		//}
		
	    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","true");
	    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","true");
	    subscriberIN1Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN2Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN3Table.setAttribute("PD_isRequiredValue","true");
	    
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
        
        if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN3').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN3').parentNode.previousSibling.className="";
        }
	}
	else if (insuranceRadioList[3].checked)
	{
		document.getElementById('divInsurance 1').style.display = "block";
		document.getElementById('divInsurance 2').style.display = "block";
		document.getElementById('divInsurance 3').style.display = "block";
		document.getElementById('divInsurance 4').style.display = "block";
		document.getElementById('divGuarantor`s Information').style.display="block";
		if (document.getElementById('divAppointment Information'))
		{
		document.getElementById('divAppointment Information').style.display="block";
		}
		
		//if (document.getElementById('divAppointment Information.'))
		//{
		//document.getElementById('divAppointment Information.').style.display="block";
		//}
		
		//document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN1').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN2').setAttribute("PD_isRequiredValue","true");
	    //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN3').setAttribute("PD_isRequiredValue","true");
        //document.getElementById('BaseNehsAutoForm17_IsthePatienttheSubscriberIN4').setAttribute("PD_isRequiredValue","true");
        
        subscriberIN1Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN2Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN3Table.setAttribute("PD_isRequiredValue","true");
	    subscriberIN4Table.setAttribute("PD_isRequiredValue","true");
	    
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN1').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN2').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN3').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		document.getElementById('lblIsthePatienttheSubscriberIN4').innerHTML="";
		document.getElementById('lblIsthePatienttheSubscriberIN4').innerHTML='<font class="reqAstric">*</font>'+"Is the Patient the Policyholder?";
		
        if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeSUIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN1').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN2').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN3').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN3').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeSUIN4').parentNode.previousSibling.className="";
			document.getElementById('lblZipCodeIN4').parentNode.previousSibling.className="";
        }
	}
	   if (document.getElementById('bulletlineins1'))
	    { 
	        document.getElementById('bulletlineins1').innerHTML="";
	        document.getElementById('bulletlineins1').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {     
		    var newelement=document.createElement('div');
		    var oldelement=document.getElementById('divInsurance 1');
		    newelement.setAttribute('id', 'bulletlineins1')
		    newelement.innerHTML ='<div class="bulletClass"></div>';
		    oldelement.parentNode.insertBefore(newelement,oldelement);
		}
		       
	    if (document.getElementById('bulletlineIN2'))
	    { 
	        document.getElementById('bulletlineIN2').innerHTML="";
	        document.getElementById('bulletlineIN2').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance 2');
	        newelement.setAttribute('id', 'bulletlineIN2')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    if (document.getElementById('bulletlineIN3'))
	    { 
	        document.getElementById('bulletlineIN3').innerHTML="";
	        document.getElementById('bulletlineIN3').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance 3');
	        newelement.setAttribute('id', 'bulletlineIN3')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    if (document.getElementById('bulletlineIN4'))
	    { 
	        document.getElementById('bulletlineIN4').innerHTML="";
	        document.getElementById('bulletlineIN4').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divInsurance 4');
	        newelement.setAttribute('id', 'bulletlineIN4')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    
	    if (document.getElementById('bulletlineGU'))
	    { 
	       document.getElementById('bulletlineGU').innerHTML="";	      
	       document.getElementById('bulletlineGU').innerHTML='<div class="bulletClass"></div>';
	    }
	    else
	    {   
	        var newelement=document.createElement('div');
	        var oldelement=document.getElementById('divGuarantor`s Information');
	        newelement.setAttribute('id', 'bulletlineGU')
	        newelement.innerHTML ='<div class="bulletClass"></div>';
	        oldelement.parentNode.insertBefore(newelement,oldelement);
	    }	
	    
	    if(browserSniffer(2, 0))
		{
			document.getElementById('lblZipCodeGU').parentNode.previousSibling.className="";
		}
      
	    
	    //if (document.getElementById('divAppointment Information.'))
	    //{
	    //    if (document.getElementById('bulletlineAII'))
	   //     { 
	   //         document.getElementById('bulletlineAII').innerHTML="";
	    //        document.getElementById('bulletlineAII').innerHTML='<div class="bulletClass"></div>';
	    //   }
	    //    else
	    //    {
		//        var newelement=document.createElement('div');
		//        var oldelement=document.getElementById('divAppointment Information.');
		//       newelement.setAttribute('id', 'bulletlineAII')
		//        newelement.innerHTML ='<div class="bulletClass"></div>';
		//        oldelement.parentNode.insertBefore(newelement,oldelement);
	    //    }
	    //}
	    
    	    if (document.getElementById('divAppointment Information'))
    	    {
    	          var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 		          
		          var ageParent = elements[2];
		          YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
    	        if (document.getElementById('bulletline'))
    	        { 
    	            document.getElementById('bulletline').innerHTML="";
    	            document.getElementById('bulletline').innerHTML='<div class="bulletClass"></div>';
    	        }
    	        else
    	        {
    		        var newelement=document.createElement('div');
    		        var oldelement=document.getElementById('divAppointment Information');
    		        newelement.setAttribute('id', 'bulletline')
    		        newelement.innerHTML ='<div class="bulletClass"></div>';
    		        oldelement.parentNode.insertBefore(newelement,oldelement);
    	        }
    	    }
	    
        //getElementByPD_Id('PersontoNotify').className = "personToNotify1";
     
        
    if  (insuranceRadioList[0].checked)
    {
        document.getElementById("bulletlineIN2").parentNode.removeChild(document.getElementById("bulletlineIN2"));
		document.getElementById("bulletlineIN3").parentNode.removeChild(document.getElementById("bulletlineIN3"));
		document.getElementById("bulletlineIN4").parentNode.removeChild(document.getElementById("bulletlineIN4"));
	}
	else if  (insuranceRadioList[1].checked)
    {     
		document.getElementById("bulletlineIN3").parentNode.removeChild(document.getElementById("bulletlineIN3"));
		document.getElementById("bulletlineIN4").parentNode.removeChild(document.getElementById("bulletlineIN4"));
    }
    else if  (insuranceRadioList[2].checked)
    {    		
		document.getElementById("bulletlineIN4").parentNode.removeChild(document.getElementById("bulletlineIN4"));
    }
    
	document.getElementById('formButtonSubmit').style.display="block";
	document.getElementById('applicationCont').src = "/css/images/btnContinue.gif"; 
}

function addElementthankyou()
{
	var ni = document.getElementById('continuebutton');
	var newdiv = document.createElement('div'); 
	var divIdName = 'mythankDiv'; 
	newdiv.setAttribute('id',divIdName);
	newdiv.innerHTML = '<span class="cInfo"><label style="padding: 15px 0 15px 0; margin: 0; width: 520px !important; float: left; display: block;">Thank You. No further information is required to request a Hospital Card.</label></span>';
	ni.appendChild(newdiv); 
}

function addElementtextbeforeemp()
{   
    var ni = document.getElementById('continuebutton');
	var newdiv = document.createElement('div'); 
	var divIdName = 'mythankDivemp'; 
	newdiv.setAttribute('id',divIdName);
	newdiv.innerHTML = '<p style="padding: 15px 0 0 0; margin: 0; width: 520px !important; float: left; display: block;">Please complete the remaining sections of this form to ensure medical record accuracy.</p><div class="bulletClass"></div>';
	ni.appendChild(newdiv); 
}

function addElementthankyouPrereg()
{
	var ni = document.getElementById('divAppointment Information');
	var newdiv = document.createElement('div'); 
	var divIdName = 'mythankDiv'; 
	newdiv.setAttribute('id',divIdName);
	newdiv.innerHTML = '<label><br/><br/>Thank You. No further information is required to request a Hospital Card.</label>';
	ni.appendChild(newdiv); 
}
	
function removetableRow(id,row)
{
	document.getElementById(id).deleteRow(row);
} 

function labelchange(form,lvl)
{	

  	var employmentStatusTable = getFormTable("EmploymentStatus");
  	var HowmanyHealthInsuranceTable =getFormTable("HowmanyHealthInsurance");
  	
	if (form=="OnlineDonation")
	{
		document.getElementById('lblNameAck').innerHTML="";
		document.getElementById('lblAddressAck').innerHTML="";
		document.getElementById('lblCityAck').innerHTML="";
		document.getElementById('lblStateAck').innerHTML="";
		document.getElementById('lblZipAck').innerHTML="";

		document.getElementById('lblNameAck').innerHTML='<font class="reqAstric">*</font>'+"Name";
		document.getElementById('lblAddressAck').innerHTML='<font class="reqAstric">*</font>'+"Address";
		document.getElementById('lblCityAck').innerHTML='<font class="reqAstric">*</font>'+"City";
		document.getElementById('lblStateAck').innerHTML='<font class="reqAstric">*</font>'+"State";
		document.getElementById('lblZipAck').innerHTML='<font class="reqAstric">*</font>'+"Zip Code";
	}
	else if (form == "Hospital")
	{
		//Employer
		document.getElementById('lblEmploymentStatus').innerHTML="";	
		document.getElementById('lblEmploymentStatus').innerHTML='<font class="reqAstric">*</font>'+"Employment Status";
		
       // document.getElementById("BaseNehsAutoForm17_EmploymentStatus").setAttribute("PD_isRequiredValue","true");
        employmentStatusTable.setAttribute("PD_isRequiredValue","true"); 
		document.getElementById('lblNameEmp').innerHTML="";
		document.getElementById('lblNameEmp').innerHTML='<font class="reqAstric">*</font>'+"Name";
		getElementByPD_Id("NameEmp").setAttribute("PD_isRequiredValue","true");
	    
	    //ins
	    HowmanyHealthInsuranceTable.setAttribute("PD_isRequiredValue","true"); 
	    document.getElementById('lblHowmanyHealthInsurance').innerHTML="";
	    document.getElementById('lblHowmanyHealthInsurance').innerHTML='<font class="reqAstric">*</font>'+"How many Health Insurance plans are you covered under?";
	    
		//NTK
		document.getElementById('lblFirstNameNTK').innerHTML="";
		document.getElementById('lblFirstNameNTK').innerHTML='<font class="reqAstric">*</font>'+"First Name";
		getElementByPD_Id("FirstNameNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblLastNameNTK').innerHTML="";
		document.getElementById('lblLastNameNTK').innerHTML='<font class="reqAstric">*</font>'+"Last Name";
		getElementByPD_Id("LastNameNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblAddressNTK').innerHTML="";
		document.getElementById('lblAddressNTK').innerHTML='<font class="reqAstric">*</font>'+"Address";
		getElementByPD_Id("AddressNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblCityNTK').innerHTML="";
		document.getElementById('lblCityNTK').innerHTML='<font class="reqAstric">*</font>'+"City";
		getElementByPD_Id("CityNTK").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblStateNTK').innerHTML="";
		document.getElementById('lblStateNTK').innerHTML='<font class="reqAstric">*</font>'+"State";
		getElementByPD_Id("StateNTK").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblZIPNTK').innerHTML="";
		document.getElementById('lblZIPNTK').innerHTML='<font class="reqAstric">*</font>'+"Zip Code";
		getElementByPD_Id("ZIPNTK").setAttribute("PD_isRequiredValue","true");
		
		document.getElementById('lblPhoneNTK').innerHTML="";
		document.getElementById('lblPhoneNTK').innerHTML='<font class="reqAstric">*</font>'+"Phone";
		getElementByPD_Id("PhoneNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblRelationshiptoPatientNTK').innerHTML="";
		document.getElementById('lblRelationshiptoPatientNTK').innerHTML='<font class="reqAstric">*</font>'+"Relationship to Patient";
		getElementByPD_Id("RelationshiptoPatientNTK").setAttribute("PD_isRequiredValue","true");
	
		//PTN
		document.getElementById('lblFirstNamePTN').innerHTML="";
		document.getElementById('lblFirstNamePTN').innerHTML='<font class="reqAstric">*</font>'+"First Name";
		getElementByPD_Id("FirstNamePTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblLastNamePTN').innerHTML="";
		document.getElementById('lblLastNamePTN').innerHTML='<font class="reqAstric">*</font>'+"Last Name";
		getElementByPD_Id("LastNamePTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblAddressPTN').innerHTML="";
		document.getElementById('lblAddressPTN').innerHTML='<font class="reqAstric">*</font>'+"Address";
		getElementByPD_Id("AddressPTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblCityPTN').innerHTML="";
		document.getElementById('lblCityPTN').innerHTML='<font class="reqAstric">*</font>'+"City";
		getElementByPD_Id("CityPTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblStatePTN').innerHTML="";
		document.getElementById('lblStatePTN').innerHTML='<font class="reqAstric">*</font>'+"State";
		getElementByPD_Id("StatePTN").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblZIPPTN').innerHTML="";
		document.getElementById('lblZIPPTN').innerHTML='<font class="reqAstric">*</font>'+"Zip Code";
		getElementByPD_Id("ZIPPTN").setAttribute("PD_isRequiredValue","true");
		
		document.getElementById('lblPhonePTN').innerHTML="";
		document.getElementById('lblPhonePTN').innerHTML='<font class="reqAstric">*</font>'+"Phone";
		getElementByPD_Id("PhonePTN").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblRelationshiptoPatientPTN').innerHTML="";
		document.getElementById('lblRelationshiptoPatientPTN').innerHTML='<font class="reqAstric">*</font>'+"Relationship to Patient";
		getElementByPD_Id("RelationshiptoPatientPTN").setAttribute("PD_isRequiredValue","true");

	}
	else if (form == "PreRegister")
	{
		//Employer
		document.getElementById('lblEmploymentStatus').innerHTML="";	
		document.getElementById('lblEmploymentStatus').innerHTML='<font class="reqAstric">*</font>'+"Employment Status";
		//getElementByPD_Id("EmploymentStatusEMP").setAttribute("PD_isRequiredValue","true");
        employmentStatusTable.setAttribute("PD_isRequiredValue","true");
        //document.getElementById("BaseNehsAutoForm17_EmploymentStatus").setAttribute("PD_isRequiredValue","true");
        
		document.getElementById('lblNameEmp').innerHTML="";
		document.getElementById('lblNameEmp').innerHTML='<font class="reqAstric">*</font>'+"Name";		
		getElementByPD_Id("NameEmp").setAttribute("PD_isRequiredValue","true");
		
		//Ins
	    HowmanyHealthInsuranceTable.setAttribute("PD_isRequiredValue","true"); 
	    document.getElementById('lblHowmanyHealthInsurance').innerHTML="";
	    document.getElementById('lblHowmanyHealthInsurance').innerHTML='<font class="reqAstric">*</font>'+"How many Health Insurance plans are you covered under?";
		
		//NTK
		document.getElementById('lblFirstNameNTK').innerHTML="";
		document.getElementById('lblFirstNameNTK').innerHTML='<font class="reqAstric">*</font>'+"First Name";
		getElementByPD_Id("FirstNameNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblLastNameNTK').innerHTML="";
		document.getElementById('lblLastNameNTK').innerHTML='<font class="reqAstric">*</font>'+"Last Name";
		getElementByPD_Id("LastNameNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblAddressNTK').innerHTML="";
		document.getElementById('lblAddressNTK').innerHTML='<font class="reqAstric">*</font>'+"Address";
		getElementByPD_Id("AddressNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblCityNTK').innerHTML="";
		document.getElementById('lblCityNTK').innerHTML='<font class="reqAstric">*</font>'+"City";
		getElementByPD_Id("CityNTK").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblStateNTK').innerHTML="";
		document.getElementById('lblStateNTK').innerHTML='<font class="reqAstric">*</font>'+"State";
		getElementByPD_Id("StateNTK").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblZIPNTK').innerHTML="";
		document.getElementById('lblZIPNTK').innerHTML='<font class="reqAstric">*</font>'+"Zip Code";
		getElementByPD_Id("ZIPNTK").setAttribute("PD_isRequiredValue","true");
		
		document.getElementById('lblPhoneNTK').innerHTML="";
		document.getElementById('lblPhoneNTK').innerHTML='<font class="reqAstric">*</font>'+"Phone";
		getElementByPD_Id("PhoneNTK").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblRelationshiptoPatientNTK').innerHTML="";
		document.getElementById('lblRelationshiptoPatientNTK').innerHTML='<font class="reqAstric">*</font>'+"Relationship to Patient";
		getElementByPD_Id("RelationshiptoPatientNTK").setAttribute("PD_isRequiredValue","true");
		
		//PTN
		document.getElementById('lblFirstNamePTN').innerHTML="";
		document.getElementById('lblFirstNamePTN').innerHTML='<font class="reqAstric">*</font>'+"First Name";
		getElementByPD_Id("FirstNamePTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblLastNamePTN').innerHTML="";
		document.getElementById('lblLastNamePTN').innerHTML='<font class="reqAstric">*</font>'+"Last Name";
		getElementByPD_Id("LastNamePTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblAddressPTN').innerHTML="";
		document.getElementById('lblAddressPTN').innerHTML='<font class="reqAstric">*</font>'+"Address";
		getElementByPD_Id("AddressPTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblCityPTN').innerHTML="";
		document.getElementById('lblCityPTN').innerHTML='<font class="reqAstric">*</font>'+"City";
		getElementByPD_Id("CityPTN").setAttribute("PD_isRequiredValue","true");
	
		document.getElementById('lblStatePTN').innerHTML="";
		document.getElementById('lblStatePTN').innerHTML='<font class="reqAstric">*</font>'+"State";
		getElementByPD_Id("StatePTN").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblZIPPTN').innerHTML="";
		document.getElementById('lblZIPPTN').innerHTML='<font class="reqAstric">*</font>'+"Zip Code";
		getElementByPD_Id("ZIPPTN").setAttribute("PD_isRequiredValue","true");
		
		document.getElementById('lblPhonePTN').innerHTML="";
		document.getElementById('lblPhonePTN').innerHTML='<font class="reqAstric">*</font>'+"Phone";
		getElementByPD_Id("PhonePTN").setAttribute("PD_isRequiredValue","true");

		document.getElementById('lblRelationshiptoPatientPTN').innerHTML="";
		document.getElementById('lblRelationshiptoPatientPTN').innerHTML='<font class="reqAstric">*</font>'+"Relationship to Patient";
		getElementByPD_Id("RelationshiptoPatientPTN").setAttribute("PD_isRequiredValue","true");
	}
}

function Removerequiredhospital()
{
    //INS
    var employmentStatusTable = getFormTable("EmploymentStatus");
    var HowmanyHealthInsuranceTable =getFormTable("HowmanyHealthInsurance");
    
    HowmanyHealthInsuranceTable.setAttribute("PD_isRequiredValue","false");
    employmentStatusTable.setAttribute("PD_isRequiredValue","false");
    document.getElementById('lblHowmanyHealthInsurance').innerHTML="";
   
	//getElementByPD_Id("EmploymentStatus").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("NameEmp").setAttribute("PD_isRequiredValue","false");
	
	//NTK	
	getElementByPD_Id("FirstNameNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("LastNameNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("AddressNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("CityNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("StateNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("ZIPNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("PhoneNTK").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("RelationshiptoPatientNTK").setAttribute("PD_isRequiredValue","false");

	//PTN
	getElementByPD_Id("FirstNamePTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("LastNamePTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("AddressPTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("CityPTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("StatePTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("ZIPPTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("PhonePTN").setAttribute("PD_isRequiredValue","false");
	getElementByPD_Id("RelationshiptoPatientPTN").setAttribute("PD_isRequiredValue","false");
}

//Hospital end

//Online Donation Related
function showTab(tab)
{
  
	
	
	if (tab==0)
	{
		removerpropertyName('divIndividual Donation');	
		hiderequired(1);
		
	}
	else if (tab==1)
	{
		removerpropertyName('divBusiness/Corporate Donation');
		hiderequired(2);
	}
	else if (tab==2)
	{
		removerpropertyName('divEmployee Donation');	
		hiderequired(3);
	}
	return false;

}

function hiderequired(tab)
{
	//Invidual
	if (tab==1)
	{
		getElementByPD_Id("FirstName1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("LastName1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Address1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("City1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("State1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Zip1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("EMail1").setAttribute("PD_isRequiredValue","true");		
		
		//getElementByPD_Id("TitleBUS").
		getElementByPD_Id("BusinessName").value="";
		getElementByPD_Id("ContactFirstName").value="";
		getElementByPD_Id("ContactLastName").value="";
		getElementByPD_Id("Address2").value="";
		getElementByPD_Id("City2").value="";
		getElementByPD_Id("State2").value="";
		getElementByPD_Id("Zip2").value="";
		getElementByPD_Id("EMail2").value="";
		getElementByPD_Id("phone2").value="";
		
		getElementByPD_Id("EmployeeID").value="";
		getElementByPD_Id("FirstName2").value="";
		getElementByPD_Id("LastName2").value="";
		getElementByPD_Id("Address3").value="";
		getElementByPD_Id("City3").value="";
		getElementByPD_Id("State3").value="";
		getElementByPD_Id("Zip3").value="";
		getElementByPD_Id("EMail3").value="";
		getElementByPD_Id("Phone3").value="";		
	}
	else
	{
		getElementByPD_Id("FirstName1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("LastName1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Address1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("City1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("State1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Zip1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("EMail1").setAttribute("PD_isRequiredValue","false");
	}
	//Business
	if (tab==2)
	{	
	    getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","true");
				
		getElementByPD_Id("FirstName1").value="";
		getElementByPD_Id("LastName1").value="";
		getElementByPD_Id("Address1").value="";
		getElementByPD_Id("City1").value="";
		getElementByPD_Id("State1").value="";
		getElementByPD_Id("Zip1").value="";
		getElementByPD_Id("EMail1").value="";
		getElementByPD_Id("Phone1").value="";
		
		getElementByPD_Id("EmployeeID").value="";
		getElementByPD_Id("FirstName2").value="";
		getElementByPD_Id("LastName2").value="";
		getElementByPD_Id("Address3").value="";
		getElementByPD_Id("City3").value="";
		getElementByPD_Id("State3").value="";
		getElementByPD_Id("Zip3").value="";
		getElementByPD_Id("EMail3").value="";
		getElementByPD_Id("Phone3").value="";
		
	}
	else
	{   
		getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","false");
	}		
	//Employee
	if (tab==3)
	{
		getElementByPD_Id("EmployeeID").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("FirstName2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("LastName2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Address3").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("City3").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("State3").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Zip3").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("EMail3").setAttribute("PD_isRequiredValue","true");
				
		getElementByPD_Id("FirstName1").value="";
		getElementByPD_Id("LastName1").value="";
		getElementByPD_Id("Address1").value="";
		getElementByPD_Id("City1").value="";
		getElementByPD_Id("State1").value="";
		getElementByPD_Id("Zip1").value="";
		getElementByPD_Id("EMail1").value="";
		getElementByPD_Id("Phone1").value="";
		
		getElementByPD_Id("BusinessName").value="";
		getElementByPD_Id("ContactFirstName").value="";
		getElementByPD_Id("ContactLastName").value="";
		getElementByPD_Id("Address2").value="";
		getElementByPD_Id("City2").value="";
		getElementByPD_Id("State2").value="";
		getElementByPD_Id("Zip2").value="";
		getElementByPD_Id("EMail2").value="";
		getElementByPD_Id("phone2").value="";
		
		// Section added for Online Donation page-Employee Tab changes /Feb 02 2010 Elma
		$('.radioTable tr:eq(0)').show();
		$('.radioTable tr:eq(1)').show();
		$('.radioTable tr:eq(2)').hide();
		$('.radioTable tr:eq(3)').hide();
	}
	else
	{
		getElementByPD_Id("EmployeeID").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("FirstName2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("LastName2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Address3").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("City3").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("State3").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Zip3").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("EMail3").setAttribute("PD_isRequiredValue","false");

         // Section added for Online Donation page-Employee Tab changes /Feb 02 2010 Elma
		$('.radioTable tr:eq(0)').hide();
		$('.radioTable tr:eq(1)').hide();
		$('.radioTable tr:eq(2)').show();
		$('.radioTable tr:eq(3)').show();
	}
}

//page onload jscript changes
function enewsletteropen()
{	
	if (document.getElementById('diveNewsletter'))
	{
		removerpropertyName('diveNewsletter');
		changeNewsletterclassName1(document.getElementById("lblAge"));
		changeNewsletterclassName(document.getElementById("lblZIP"));
	}
}

function changeNewsletterclassName(targetElement)
{
    var parent = targetElement.parentNode;
    parent.className="cStateZipBlock";  
    parent.previousSibling.className="";
}

function changeNewsletterclassName1(targetElement)
{
    var parent = targetElement.parentNode;
    parent.className="cStateZipBlock";
}

function BillingEnquiryopen()
{
	if (document.getElementById('divBilling Inquiry'))
	{
		removerpropertyName('divBilling Inquiry');
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		var ageParent = elements[2];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var target = getElementByPD_Id('Billing Questions'); 
		simpleEditorImgRemove(target);
	}	
}

function sendwellwishopen()
{
	if (document.getElementById('divSend a Well Wish'))
	{
		removerpropertyName('divSend a Well Wish');
	}

    var greetingTable = getFormTable("Greeting") 
    var target = getElementByPD_Id('Message'); 
	if (greetingTable)
	{ 
	   removetableRow(greetingTable.id,0);
	   simpleEditorImgRemove(target);
	   
	  // var parenttable=getFormTable("Baby");       	   
	  // parenttable.parentNode.childNodes[2].getElementsByTagName("Input").className="activeChk1";
	   
	   
	   //var WellWishRadioList = getFormRadioButtonList("Greeting");
	  // YAHOO.util.Event.addListener(WellWishRadioList[0], "click", enableBaby);
       //YAHOO.util.Event.addListener(WellWishRadioList[1], "click", disableBaby);
       
	   
	}
}	
function enableBaby()
{
   
    var BabyCheckList = getFormCheckboxListwellwsish("Baby");
    //alert(BabyCheckList);
    
    BabyCheckList[0].diabled=false;
   BabyCheckList[1].diabled=false;
    //alert(getElementByPD_id("Baby").childNode[0]);
}

function disableBaby()
{
    
    var BabyCheckList = getFormCheckboxList("Baby");
    //alert(BabyCheckList);
    BabyCheckList[0].diabled=true;
    BabyCheckList[1].diabled=true;  
}

function simpleEditorImgRemove(targetElement)
{
    var parent = targetElement.parentNode;
    var child0 = targetElement.parentNode.childNodes[0];
    var child1 = targetElement.parentNode.childNodes[1];   
    
    if(browserSniffer(2, 0))
    {   //ff
        parent.removeChild(child1);
    }
    else
    {
        parent.removeChild(child0);
    }
}


function onlinedonationopen()
{ 
    //tabbedSections realClear
    $('.centerLeft').addClass("tabbedSections realClear");
    
    if (document.getElementById('divIndividual Donation'))
	{
	    $('.centerLeft > div:eq(0)').addClass("tabSection");	    
	}
	
	if (document.getElementById('divBusiness/Corporate Donation'))
	{
	    $('.centerLeft > div:eq(1)').addClass("tabSection hide");
	    getElementByPD_Id('State2').className = "state1";
	}
	
	if (document.getElementById('divEmployee Donation'))
	{
	    $('.centerLeft > div:eq(2)').addClass("tabSection hide");	   
	    getElementByPD_Id('State3').className = "state1"; 
	}
	
	var useMemorialCheckboxList = getFormCheckboxList("MemoralGift");
	
	if(useMemorialCheckboxList)	
	{	
	    YAHOO.util.Event.addListener(useMemorialCheckboxList[0], "click", Sendacknowledge);
	   	//clearSearchForm();
		
		if (document.getElementById('divIndividual Donation'))
		{			    
			removerpropertyName('divIndividual Donation');						
            getElementByPD_Id('State1').className = "state1";
			//hiderequired(1);
			
			getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","false");
		    
		    getElementByPD_Id("EmployeeID").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("FirstName2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("LastName2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Address3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("City3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("State3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Zip3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("EMail3").setAttribute("PD_isRequiredValue","false");  
		    					
		}	
		
						
		var RequiredBusinessDiv = document.getElementById("lblTitleBUS");	
		var RequiredEmployeeDiv = document.getElementById("lblTitleEMP");
		var sp1 = document.createElement("span");
				
        //sp1.setAttribute("id", "newSpan");
        if (document.getElementById('divBusiness/Corporate Donation'))
		{
            sp1.className="rField";        
            sp1.innerHTML="<font class='reqAstric'>*</font>Required Fields";		
            insertAfter(sp1,RequiredBusinessDiv);
            insertAfter(sp1.cloneNode(true),RequiredEmployeeDiv);
            changeODclassName(RequiredBusinessDiv);
            changeODclassName(RequiredEmployeeDiv);
        }
        
        if (document.getElementById('divDonation Information (Optional)'))
        {
            var InHonorOfRadioList = getFormRadioButtonList("InHonorOf");
            var InMemoryOfRadioList = getFormRadioButtonList("InMemoryOf");
            YAHOO.util.Event.addListener(InHonorOfRadioList[0], "click", InHonorOfClick);
            YAHOO.util.Event.addListener(InMemoryOfRadioList[0], "click", InMemoryOfClick);
        
            document.getElementById("lblInHonorOf").innerHTML="";
            document.getElementById("lblInMemoryOf").innerHTML="";  
            document.getElementById("lblInHonorOfName").innerHTML="";
            document.getElementById("lblInMemoryOfName").innerHTML="";
            
            if (getElementByPD_Id("InHonorOfName").value != "")
            {
                InHonorOfRadioList[0].checked=true;
                InHonorOfRadioList[0].disabled=false; 
                getElementByPD_Id("InHonorOfName").diabled=false;  
            }
            else
            {
                InHonorOfRadioList[0].checked=false;
                InHonorOfRadioList[0].disabled=true; 
                getElementByPD_Id("InHonorOfName").disabled=true; 
            }
            
            if (getElementByPD_Id("InMemoryOfName").value != "")
            {
                InMemoryOfRadioList[0].checked=true;
                InMemoryOfRadioList[0].disabled=false;
                getElementByPD_Id("InMemoryOfName").disabled=false;
            }
            else
            {
                InMemoryOfRadioList[0].checked=false;
                InMemoryOfRadioList[0].disabled=true;
                getElementByPD_Id("InMemoryOfName").disabled=true;
            }
           
            getElementByPD_Id("InMemoryOfName").parentNode.className="cInfoInMemoryOf";
            getElementByPD_Id("InHonorOfName").parentNode.className="cInfoInHonorOf";
        }  
       
        if (document.getElementById('divIndividual Donation'))
		{	
            if (getElementByPD_Id("FirstName1").value.length > 0)
            {
               showTab(1);
               return false;
            }
            else if (getElementByPD_Id("ContactFirstName").value.length > 0)
            {    
               showTab(2); 
               return false;
            }
            else if (getElementByPD_Id("FirstName2").value.length > 0)
            {
              showTab(3); 
              return false;
            }        
        }
	}	
	
	// Section added for updated to Online Donation page /Nov 03 2009 Elma
	
	/*var memorialhtml =$("#lblMemoralGift").html();
	memorialhtml = "&nbsp;<a id=\"lnkMemGift2\" onmouseover=\"PopUpClicked();ShowMoreInfoPopUpLayer('There are many special occasions to remember those we admire and love-Memorial Day. Mothers Day and Fathres Day, a graduation, birth day, wedding or anniversary. Then there are those times od sorrow when a loved one or friend is lost. To express your admiration and love for a loved one or friend or to remember someone who has died. You may make an honor/memorial gift to Northeast Health Foundation. Not only is your gift a thoughful remembrance, but it will help to ensure excellent choices in healthcare and the ongoing development of innovative programs and services which will be available to you, your family and your neighbours should the need ever arise.', event)\"; ><img width=\"15px\" height=\"15px\" src=\"/css/images/Blue-question-mark.jpg\" /></a>" 
	
	$("#lblMemoralGift").append(memorialhtml);*/
	
	// Section added for Online Donation page-Employee Tab changes /Feb 02 2010 Elma
	$('.radioTable tr:eq(0)').hide();
	$('.radioTable tr:eq(1)').hide();
	$('.radioTable tr:eq(2)').show();
	$('.radioTable tr:eq(3)').show();
	$("h3:contains('Donation Information')").addClass("careShareHeader");	
	var shareText ="<span class=\"careShareHelp\">What is <a href=\"http://www.beverlyhospital.org/giving/ways-to-give/care-2-share---the-employee-giving-campaign\" target=\"_blank\"><b>Care 2 Share</b></a><img height=\"15\" width=\"15\" src=\"/css/images/Blue-question-mark.jpg\" onmouseover=\"PopUpClicked();ShowMoreInfoPopUpLayer('Care 2 Share is the annual employee giving campaign. Your generous donations support the hospital system through the Annual Fund, the local community through United Way, and our employees through Operation Assist. Care 2 Share contributions support Northeast Health System`s mission to provide the highest quality of care to individuals and communities we serve. For more information click <a href=http://www.beverlyhospital.org/giving/ways-to-give/care-2-share---the-employee-giving-campaign target=_blank>here</a>.', event);\" /></span>";
	$(shareText).insertAfter("h3:contains('Donation Information')");
	
	var allTabs = $('#infoContainerOD ul.tabs li');
	var allTabbedSections = $('div.tabbedSections div.tabSection');
	$(allTabs).click( function(){
		$(allTabbedSections).addClass('hide');
		$(allTabs).removeClass('selected');
		var currentTab = $(allTabs).index(this);
		$(allTabbedSections[currentTab]).removeClass('hide');
		$(this).addClass('selected');
		showTab(currentTab);
		return false;
	});
}


	
	
function onlinedonationopen_Orig()
{ 
    
	var useMemorialCheckboxList = getFormCheckboxList("MemoralGift");
	//getElementByPD_Id("InHonorOfName").style.marginTop = "-18px";
	if(useMemorialCheckboxList)	
	{	
	    YAHOO.util.Event.addListener(useMemorialCheckboxList[0], "click", Sendacknowledge);
	   	//clearSearchForm();
		
		if (document.getElementById('divIndividual Donation'))
		{	
			removerpropertyName('divIndividual Donation');
			document.getElementById('divIndividual Donation').style.display = "block";
			document.getElementById('divBusiness/Corporate Donation').style.display = "none";
			document.getElementById('divEmployee Donation').style.display = "none";			
            getElementByPD_Id('State1').className = "state1";
			//hiderequired(1);
			
			getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","false");
		    
		    getElementByPD_Id("EmployeeID").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("FirstName2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("LastName2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Address3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("City3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("State3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Zip3").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("EMail3").setAttribute("PD_isRequiredValue","false");  
		    					
		}
		
		if (document.getElementById('divIndividual Donation'))
		{
		    document.getElementById('divIndividual Donation').className="contactInfo eventDetails tabSection";
		}
		
		if (document.getElementById('divBusiness/Corporate Donation'))
		{
		    document.getElementById('divBusiness/Corporate Donation').className="contactInfo eventDetails tabSection";
		    getElementByPD_Id('State2').className = "state1";
		}
		
		if (document.getElementById('divEmployee Donation'))
		{
		    document.getElementById('divEmployee Donation').className="contactInfo eventDetails tabSection";
		    getElementByPD_Id('State3').className = "state1";
		}
						
		var RequiredBusinessDiv = document.getElementById("lblTitleBUS");	
		var RequiredEmployeeDiv = document.getElementById("lblTitleEMP");
		var sp1 = document.createElement("span");
				
        //sp1.setAttribute("id", "newSpan");
        if (document.getElementById('divBusiness/Corporate Donation'))
		{
            sp1.className="rField";        
            sp1.innerHTML="<font class='reqAstric'>*</font>Required Fields";		
            insertAfter(sp1,RequiredBusinessDiv);
            insertAfter(sp1.cloneNode(true),RequiredEmployeeDiv);
            changeODclassName(RequiredBusinessDiv);
            changeODclassName(RequiredEmployeeDiv);
        }
        
        if (document.getElementById('divDonation Information (Optional)'))
        {
            //getElementByPD_Id("InHonorOfName").disabled=true;
           // getElementByPD_Id("InMemoryOfName").disabled=true;

            var InHonorOfRadioList = getFormRadioButtonList("InHonorOf");
            var InMemoryOfRadioList = getFormRadioButtonList("InMemoryOf");
            YAHOO.util.Event.addListener(InHonorOfRadioList[0], "click", InHonorOfClick);
            YAHOO.util.Event.addListener(InMemoryOfRadioList[0], "click", InMemoryOfClick);
        
            document.getElementById("lblInHonorOf").innerHTML="";
            document.getElementById("lblInMemoryOf").innerHTML="";  
            document.getElementById("lblInHonorOfName").innerHTML="";
            document.getElementById("lblInMemoryOfName").innerHTML="";
            
            if (getElementByPD_Id("InHonorOfName").value != "")
            {
                InHonorOfRadioList[0].checked=true;
                InHonorOfRadioList[0].disabled=false; 
                getElementByPD_Id("InHonorOfName").diabled=false;  
            }
            else
            {
                InHonorOfRadioList[0].checked=false;
                InHonorOfRadioList[0].disabled=true; 
                getElementByPD_Id("InHonorOfName").disabled=true; 
            }
            
            if (getElementByPD_Id("InMemoryOfName").value != "")
            {
                InMemoryOfRadioList[0].checked=true;
                InMemoryOfRadioList[0].disabled=false;
                getElementByPD_Id("InMemoryOfName").disabled=false;
            }
            else
            {
                InMemoryOfRadioList[0].checked=false;
                InMemoryOfRadioList[0].disabled=true;
                getElementByPD_Id("InMemoryOfName").disabled=true;
            }
           
            getElementByPD_Id("InMemoryOfName").parentNode.className="cInfoInMemoryOf";
            getElementByPD_Id("InHonorOfName").parentNode.className="cInfoInHonorOf";
        }  
       
        if (document.getElementById('divIndividual Donation'))
		{	
            if (getElementByPD_Id("FirstName1").value.length > 0)
            {
               showTab(1);
               return false;
            }
            else if (getElementByPD_Id("ContactFirstName").value.length > 0)
            {    
               showTab(2); 
               return false;
            }
            else if (getElementByPD_Id("FirstName2").value.length > 0)
            {
              showTab(3); 
              return false;
            }        
        }
	}	
	
	// Section added for updated to Online Donation page /Nov 03 2009 Elma
	
	/*var memorialhtml =$("#lblMemoralGift").html();
	memorialhtml = "&nbsp;<a id=\"lnkMemGift2\" onmouseover=\"PopUpClicked();ShowMoreInfoPopUpLayer('There are many special occasions to remember those we admire and love-Memorial Day. Mothers Day and Fathres Day, a graduation, birth day, wedding or anniversary. Then there are those times od sorrow when a loved one or friend is lost. To express your admiration and love for a loved one or friend or to remember someone who has died. You may make an honor/memorial gift to Northeast Health Foundation. Not only is your gift a thoughful remembrance, but it will help to ensure excellent choices in healthcare and the ongoing development of innovative programs and services which will be available to you, your family and your neighbours should the need ever arise.', event)\"; ><img width=\"15px\" height=\"15px\" src=\"/css/images/Blue-question-mark.jpg\" /></a>" 
	
	$("#lblMemoralGift").append(memorialhtml);*/
	
	// Section added for Online Donation page-Employee Tab changes /Feb 02 2010 Elma
	$('.radioTable tr:eq(0)').hide();
	$('.radioTable tr:eq(1)').hide();
	$('.radioTable tr:eq(2)').show();
	$('.radioTable tr:eq(3)').show();
	$("h3:contains('Donation Information')").addClass("careShareHeader");	
	var shareText ="<span class=\"careShareHelp\">What is <a href=\"http://www.beverlyhospital.org/giving/ways-to-give/care-2-share---the-employee-giving-campaign\" target=\"_blank\"><b>Care 2 Share</b></a><img height=\"15\" width=\"15\" src=\"/css/images/Blue-question-mark.jpg\" onmouseover=\"PopUpClicked();ShowMoreInfoPopUpLayer('Care 2 Share is the annual employee giving campaign. Your generous donations support the hospital system through the Annual Fund, the local community through United Way, and our employees through Operation Assist. Care 2 Share contributions support Northeast Health System`s mission to provide the highest quality of care to individuals and communities we serve. For more information click <a href=http://www.beverlyhospital.org/giving/ways-to-give/care-2-share---the-employee-giving-campaign target=_blank>here</a>.', event);\" /></span>";
	$(shareText).insertAfter("h3:contains('Donation Information')");
}


function InHonorOfClick()
{
   getElementByPD_Id("InHonorOfName").disabled=false;   
   getElementByPD_Id("InMemoryOfName").value="";
   getElementByPD_Id("InMemoryOfName").disabled=true;
   
   var InMemoryOfRadioList = getFormRadioButtonList("InMemoryOf");
   InMemoryOfRadioList[0].checked=false;   
}

function InMemoryOfClick()
{
   getElementByPD_Id("InMemoryOfName").disabled=false;   
   getElementByPD_Id("InHonorOfName").value="";
   getElementByPD_Id("InHonorOfName").disabled=true; 
   
   var InHonorOfRadioList = getFormRadioButtonList("InHonorOf");
   InHonorOfRadioList[0].checked=false;   
}


function changeODclassName(targetElement)
{
    var parent = targetElement.parentNode;	   
    parent.className="cInfo firstColumn ";
    
}

function insertAfter(newElement,targetElement) 
{	//target is what you want it to go after. Look for this elements parent.	
	var parent = targetElement.parentNode;	
	//if the parents lastchild is the targetElement...
	
	if(parent.lastChild == targetElement) 
	{		    	
		//add the newElement after the target element.		
    	parent.appendChild(newElement);		
    } 
	else if (parent.lastChild != targetElement) 
	{	
	
    	// else the target has siblings, insert the new element between the target and it's next sibling.				
		targetElement.parentNode.insertBefore(newElement, targetElement.nextSibling);		
	}	
}


// method called on load of Hospital Card Form
function hospitalcard()
{
    if(document.getElementById("divPatient Information"))
    { 
        var yesNoRadioList = getFormRadioButtonList("YesNoOption");
        var employmentStatusRadioList = getFormRadioButtonList("EmploymentStatus");
        var usePatientsAddressCheckboxList = getFormCheckboxList("UseSameAddressasPatientsAddress");
        var sameAsNextOfKinCheckboxList = getFormCheckboxList("SameasNextofKin");
        var PatientUnder18YearsAgeRadioList=getFormRadioButtonList("PatientUnder18YearsAge");
        
        var subscriberIN1RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN1");
	    var subscriberIN2RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN2");
	    var subscriberIN3RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN3");
	    var subscriberIN4RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN4");
    	
	    var employerInsuranceIN1RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIN1");
	    var employerInsuranceIN2RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIN2");
	    var employerInsuranceIN3RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIN3");
	    var employerInsuranceIN4RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIn4");
            
        var employmentStatusIN1RadioList = getFormRadioButtonList("EmployementStatusIN1");
        var employmentStatusIN2RadioList = getFormRadioButtonList("EmployementStatusIN2");
        var employmentStatusIN3RadioList = getFormRadioButtonList("EmployementStatusIN3");
        var employmentStatusIN4RadioList = getFormRadioButtonList("EmployementStatusIN4");
        
        var HowmanyHealthInsuranceRadioList = getFormRadioButtonList("HowmanyHealthInsurance");
        
        //var under18YrsCheckboxList = getFormCheckboxList("PatientUnder18YearsAge");
        var whoShouldRecieveBillRadioList = getFormRadioButtonList("Whoshouldreceivebills");
        
        var personToNotifyRadioList = getFormRadioButtonList("PersontoNotify");    
        var othersRadioList = getFormRadioButtonList("Others");   
    
		YAHOO.util.Event.addListener(yesNoRadioList[0],"click",OptionYesClickPreReg);
		YAHOO.util.Event.addListener(yesNoRadioList[1],"click",OptionNoClickPreReg);
		
		YAHOO.util.Event.addListener(employmentStatusRadioList[0], "click", disableInfo);
		YAHOO.util.Event.addListener(employmentStatusRadioList[1], "click", disableInfo);
		YAHOO.util.Event.addListener(employmentStatusRadioList[2], "click", disableInfo);
		
		YAHOO.util.Event.addListener(usePatientsAddressCheckboxList[0], "click", fillInfoKin);
		YAHOO.util.Event.addListener(sameAsNextOfKinCheckboxList[0], "click", fillInfoNotify);
			
		YAHOO.util.Event.addListener(subscriberIN1RadioList[0], "click", searchInsurance1);
		YAHOO.util.Event.addListener(subscriberIN1RadioList[1], "click", searchInsurance1);
		YAHOO.util.Event.addListener(subscriberIN2RadioList[0], "click", searchInsurance2);
		YAHOO.util.Event.addListener(subscriberIN2RadioList[1], "click", searchInsurance2);
		YAHOO.util.Event.addListener(subscriberIN3RadioList[0], "click", searchInsurance3);
		YAHOO.util.Event.addListener(subscriberIN3RadioList[1], "click", searchInsurance3);
		YAHOO.util.Event.addListener(subscriberIN4RadioList[0], "click", searchInsurance4);
		YAHOO.util.Event.addListener(subscriberIN4RadioList[1], "click", searchInsurance4);
		
		YAHOO.util.Event.addListener(employerInsuranceIN1RadioList[0], "click", currEmpInsurance1);
		YAHOO.util.Event.addListener(employerInsuranceIN1RadioList[1], "click", currEmpInsurance1);
		YAHOO.util.Event.addListener(employerInsuranceIN2RadioList[0], "click", currEmpInsurance2);
		YAHOO.util.Event.addListener(employerInsuranceIN2RadioList[1], "click", currEmpInsurance2);
		YAHOO.util.Event.addListener(employerInsuranceIN3RadioList[0], "click", currEmpInsurance3);
		YAHOO.util.Event.addListener(employerInsuranceIN3RadioList[1], "click", currEmpInsurance3);
		YAHOO.util.Event.addListener(employerInsuranceIN4RadioList[0], "click", currEmpInsurance4);
		YAHOO.util.Event.addListener(employerInsuranceIN4RadioList[1], "click", currEmpInsurance4);
		
		YAHOO.util.Event.addListener(employmentStatusIN1RadioList[0], "click", retiredInsurance1);
		YAHOO.util.Event.addListener(employmentStatusIN1RadioList[1], "click", retiredInsurance1);
		YAHOO.util.Event.addListener(employmentStatusIN1RadioList[2], "click", retiredInsurance1);
		
		YAHOO.util.Event.addListener(employmentStatusIN2RadioList[0], "click", retiredInsurance2);
		YAHOO.util.Event.addListener(employmentStatusIN2RadioList[1], "click", retiredInsurance2);
		YAHOO.util.Event.addListener(employmentStatusIN2RadioList[2], "click", retiredInsurance2);
		
		YAHOO.util.Event.addListener(employmentStatusIN3RadioList[0], "click", retiredInsurance3);
		YAHOO.util.Event.addListener(employmentStatusIN3RadioList[1], "click", retiredInsurance3);
		YAHOO.util.Event.addListener(employmentStatusIN3RadioList[2], "click", retiredInsurance3);
		
		YAHOO.util.Event.addListener(employmentStatusIN4RadioList[0], "click", retiredInsurance4);
		YAHOO.util.Event.addListener(employmentStatusIN4RadioList[1], "click", retiredInsurance4);
		YAHOO.util.Event.addListener(employmentStatusIN4RadioList[2], "click", retiredInsurance4);
		guaranterInfo();
		
		//YAHOO.util.Event.addListener(under18YrsCheckboxList[0], "click", gauranterRadioBtn);
		YAHOO.util.Event.addListener(PatientUnder18YearsAgeRadioList[0], "click", gauranterRadioBtn);
        YAHOO.util.Event.addListener(PatientUnder18YearsAgeRadioList[1], "click", gauranterRadioBtn);
		
		YAHOO.util.Event.addListener(whoShouldRecieveBillRadioList[1], "click", gauranterSubscriber);
		YAHOO.util.Event.addListener(whoShouldRecieveBillRadioList[2], "click", gauranterNextKin);
		
		YAHOO.util.Event.addListener(personToNotifyRadioList[0], "click", gauranterPersonNotify);
		YAHOO.util.Event.addListener(othersRadioList[0], "click", gauranterOthers);
		removetableRow(getFormTable("Whoshouldreceivebills").id,0);
		
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[0], "click", insuranceClick);
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[1], "click", insuranceClick);
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[2], "click", insuranceClick);
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[3], "click", insuranceClick);
		
		//var PersontoNotifyTable = getFormTable("PersontoNotify");
		//PersontoNotifyTable.className = "personToNotifyGU";
		document.getElementById("lblSubscribersSocialSecurityNumber").style.marginTop = "-12px";
		document.getElementById("lblGuarantorsSocialSecurityNumber").style.marginTop = "-12px";
		document.getElementById("lblFirstNameGU").style.marginTop = "-12px";
	    getFormTable("PersontoNotify").style.marginTop = "15px";
	    getFormTable("Others").style.marginTop = "15px";
				
		if (document.getElementById('divEmployer'))
		{
		addElement();
		document.getElementById('divEmployer').style.display = "none";
		document.getElementById('divlblEmergency').style.display = "none";
		document.getElementById('div1st Emergency Contact (Next of Kin)').style.display = "none";
		document.getElementById('div2nd Emergency Contact (Person to Notify)').style.display = "none";
		document.getElementById('divInsurance Information').style.display = "none";
		document.getElementById('divInsurance 1').style.display = "none";
		document.getElementById('divInsurance 2').style.display = "none";
		document.getElementById('divInsurance 3').style.display = "none";
		document.getElementById('divInsurance 4').style.display = "none";
		document.getElementById('divGuarantor`s Information').style.display = "none";
		//document.getElementById('divAppointment Information').style.display = "none";	
		document.getElementById('formButtonSubmit').style.display="none";
	
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		var ageParent = elements[11];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		
		var perToNotfiy = document.getElementById('lblPersontoNotify');
		var perToNotfiyParent = perToNotfiy.parentNode;
		perToNotfiyParent.removeChild(perToNotfiy);
		
		var otherChild = document.getElementById('lblOthers');
		var otherParent = otherChild.parentNode;
		otherParent.removeChild(otherChild);
		
	
		
		}
		
		var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		//var ageParent = elements[2];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[3];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[4];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[5];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		//var ageParent = elements[6];
		//YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[7];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[8];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[9];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[10];		
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[11];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[12];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[13];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		var ageParent = elements[14];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		var ageParent = elements[15];
		YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');		
					
		document.getElementById('divGuarantor`s Information').childNodes[0].innerHTML="Guarantor's Information";
		document.getElementById('lblPatientUnder18YearsAge').parentNode.className="";
    	document.getElementById('lblPatientUnder18YearsAge').className="cinfolbl";
    	  
	}	
}

// Method called on Load of Pres Regiatration form
function preregistration()
{
    if(document.getElementById("divPatient Information"))
    { 
        var yesNoRadioList = getFormRadioButtonList("YesNoOption");
        var employmentStatusRadioList = getFormRadioButtonList("EmploymentStatus");
        var usePatientsAddressCheckboxList = getFormCheckboxList("UseSameAddressasPatientsAddress");
        var sameAsNextOfKinCheckboxList = getFormCheckboxList("SameasNextofKin");
        var PatientUnder18YearsAgeRadioList=getFormRadioButtonList("PatientUnder18YearsAge");
        
        var subscriberIN1RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN1");
	    var subscriberIN2RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN2");
	    var subscriberIN3RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN3");
	    var subscriberIN4RadioList = getFormRadioButtonList("IsthePatienttheSubscriberIN4");
    	
	    var employerInsuranceIN1RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIN1");
	    var employerInsuranceIN2RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIN2");
	    var employerInsuranceIN3RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIN3");
	    var employerInsuranceIN4RadioList = getFormRadioButtonList("IsthisInsurancefromyourcurrentEmployerIn4");
         
        var employmentStatusIN1RadioList = getFormRadioButtonList("EmployementStatusIN1");
        var employmentStatusIN2RadioList = getFormRadioButtonList("EmployementStatusIN2");
        var employmentStatusIN3RadioList = getFormRadioButtonList("EmployementStatusIN3");
        var employmentStatusIN4RadioList = getFormRadioButtonList("EmployementStatusIN4");
        
        var HowmanyHealthInsuranceRadioList = getFormRadioButtonList("HowmanyHealthInsurance");
        YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[0], "click", insuranceClick);
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[1], "click", insuranceClick);
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[2], "click", insuranceClick);
		YAHOO.util.Event.addListener(HowmanyHealthInsuranceRadioList[3], "click", insuranceClick);
        
        //var under18YrsCheckboxList = getFormCheckboxList("PatientUnder18YearsAge");
        
        
        var whoShouldRecieveBillRadioList = getFormRadioButtonList("Whoshouldreceivebills");    
        var personToNotifyRadioList = getFormRadioButtonList("PersontoNotify");    
        var othersRadioList = getFormRadioButtonList("Others"); 
        
        var IsyourappointmentduetoaninjuryRadioList = getFormRadioButtonList("Isyourappointmentduetoaninjury")   
        getElementByPD_Id("IfyeswhatType").disabled="true";
        
		    //YAHOO.util.Event.addListener(yesNoRadioList[0],"click",OptionYesClickPreReg);
		    //YAHOO.util.Event.addListener(yesNoRadioList[1],"click",OptionNoClickPreReg);
		    
		    YAHOO.util.Event.addListener(IsyourappointmentduetoaninjuryRadioList[0],"click",OptionAppointmentClick);
    		YAHOO.util.Event.addListener(IsyourappointmentduetoaninjuryRadioList[1],"click",OptionAppointmentClick);
    		
		    YAHOO.util.Event.addListener(employmentStatusRadioList[0], "click", disableInfo);
		    YAHOO.util.Event.addListener(employmentStatusRadioList[1], "click", disableInfo);
		    YAHOO.util.Event.addListener(employmentStatusRadioList[2], "click", disableInfo);
    		
		    YAHOO.util.Event.addListener(usePatientsAddressCheckboxList[0], "click", fillInfoKin);
		    YAHOO.util.Event.addListener(sameAsNextOfKinCheckboxList[0], "click", fillInfoNotify);
    		
    		
		    YAHOO.util.Event.addListener(subscriberIN1RadioList[0], "click", searchInsurance1);
		    YAHOO.util.Event.addListener(subscriberIN1RadioList[1], "click", searchInsurance1);
		    YAHOO.util.Event.addListener(subscriberIN2RadioList[0], "click", searchInsurance2);
		    YAHOO.util.Event.addListener(subscriberIN2RadioList[1], "click", searchInsurance2);
		    YAHOO.util.Event.addListener(subscriberIN3RadioList[0], "click", searchInsurance3);
		    YAHOO.util.Event.addListener(subscriberIN3RadioList[1], "click", searchInsurance3);
		    YAHOO.util.Event.addListener(subscriberIN4RadioList[0], "click", searchInsurance4);
		    YAHOO.util.Event.addListener(subscriberIN4RadioList[1], "click", searchInsurance4);
    		
		    YAHOO.util.Event.addListener(employerInsuranceIN1RadioList[0], "click", currEmpInsurance1);
		    YAHOO.util.Event.addListener(employerInsuranceIN1RadioList[1], "click", currEmpInsurance1);
		    YAHOO.util.Event.addListener(employerInsuranceIN2RadioList[0], "click", currEmpInsurance2);
		    YAHOO.util.Event.addListener(employerInsuranceIN2RadioList[1], "click", currEmpInsurance2);
		    YAHOO.util.Event.addListener(employerInsuranceIN3RadioList[0], "click", currEmpInsurance3);
		    YAHOO.util.Event.addListener(employerInsuranceIN3RadioList[1], "click", currEmpInsurance3);
		    YAHOO.util.Event.addListener(employerInsuranceIN4RadioList[0], "click", currEmpInsurance4);
		    YAHOO.util.Event.addListener(employerInsuranceIN4RadioList[1], "click", currEmpInsurance4);
    		
		    YAHOO.util.Event.addListener(employmentStatusIN1RadioList[0], "click", retiredInsurance1);
		    YAHOO.util.Event.addListener(employmentStatusIN1RadioList[1], "click", retiredInsurance1);
		    YAHOO.util.Event.addListener(employmentStatusIN1RadioList[2], "click", retiredInsurance1);
    		
		    YAHOO.util.Event.addListener(employmentStatusIN2RadioList[0], "click", retiredInsurance2);
		    YAHOO.util.Event.addListener(employmentStatusIN2RadioList[1], "click", retiredInsurance2);
		    YAHOO.util.Event.addListener(employmentStatusIN2RadioList[2], "click", retiredInsurance2);
    		
		    YAHOO.util.Event.addListener(employmentStatusIN3RadioList[0], "click", retiredInsurance3);
		    YAHOO.util.Event.addListener(employmentStatusIN3RadioList[1], "click", retiredInsurance3);
		    YAHOO.util.Event.addListener(employmentStatusIN3RadioList[2], "click", retiredInsurance3);
    		
		    YAHOO.util.Event.addListener(employmentStatusIN4RadioList[0], "click", retiredInsurance4);
		    YAHOO.util.Event.addListener(employmentStatusIN4RadioList[1], "click", retiredInsurance4);
		    YAHOO.util.Event.addListener(employmentStatusIN4RadioList[2], "click", retiredInsurance4);
		    guaranterInfo();
    		
		    //YAHOO.util.Event.addListener(under18YrsCheckboxList[0], "click", gauranterRadioBtn);
		    
		    YAHOO.util.Event.addListener(PatientUnder18YearsAgeRadioList[0], "click", gauranterRadioBtn);
		    YAHOO.util.Event.addListener(PatientUnder18YearsAgeRadioList[1], "click", gauranterRadioBtn);
		    
		    
		    YAHOO.util.Event.addListener(whoShouldRecieveBillRadioList[1], "click", gauranterSubscriber);
		    YAHOO.util.Event.addListener(whoShouldRecieveBillRadioList[2], "click", gauranterNextKin);
    		
		    YAHOO.util.Event.addListener(personToNotifyRadioList[0], "click", gauranterPersonNotify);
		    YAHOO.util.Event.addListener(othersRadioList[0], "click", gauranterOthers);
    		
    		document.getElementById("lblSubscribersSocialSecurityNumber").style.marginTop = "-12px";
			document.getElementById("lblGuarantorsSocialSecurityNumber").style.marginTop = "-12px";
			document.getElementById("lblFirstNameGU").style.marginTop = "-12px";
		    getFormTable("PersontoNotify").style.marginTop = "15px";
		    getFormTable("Others").style.marginTop = "15px";
			//alert(getFormTable("PersontoNotify").style.)
		    removetableRow(getFormTable("Whoshouldreceivebills").id,0);
           
		    //document.getElementById('divEmployer').style.display = "none";		
		    ////document.getElementById('divAppointment Information').style.display = "none";
		    //document.getElementById('div1st Emergency Contact (Next of Kin)').style.display = "none";
		    //document.getElementById('div2nd Emergency Contact (Person to Notify)').style.display = "none";
		    //document.getElementById('divInsurance Information').style.display = "none";
		    document.getElementById('divInsurance 1').style.display = "none";
		    document.getElementById('divInsurance 2').style.display = "none";
		    document.getElementById('divInsurance 3').style.display = "none";
		    document.getElementById('divInsurance 4').style.display = "none";
		    document.getElementById('divGuarantor`s Information').style.display = "none";
		    //document.getElementById('divAppointment Information.').style.display = "none";
		    document.getElementById('formButtonSubmit').style.display="none";
    				
		    var elements = YAHOO.util.Dom.getElementsByClassName('bulletClass'); 
		    //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    //var ageParent = elements[2];
		    //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    //var ageParent = elements[3];
		    //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    //var ageParent = elements[4];
		    //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    //var ageParent = elements[5];
		    //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		    //var ageParent = elements[6];
		    //YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		    //var ageParent = elements[7];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		    var ageParent = elements[8];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    var ageParent = elements[9];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
		    var ageParent = elements[10];		
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    var ageParent = elements[11];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    var ageParent = elements[12];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    var ageParent = elements[13];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    var ageParent = elements[14];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');		
		    var ageParent = elements[15];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');	
            var ageParent = elements[16];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
             var ageParent = elements[17];
		    YAHOO.util.Dom.removeClass(ageParent, 'bulletClass');
		    addElementinsurancePre();
    		
		    var perToNotfiy = document.getElementById('lblPersontoNotify');
		    var perToNotfiyParent = perToNotfiy.parentNode;
		    perToNotfiyParent.removeChild(perToNotfiy);
    		
		    var otherChild = document.getElementById('lblOthers');
		    var otherParent = otherChild.parentNode;
		    otherParent.removeChild(otherChild);
    		
    		addElementPreRegister();
    		document.getElementById('divGuarantor`s Information').childNodes[0].innerHTML="Guarantor's Information ";    		
    		document.getElementById('lblPatientUnder18YearsAge').parentNode.className="";
    		document.getElementById('lblPatientUnder18YearsAge').className="cinfolbl";  
    		
    }	
}

// Thiru
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

function ShowEmailPage(url)
{
	var sUrl = document.URL;
	var objWindow = launchCenter( url + "?parentUrl="+sUrl, "Email", 700, 900, "yes", "yes");

}

function getQueryString(key)
{
  var pair = "";
  var pageURL = location.search;
  var indexOfQuestionMark = pageURL.indexOf("?");
  if(indexOfQuestionMark!=-1)
  {
      var queryString = pageURL.substring(indexOfQuestionMark);
      var indexOfKey = queryString.indexOf(key);
      if(indexOfKey!=-1)
      {
        var indexOfAmper = queryString.indexOf("&", indexOfKey);
        if(indexOfAmper==-1)
            pair = queryString.substring(indexOfKey+key.length+1);
        else
            pair = queryString.substring(indexOfKey+key.length+1, indexOfAmper);
      }
  }
  return pair;
}


function addContactUsListener()
{
    if (document.getElementById("divGENERAL INQUIRIES"))
    {
        YAHOO.util.Event.addListener(getElementByPD_Id("Attention"),"change",setEmail);
        document.getElementById('lblEMailList').style.display="none";
        getElementByPD_Id("EMailList").style.display="none";
    }
}

function setEmail()
{
//alert(getElementByPD_Id("Attention").selectedIndex);
//alert(getElementByPD_Id("EMailList").options[getElementByPD_Id("Attention").selectedIndex]);
getElementByPD_Id("EMail").value = getElementByPD_Id("EMailList").options[getElementByPD_Id("Attention").selectedIndex].text;
//alert(getElementByPD_Id("EMail").value);
}

function setZipAgeInForm()
{
	if(document.getElementById("lblAge"))
	{
		var ageParent = document.getElementById("lblAge").parentNode;
		var zipParent = document.getElementById("lblZIP").parentNode;
		//ageParent.className = ageParent.className.replace("cInfo", "cStateZipBlock");
		//zipParent.className = zipParent.className.replace("cInfo", "cStateZipBlock");
		if(browserSniffer(1, 0))
			zipParent.previousSibling.className = "";
		else
			//ageParent.parentNode.removeChild(ageParent.previousSibling);
		YAHOO.util.Dom.removeClass(ageParent, 'cInfo');
		YAHOO.util.Dom.removeClass(zipParent, 'cInfo');
		YAHOO.util.Dom.addClass(ageParent, 'cStateZipBlock' );
		YAHOO.util.Dom.addClass(zipParent, 'cStateZipBlock' );
	}
	
}

function setStateZipInForm()
{
	var zipNames = new Array("lblZipPI","lblZIP","lblZip1","lblZip2","lblZip3","lblZipAck","lblZIPEMP","lblZIPNTK","lblZIPPTN","lblZIPCodeSUIN1","lblZIPCodeIN1","lblZIPCodeSUIN2","lblZIPCodeIN2","lblZIPCodeSUIN3","lblZIPCodeIN3","lblZIPCodeSUIN4","lblZIPCodeIN4","lblZIPGU","lblZipCodePI","lblZipCodeEMP","lblZipCodeNTK","lblZipCodePTN","lblZIPCodeSUBIN1","lblZIPCodeSUBIN2","lblZIPCodeSUBIN3","lblZIPCodeSUBIN4","lblZIpCodeGU");
	for(key in zipNames)
	{

	if(document.getElementById(zipNames[key])){
		var spanZip = document.getElementById(zipNames[key]).parentNode;
		YAHOO.util.Dom.replaceClass(spanZip, 'cInfo', 'cStateZipBlock'); 
		spanZip.parentNode.removeChild(spanZip.previousSibling);
	}
	}
}


function setStateZipInForm1()
{
		if (document.getElementById("lblZIP"))
		{
		var lblZip = document.getElementById("lblZIP").parentNode;
		YAHOO.util.Dom.replaceClass(lblZip, 'cInfo', 'cStateZipBlock');
//		lblZip.parentNode.removeChild(lblZip.previousSibling);
		}
		var queryStringVar = window.location.search.substring(1);
		var queryStr = queryStringVar.split("=")
		if (queryStr[1] == 1721)
		{
			document.ctl03.appType[0].checked = true;
		}
		else if (queryStr[1] == 1716)
		{
			document.ctl03.appType[1].checked = true;
		}	
		
}

function setSendAWellWishForm()
{
	if (document.getElementById("lblBaby"))
	{
	var lblBabyParent = document.getElementById("lblBaby").parentNode;
	var lblBabyParentCloned = lblBabyParent.cloneNode(true);
	lblBabyParent.parentNode.removeChild(lblBabyParent);

	var greetingTable="";
	
	var greetingElements = YAHOO.util.Dom.getElementsByClassName('Greeting'); 
	
	for(i=0;i<greetingElements.length;i++)
	{
		greetingTable=greetingElements[i];
	}
		
	var newTd1 = document.createElement("td");
	newTd1.appendChild(lblBabyParentCloned);
	
	var newTd2 = document.createElement("td");
	greetingTable.getElementsByTagName("tr")[0].appendChild(newTd1)
	greetingTable.getElementsByTagName("tr")[1].appendChild(newTd2);	
	
	document.getElementById("lblBaby").style.display = "none";	
	}	
}

function showHideHealthAssessmentContent()
{
	var mode="";
	var elements = YAHOO.util.Dom.getElementsByClassName('mode'); 

	for(i=0;i<elements.length;i++)
	{
		mode=elements[i].value;
		elements[i].style.display="none";
		if(mode!="Question")
		{
			var _formDocument; 
			if (document.getElementById("hsSignUpFrame").contentDocument)             
                		_formDocument = document.getElementById("hsSignUpFrame").contentDocument;            
		        else
			    _formDocument = document.frames["hsSignUpFrame"].document;
			
			_formDocument.getElementById("Subscribe").style.display = "Block";
		}

	}

}

function showQuiz()
{
	document.getElementById("Subscribe1").style.display="block";
	return false;
}


function addCancelButtonToSignMeUpForm()
{
if(document.getElementById("lblAge")){
		var buttonTable="";
	var greetingElements = YAHOO.util.Dom.getElementsByClassName('imageText'); 

	for(i=0;i<greetingElements.length;i++){
		buttonTable=greetingElements[i];
	}
	
	var newTd1 = document.createElement("td");
	newTd1.innerHTML = '<input type="image" onclick="ClearenewletterValues(); return false;" name="Cancel" id="cancel" src="/css/images/btnCancel.gif" class="cancelH">'; 

	buttonTable.getElementsByTagName("tr")[0].appendChild(newTd1)
	
		//YAHOO.util.Dom.replaceClass(lblZip, 'cInfo', 'cStateZipBlock');
//		lblZip.parentNode.removeChild(lblZip.previousSibling);
	
	}
}

function ClearenewletterValues()
{
 if(document.getElementById("lblAge"))
 {   
    getElementByPD_Id("FirstName").value="";
    getElementByPD_Id("LastName").value="";
    getElementByPD_Id("EMail").value="";
    getElementByPD_Id("Age").options[0].selected = true;
    getElementByPD_Id("ZIP").value="";
    getElementByPD_Id("CompanyName").value="";
    return false;
 }
}


/// generic

function getFormRadioButtonList(tableName)
{
    var tables = document.getElementsByTagName("table");  
    var radioList= new Array();
    var counter=0;
    for(i=0;i<tables.length;i++)
    {    
       //RemoveErrorHightLighting(document.getElementById("lbl" + oItems[i]))             
       if(checkCustomAttribute(tables[i],"pd_id",tableName))
	   { 
	     //IsthisInsurancefromyourcurrentEmployerIN4	     
	     var childObjects = new Array();		     
	     GetAllRecursiveChildObjects(tables[i], "INPUT", null, null, childObjects)
	     for(j=0;j<=childObjects.length;j++)
	     {  
	        if(childObjects)
	        {	           
               var obj = childObjects[j]  
               if(obj)
                {  
                    // Check all the radio buttons in this group     
                    var radioBoxes = document.getElementsByName(obj.name)                     
                    return radioBoxes;                    
                }
            }            
         }
	   }
	}
	return null;
}

function getFormCheckboxList(sName)
{
    var allCheckBoxes = YAHOO.util.Dom.getElementsByClassName("activeChk")    
    var checkBoxList = new Array();
    var id= new String();    
    var counter=0;
   
    for(i=0;i<allCheckBoxes.length;i++)
    {       
       id =allCheckBoxes[i].id;   
       if(id.indexOf(sName,0)>0) 
       {         
         checkBoxList[counter] = allCheckBoxes[i];
         counter++;         
       } 
	}	
	return checkBoxList;	
}

function getFormCheckboxListwellwsish(sName)
{
    var allCheckBoxes = YAHOO.util.Dom.getElementsByClassName("activeChk1")    
    //alert(allCheckBoxes);
    var checkBoxList = new Array();
    var id= new String();    
    var counter=0;
   
    for(i=0;i<allCheckBoxes.length;i++)
    {       
       id =allCheckBoxes[i].id;   
       if(id.indexOf(sName,0)>0) 
       {         
         checkBoxList[counter] = allCheckBoxes[i];
         counter++;         
       } 
	}	
	return checkBoxList;	
}



function getFormTable(tableName)
{
    var tables = document.getElementsByTagName("table");  
    var checkBoxList = new Array();
    var counter=0;
    for(i=0;i<tables.length;i++)
    {  
       if(checkCustomAttribute(tables[i],"pd_id",tableName))
	   { 
	     return tables[i];
	   }
	}
	return null;
}

function addTextGeneralBlock()
{
    if (document.getElementById("divGENERAL INQUIRIES"))
    {       
        document.getElementById("lblFirstName").parentNode.parentNode.innerHTML = "<p class=\"generalInq\">This email form is to be used to submit NON-HEALTH RELATED QUESTIONS. If you have a health concern or are inquiring about the results of a test or procedure, please call your doctor's office. If you do not have your doctor's phone number readily available, please use the <a href=\"/find-a-doctor.aspx\">Find a Doctor</a> section on this Web site.</p><div class\"clearFix\"></div>" + document.getElementById("lblFirstName").parentNode.parentNode.innerHTML;
    }
}

function contactUSRemove()
{
   if (document.getElementById("divGENERAL INQUIRIES"))
   {   
        changeNewsletterclassName1(document.getElementById("lblAge"));
		changeNewsletterclassName(document.getElementById("lblZIP"));   
   }
}

function removeDivTag()
{	
	if (document.getElementById('divEmail This Page'))
	{
		removerpropertyName('divEmail This Page');
	}
}


///end of generic


// For Event Maintainence - Added to remove the buttons above the simple editor - Elma

function HideSimpleEditorSection()
{
	var target = getElementByPD_Id('description'); 
	simpleEditorImgRemove(target);

	target = getElementByPD_Id('fullDescription'); 
	simpleEditorImgRemove(target);

    target = getElementByPD_Id('confirmation'); 
	simpleEditorImgRemove(target);
}
// End of Event Maintainence


// For Contact Us form - Disable state dropdown in case country is not USA
function CheckStateDropDown(countryDropdown)
{
    
    var state = getElementByPD_Id('state');     
    
    if(state && countryDropdown)
    {        
      
      var position = countryDropdown.value.indexOf("United States");      



      if(position>-1)
      {
        state.disabled=false;
        state.setAttribute("PD_isRequiredValue","true");
      }      
      else
      {
	state.value="";		
        state.disabled=true;
        state.setAttribute("PD_isRequiredValue","false");
	RemoveErrorHightLighting(state)
      }
    }
}
// End of Contact us form function




// RSVP Functions

function RSVPFormLoad()
{
    $(document).ready(function(){   
    var parent = document.getElementById("divATTENDEE");
    if(parent)
    {
    var child0 = parent.childNodes[0];
    child0.innerHTML = "";
    var elements = $(".imageText");	
   //class="imageText" cellspacing="0" cellpadding="0" border="0"
    
    var newText = elements[0].innerHTML.replace(/formButtonSubmit/,"rsvpformButtonSubmit");
    document.getElementById('formButtonSubmit').style.cssText ="height:auto !important;	padding-bottom:15px;padding-top:15px;width:100px !important;" ;
    //var newSection=document.createElement('table');
    //newSection.setAttribute('id', 'rsvpButtonTable')
	//newSection.setAttribute('class', 'imageText')
	//newSection.setAttribute('cellspacing', '0')
	//newSection.setAttribute('cellpadding', '0')
	//newSection.setAttribute('border', '0')
	
	
	//var elements = $(".bulletClass");
    //elements[1].parentNode.insertBefore(newSection,elements[1]);
    //$("#rsvpButtonTable").html(newText);
    }
    //newSection.innerHTML = newText;
    //var elements = $("input:checked")
    //if(elements.length > 0)
   // {
    //    var val = elements[0].value;
    //    if(val.indexOf("CONVERSATIONS") > -1)
    //       AddRSVPHeaderText()
    //}
   });
}
function RSVPTypesChanged(curObj,objName)
{
  var objSelected =document.getElementById(objName);
  var val=curObj.value;
  objSelected.value="";
  if( val !="")             
        objSelected.value= val;
        
  if(val.indexOf("CONVERSATIONS") > -1)
    AddRSVPHeaderText()
  else
  {    
        var parent = document.getElementById("divATTENDEE");
        var olddiv = document.getElementById("rsvpHeaderSection"); 
		if(olddiv)
		{    //parent.removeChild(olddiv); 
		    olddiv.style.display= "none";
		}
    }  
}


function AddRSVPHeaderText()
{
    
    var parent = document.getElementById("divATTENDEE");
    var newelement = document.getElementById("rsvpHeaderSection");
    var child0 = parent.childNodes[0];
   
    if(!newelement)
    {   
       newelement = document.createElement('p');
	
	    newelement.setAttribute('id', 'rsvpHeaderSection')	    
	    var newText = "Hear cancer specialists from Beverly and Addison Gilbert hospitals and Beth Israel Deaconess Medical Center discuss the latest advances in cancer treatments.  A buffet dinner with your choice of fish or chicken will be provided.  Free parking. <br/>" 
            newText+="<b>Note:</b> This event has limited capacity.  By registering we will hold a space for you at Conservations on Cancer's Changing Landscape, to be held at Tuesday, October 6, 2009 at 5:30 PM at the Peabody Marriott Hotel.  We look forward to seeing you there."
        newelement.innerHTML = newText;
       
	    child0.parentNode.insertBefore(newelement,child0);
	
	    //var child1 = parent.childNodes[0];
    } 
    else
        newelement.style.display= "block";
    
}

// END of RSVP Functions


/* Start of Tapestry online doantion functions */

function LoadTapestryForm()
{    
        //Set the width if the more info popup
        var divArray = $(".addiInfoPopup")
                        .css("width", "400px");
        // Increase the font size of the Donation Information section titles
        	$("#lblCareDescription").wrapInner("<h3></h3>");
		$("#lblCaregiverName").wrapInner("<h3></h3>");
        
        $('.centerLeft').addClass("tabbedSections realClear");    
        if (document.getElementById('divIndividual Donation'))
	    {
	        $('.centerLeft > div:eq(0)').addClass("tabSection");	    
	    }
	
	    if (document.getElementById('divBusiness/Corporate Donation'))
	    {
	        $('.centerLeft > div:eq(1)').addClass("tabSection hide");
	        getElementByPD_Id('State2').className = "state1";
	    }	
	
				
		if (document.getElementById('divIndividual Donation'))
		{	
			removerpropertyName('divIndividual Donation');
			
			
            getElementByPD_Id('State1').className = "state1";
			
			getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","false");
		    getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","false");
		}
		
		
		var RequiredBusinessDiv = document.getElementById("lblTitleBUS");	
		var sp1 = document.createElement("span");
		if (document.getElementById('divBusiness/Corporate Donation'))
		{
            sp1.className="rField";        
            sp1.innerHTML="<font class='reqAstric'>*</font>Required Fields";		
            insertAfter(sp1,RequiredBusinessDiv);            
            changeODclassName(RequiredBusinessDiv);            
        }
        
        if (document.getElementById('divDonation Information (Optional)'))
        {
            //some formatting here if required
        }  
       
        if (document.getElementById('divIndividual Donation'))
		{	
            if (getElementByPD_Id("FirstName1").value.length > 0)
            {
               showTapestryTab(0);
               return false;
            }
            else if (getElementByPD_Id("ContactFirstName").value.length > 0)
            {    
               showTapestryTab(1); 
               return false;
            }                   
        }
		
		var allTabs = $('#infoContainerOD ul.tabs li');
	    var allTabbedSections = $('div.tabbedSections div.tabSection');
	    $(allTabs).click( function(){
		    $(allTabbedSections).addClass('hide');
		    $(allTabs).removeClass('selected');
		    var currentTab = $(allTabs).index(this);
		    $(allTabbedSections[currentTab]).removeClass('hide');
		    $(this).addClass('selected');
		    showTapestryTab(currentTab);
		    return false;
	    });
}

function showTapestryTab(tab)
{  
    if (tab==0)
	{
		removerpropertyName('divIndividual Donation');	
		hideTapestryRequiredFields(1);		
	}
	else if (tab==1)
	{
	    removerpropertyName('divBusiness/Corporate Donation');
		hideTapestryRequiredFields(2);
	}
	return false;
}

function hideTapestryRequiredFields(tab)
{
	//Invidual
	if (tab==1)
	{
		getElementByPD_Id("FirstName1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("LastName1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Address1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("City1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("State1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Zip1").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("EMail1").setAttribute("PD_isRequiredValue","true");		
		
		getElementByPD_Id("BusinessName").value="";
		getElementByPD_Id("ContactFirstName").value="";
		getElementByPD_Id("ContactLastName").value="";
		getElementByPD_Id("Address2").value="";
		getElementByPD_Id("City2").value="";
		getElementByPD_Id("State2").value="";
		getElementByPD_Id("Zip2").value="";
		getElementByPD_Id("EMail2").value="";
		getElementByPD_Id("phone2").value="";
			
	}
	else
	{
		getElementByPD_Id("FirstName1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("LastName1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Address1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("City1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("State1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Zip1").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("EMail1").setAttribute("PD_isRequiredValue","false");
	}
	//Business
	if (tab==2)
	{	
	    getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","true");
		getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","true");
				
		getElementByPD_Id("FirstName1").value="";
		getElementByPD_Id("LastName1").value="";
		getElementByPD_Id("Address1").value="";
		getElementByPD_Id("City1").value="";
		getElementByPD_Id("State1").value="";
		getElementByPD_Id("Zip1").value="";
		getElementByPD_Id("EMail1").value="";
		getElementByPD_Id("Phone1").value="";
		
	}
	else
	{   
		getElementByPD_Id("BusinessName").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("ContactFirstName").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("ContactLastName").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Address2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("City2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("State2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("Zip2").setAttribute("PD_isRequiredValue","false");
		getElementByPD_Id("EMail2").setAttribute("PD_isRequiredValue","false");
	}	
}


/* End of  Tapestry online donation functions */


// Please see Section added for updated to Online Donation page /Nov 03 2009 Elma

// Begin Added New Function for Direct My Gift to check box list Oct 29 2009
function updateDirectMyGiftTo(clientId,curObj)
{  
    var selectedItems = document.getElementById(clientId).value;
    
    if(curObj.checked)    
    {
        if(selectedItems != '')
            selectedItems+=  "<br/>" + curObj.value;
        else
            selectedItems+=  curObj.value;
    }
    else     
    {
       selectedItems = selectedItems.replace(curObj.value + "<br/>",""); 
       selectedItems = selectedItems.replace(curObj.value,""); 
    }  
    //alert(selectedItems)
    document.getElementById(clientId).value = selectedItems;
}


// Added Load method for Share my story form

function ShareMyStoryLoad()
{
    // Place the Intro text under the Form Header
    $(".shareIntro").insertAfter($('.centerLeft > div:eq(0) > h3:eq(0)'));
    
    // Re arrange the LastName Column next to First Name        
    $(".firstColumn + .clearFix").detach(); // remove unwanted clearFix    
    $(".cInfo:eq(1)").addClass("form2Column"); // Add additional class for lastName
    
    // Link up the terms and conditions 
	$("#lblchkTerms").wrapInner("<a id='lnkTerms' href='#' onclick='javascript:simplePopup(\"divTermsLayer\");return false;'></a>");
	$("#lblchkTerms").insertAfter(".activeChk");
	
	//Remove unwanted line
	$('.centerLeft .bulletClass').detach();
}