function ValidateDataPatientSign(theForm)
{
	debugger;
	if (theForm.contactDate.value != "")
	{
		alert(theForm.contactDate.value);
		return (false);
	}
	
	if ((theForm.txtDate.value == ""))
	{
	     alert("Please enter the date");
		 theForm.txtDate.focus();
		 return false;
	}
	else	
	{
		if(!ValidateDate(theForm.txtDate.value))
		{
			alert("Please check the date");
			theForm.txtDate.focus();
			return false;
		}
	}
	
	if ((theForm.txtDateLastPhysical.value == ""))
	{
	     alert("Please enter the date");
		 theForm.txtDateLastPhysical.focus();
		 return false;
	}
	else	
	{
		if(!ValidateDate(theForm.txtDateLastPhysical.value))
		{
			alert("Please check the date");
			theForm.txtDateLastPhysical.focus();
			return false;
		}
	}
	
	if (theForm.txtName.value == "")
	{
		alert('Please, enter your name.');
		theForm.txtName.focus();
		return (false);
	}
	
	if (theForm.txtLastName.value == "")
	{
		alert('Please, enter your last name.');
		theForm.txtLastName.focus();
		return (false);
	}

	if (theForm.txtReasonVisit.value == "")
	{
		alert("Please, enter your reason for today's visit.");
		theForm.txtReasonVisit.focus();
		return (false);
	}
	
	if (theForm.chkOther.checked)
	{
		if ((theForm.txtOther.value == ""))
		{
			alert("Please enter the other");
			theForm.txtOther.focus();
			return false;
		}
	}
	
	if (theForm.chkOtherInjectables.checked)
	{
		if ((theForm.txtOtherInjectables.value == ""))
		{
			alert("Please enter the other");
			theForm.txtOtherInjectables.focus();
			return false;
		}
	}
	
	if (theForm.chkOtherInjectables.checked)
	{
		if ((theForm.txtOtherInjectables.value == ""))
		{
			alert("Please enter the other");
			theForm.txtOtherInjectables.focus();
			return false;
		}
	}
	
	if (theForm.chkFriend.checked)
	{
		if ((theForm.txtNameAbout.value == ""))
		{
			alert("Please enter the name");
			theForm.txtNameAbout.focus();
			return false;
		}
	}
	
	if (theForm.chkDr.checked)
	{
		if ((theForm.txtDrName.value == ""))
		{
			alert("Please enter the name of the doctor");
			theForm.txtDrName.focus();
			return false;
		}
	}
	
	if (theForm.chkOtherAbout.checked)
	{
		if ((theForm.txtOtherAbout.value == ""))
		{
			alert("Please enter the others");
			theForm.txtOtherAbout.focus();
			return false;
		}
	}
	
	if (theForm.rbtConsultedProfessional[0].checked)
	{
		if (theForm.txtWhatKindWhere.value == "")
		{
			alert('Please, enter the what kind.');
			theForm.txtWhatKindWhere.focus();
			return (false);
		}
	}
	
	if (isNaN(theForm.txtPacks.value)) 
	{
		alert("Please enter only numerical digits in the # Packs field.");
		theForm.txtPacks.focus();
		return false;	
	}
	
	if (isNaN(theForm.txtPerPacks.value)) 
	{
		alert("Please enter only numerical digits in the Per field.");
		theForm.txtPerPacks.focus();
		return false;	
	}	
	
	if (isNaN(theForm.txtFrecuency.value)) 
	{
		alert("Please enter only numerical digits in the frecuency field.");
		theForm.txtFrecuency.focus();
		return false;	
	}
	
	if (isNaN(theForm.txtPerFrecuency.value)) 
	{
		alert("Please enter only numerical digits in the Per field.");
		theForm.txtPerFrecuency.focus();
		return false;	
	}
			
	CheckValues(theForm);
}

function CheckValues(theForm)
{
	if (theForm.chkNecklift.checked)
	{
		theForm.chkNecklift.value = 'true';
	}
	else
	{
		theForm.chkNecklift.value = 'false';
	}	
	
	if (theForm.chkFacelift.checked)
	{
		theForm.chkFacelift.value = 'true';
	}
	else
	{
		theForm.chkFacelift.value = 'false';
	}
	
	if (theForm.chkEyelidCorrection.checked)
	{
		theForm.chkEyelidCorrection.value = 'true';
	}
	else
	{
		theForm.chkEyelidCorrection.value = 'false';
	}
	
	if (theForm.chkForehead.checked)
	{
		theForm.chkForehead.value = 'true';
	}
	else
	{
		theForm.chkForehead.value = 'false';
	}
	
	if (theForm.chkFastTransfer.checked)
	{
		theForm.chkFastTransfer.value = 'true';
	}
	else
	{
		theForm.chkFastTransfer.value = 'false';
	}
	
	if (theForm.chkCosmetic.checked)
	{
		theForm.chkCosmetic.value = 'true';
	}
	else
	{
		theForm.chkCosmetic.value = 'false';
	}
	
	if (theForm.chkCorrective.checked)
	{
		theForm.chkCorrective.value = 'true';
	}
	else
	{
		theForm.chkCorrective.value = 'false';
	}
	
	if (theForm.chkSinus.checked)
	{
		theForm.chkSinus.value = 'true';
	}
	else
	{
		theForm.chkSinus.value = 'false';
	}
	
	if (theForm.chkChinImplant.checked)
	{
		theForm.chkChinImplant.value = 'true';
	}
	else
	{
		theForm.chkChinImplant.value = 'false';
	}
	
	if (theForm.chkCheekImplant.checked)
	{
		theForm.chkCheekImplant.value = 'true';
	}
	else
	{
		theForm.chkCheekImplant.value = 'false';
	}
	
	if (theForm.chkFacialNeck.checked)
	{
		theForm.chkFacialNeck.value = 'true';
	}
	else
	{
		theForm.chkFacialNeck.value = 'false';
	}
	
	if (theForm.chkReduceProminence.checked)
	{
		theForm.chkReduceProminence.value = 'true';
	}
	else
	{
		theForm.chkReduceProminence.value = 'false';
	}
	
	if (theForm.chkReduceEarlobe.checked)
	{
		theForm.chkReduceEarlobe.value = 'true';
	}
	else
	{
		theForm.chkReduceEarlobe.value = 'false';
	}
	
	if (theForm.chkRepairTorn.checked)
	{
		theForm.chkRepairTorn.value = 'true';
	}
	else
	{
		theForm.chkRepairTorn.value = 'false';
	}
	
	if (theForm.chkSkinGrowths.checked)
	{
		theForm.chkSkinGrowths.value = 'true';
	}
	else
	{
		theForm.chkSkinGrowths.value = 'false';
	}
	
	if (theForm.chkWrinkles.checked)
	{
		theForm.chkWrinkles.value = 'true';
	}
	else
	{
		theForm.chkWrinkles.value = 'false';
	}
	
	if (theForm.chkPigmentationAge.checked)
	{
		theForm.chkPigmentationAge.value = 'true';
	}
	else
	{
		theForm.chkPigmentationAge.value = 'false';
	}
	
	if (theForm.chkRedness.checked)
	{
		theForm.chkRedness.value = 'true';
	}
	else
	{
		theForm.chkRedness.value = 'false';
	}
	
	if (theForm.chkBrokenBlood.checked)
	{
		theForm.chkBrokenBlood.value = 'true';
	}
	else
	{
		theForm.chkBrokenBlood.value = 'false';
	}
	
	if (theForm.chkVessels.checked)
	{
		theForm.chkVessels.value = 'true';
	}
	else
	{
		theForm.chkVessels.value = 'false';
	}
	
	if (theForm.chkRoughness.checked)
	{
		theForm.chkRoughness.value = 'true';
	}
	else
	{
		theForm.chkRoughness.value = 'false';
	}
	
	if (theForm.chkScars.checked)
	{
		theForm.chkScars.value = 'true';
	}
	else
	{
		theForm.chkScars.value = 'false';
	}
	
	if (theForm.chkLargePores.checked)
	{
		theForm.chkLargePores.value = 'true';
	}
	else
	{
		theForm.chkLargePores.value = 'false';
	}
	
	if (theForm.chkAcne.checked)
	{
		theForm.chkAcne.value = 'true';
	}
	else
	{
		theForm.chkAcne.value = 'false';
	}
	
	if (theForm.chkAcneScarring.checked)
	{
		theForm.chkAcneScarring.value = 'true';
	}
	else
	{
		theForm.chkAcneScarring.value = 'false';
	}
	
	if (theForm.chkOther.checked)
	{
		theForm.chkOther.value = 'true';
	}
	else
	{
		theForm.chkOther.value = 'false';
	}
	
	if (theForm.chkBotox.checked)
	{
		theForm.chkBotox.value = 'true';
	}
	else
	{
		theForm.chkBotox.value = 'false';
	}
	
	if (theForm.chkCollagen.checked)
	{
		theForm.chkCollagen.value = 'true';
	}
	else
	{
		theForm.chkCollagen.value = 'false';
	}
	
	if (theForm.chkRestylane.checked)
	{
		theForm.chkRestylane.value = 'true';
	}
	else
	{
		theForm.chkRestylane.value = 'false';
	}
	
	if (theForm.chkRadiesse.checked)
	{
		theForm.chkRadiesse.value = 'true';
	}
	else
	{
		theForm.chkRadiesse.value = 'false';
	}
	
	if (theForm.chkSculptra.checked)
	{
		theForm.chkSculptra.value = 'true';
	}
	else
	{
		theForm.chkSculptra.value = 'false';
	}
	
	if (theForm.chkLipAugmentation.checked)
	{
		theForm.chkLipAugmentation.value = 'true';
	}
	else
	{
		theForm.chkLipAugmentation.value = 'false';
	}
	
	if (theForm.chkJuvederm.checked)
	{
		theForm.chkJuvederm.value = 'true';
	}
	else
	{
		theForm.chkJuvederm.value = 'false';
	}
	
	if (theForm.chkOtherInjectables.checked)
	{
		theForm.chkOtherInjectables.value = 'true';
	}
	else
	{
		theForm.chkOtherInjectables.value = 'false';
	}
	
	if (theForm.chkHairRemoval.checked)
	{
		theForm.chkHairRemoval.value = 'true';
	}
	else
	{
		theForm.chkHairRemoval.value = 'false';
	}
	
	if (theForm.chkHairTransplant.checked)
	{
		theForm.chkHairTransplant.value = 'true';
	}
	else
	{
		theForm.chkHairTransplant.value = 'false';
	}
	
	if (theForm.chkMicrodermabrasion.checked)
	{
		theForm.chkMicrodermabrasion.value = 'true';
	}
	else
	{
		theForm.chkMicrodermabrasion.value = 'false';
	}
	
	if (theForm.chkChemicalPeel.checked)
	{
		theForm.chkChemicalPeel.value = 'true';
	}
	else
	{
		theForm.chkChemicalPeel.value = 'false';
	}
	
	if (theForm.chkFaceSpider.checked)
	{
		theForm.chkFaceSpider.value = 'true';
	}
	else
	{
		theForm.chkFaceSpider.value = 'false';
	}
	
	if (theForm.chkLegsSpider.checked)
	{
		theForm.chkLegsSpider.value = 'true';
	}
	else
	{
		theForm.chkLegsSpider.value = 'false';
	}
	
	if (theForm.chkFriend.checked)
	{
		theForm.chkFriend.value = 'true';
	}
	else
	{
		theForm.chkFriend.value = 'false';
	}
	
	if (theForm.chkCoWorker.checked)
	{
		theForm.chkCoWorker.value = 'true';
	}
	else
	{
		theForm.chkCoWorker.value = 'false';
	}
	
	if (theForm.chkUrbanActive.checked)
	{
		theForm.chkUrbanActive.value = 'true';
	}
	else
	{
		theForm.chkUrbanActive.value = 'false';
	}
	
	if (theForm.chkWebSite.checked)
	{
		theForm.chkWebSite.value = 'true';
	}
	else
	{
		theForm.chkWebSite.value = 'false';
	}
	
	if (theForm.chkDr.checked)
	{
		theForm.chkDr.value = 'true';
	}
	else
	{
		theForm.chkDr.value = 'false';
	}
	
	if (theForm.chkElegantPermanent.checked)
	{
		theForm.chkElegantPermanent.value = 'true';
	}
	else
	{
		theForm.chkElegantPermanent.value = 'false';
	}
	
	if (theForm.chkSalon.checked)
	{
		theForm.chkSalon.value = 'true';
	}
	else
	{
		theForm.chkSalon.value = 'false';
	}
	
	if (theForm.chkPGcredit.checked)
	{
		theForm.chkPGcredit.value = 'true';
	}
	else
	{
		theForm.chkPGcredit.value = 'false';
	}
	
	if (theForm.chkNewspaper.checked)
	{
		theForm.chkNewspaper.value = 'true';
	}
	else
	{
		theForm.chkNewspaper.value = 'false';
	}
	
	if (theForm.chkRadio.checked)
	{
		theForm.chkRadio.value = 'true';
	}
	else
	{
		theForm.chkRadio.value = 'false';
	}
	
	if (theForm.chkTV.checked)
	{
		theForm.chkTV.value = 'true';
	}
	else
	{
		theForm.chkTV.value = 'false';
	}
	
	if (theForm.chkOtherAbout.checked)
	{
		theForm.chkOtherAbout.value = 'true';
	}
	else
	{
		theForm.chkOtherAbout.value = 'false';
	}
	
	if (theForm.chkHeartDisease.checked)
	{
		theForm.chkHeartDisease.value = 'true';
	}
	else
	{
		theForm.chkHeartDisease.value = 'false';
	}
	
	if (theForm.chkHighBlood.checked)
	{
		theForm.chkHighBlood.value = 'true';
	}
	else
	{
		theForm.chkHighBlood.value = 'false';
	}
	
	if (theForm.chkHeartAttack.checked)
	{
		theForm.chkHeartAttack.value = 'true';
	}
	else
	{
		theForm.chkHeartAttack.value = 'false';
	}
	
	if (theForm.chkRespiratoryCondition.checked)
	{
		theForm.chkRespiratoryCondition.value = 'true';
	}
	else
	{
		theForm.chkRespiratoryCondition.value = 'false';
	}
	
	if (theForm.chkEyeProblems.checked)
	{
		theForm.chkEyeProblems.value = 'true';
	}
	else
	{
		theForm.chkEyeProblems.value = 'false';
	}
	
	if (theForm.chkEmphysema.checked)
	{
		theForm.chkEmphysema.value = 'true';
	}
	else
	{
		theForm.chkEmphysema.value = 'false';
	}
	
	if(theForm.chkDiabetes.checked)
	   theForm.chkDiabetes.value = 'true';
	else
 	   theForm.chkDiabetes.value = 'false';
 	   
 	if(theForm.chkNoseProblems.checked)
	   theForm.chkNoseProblems.value = 'true';
	else
 	   theForm.chkNoseProblems.value = 'false';
 	   
 	if(theForm.chkAsthma.checked)
	   theForm.chkAsthma.value = 'true';
	else
 	   theForm.chkAsthma.value = 'false';
 	   
 	if(theForm.chkCancer.checked)
	   theForm.chkCancer.value = 'true';
	else
 	   theForm.chkCancer.value = 'false';
 	   
 	if(theForm.chkEarProblems.checked)
	   theForm.chkEarProblems.value = 'true';
	else
 	   theForm.chkEarProblems.value = 'false';
 	   
 	if(theForm.chkBloodDisease.checked)
	   theForm.chkBloodDisease.value = 'true';
	else
 	   theForm.chkBloodDisease.value = 'false';
 	   
 	if(theForm.chkGastroIntestinal.checked)
	   theForm.chkGastroIntestinal.value = 'true';
	else
 	   theForm.chkGastroIntestinal.value = 'false';
 	   
 	if(theForm.chkBleedingProblems.checked)
	   theForm.chkBleedingProblems.value = 'true';
	else
 	   theForm.chkBleedingProblems.value = 'false';
 	   
 	if(theForm.chkJaundice.checked)
	   theForm.chkJaundice.value = 'true';
	else
 	   theForm.chkJaundice.value = 'false';
 	   
 	if(theForm.chkUninary.checked)
	   theForm.chkUninary.value = 'true';
	else
 	   theForm.chkUninary.value = 'false';
 	   
 	if(theForm.chkThyroid.checked)
	   theForm.chkThyroid.value = 'true';
	else
 	   theForm.chkThyroid.value = 'false';
 	   
 	if(theForm.chkAnemia.checked)
	   theForm.chkAnemia.value = 'true';
	else
 	   theForm.chkAnemia.value = 'false';
 	   
 	if(theForm.chkThyroidDisease.checked)
	   theForm.chkThyroidDisease.value = 'true';
	else
 	   theForm.chkThyroidDisease.value = 'false';
 	   
 	if(theForm.chkVIH.checked)
	   theForm.chkVIH.value = 'true';
	else
 	   theForm.chkVIH.value = 'false';
 	   
 	if(theForm.chkFacialTrauma.checked)
	   theForm.chkFacialTrauma.value = 'true';
	else
 	   theForm.chkFacialTrauma.value = 'false';
 	   
 	if(theForm.chkBloodPressure.checked)
	   theForm.chkBloodPressure.value = 'true';
	else
 	   theForm.chkBloodPressure.value = 'false';
 	   
 	if(theForm.chkVitaminE.checked)
	   theForm.chkVitaminE.value = 'true';
	else
 	   theForm.chkVitaminE.value = 'false';
 	   
 	if(theForm.chkGinko.checked)
	   theForm.chkGinko.value = 'true';
	else
 	   theForm.chkGinko.value = 'false';
 	   
 	if(theForm.chkStJohn.checked)
	   theForm.chkStJohn.value = 'true';
	else
 	   theForm.chkStJohn.value = 'false';
 	   
 	if(theForm.chkGinseg.checked)
	   theForm.chkGinseg.value = 'true';
	else
 	   theForm.chkGinseg.value = 'false';
 	   
 	if(theForm.chkAspirin.checked)
	   theForm.chkAspirin.value = 'true';
	else
 	   theForm.chkAspirin.value = 'false';
 	   
 	if(theForm.chkGarlic.checked)
	   theForm.chkGarlic.value = 'true';
	else
 	   theForm.chkGarlic.value = 'false';
 	   
 	   
}

function ValidateDate(fld) 
{
 var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/;
 if ((fld.match(RegExPattern))) {
     var ar = fld.split("/"); 
     var a = ar[2];
     if(a.length==4) 
      return true;
     else
      return false; 
 } 
 else{
     return false;
 } 
}

function ValidateEmail(valor) 
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor))
		return true;
	else
		return false;
}