function VerifyCheckBox(checkBoxElement)
{
	if (checkBoxElement.checked)	checkBoxElement.value = 'true';
	else checkBoxElement.value = 'false';
}

function IsSelectedProcedure(theForm)
{
	if (theForm.chkbotox.checked)
	{		
		return (true);
	}
	if (theForm.chkfatinjections.checked)
	{		
		return (true);
	}
	if (theForm.chkrestylane.checked)
	{
		return (true);
	}
	if (theForm.chkmicrodermabrasion.checked)
	{
		return (true);
	}
	if (theForm.chkchemicalpeel.checked)
	{
		return (true);
	}
	if (theForm.chklaserskin.checked)
	{
		return (true);
	}
	if (theForm.chkdermabrasion.checked)
	{
		return (true);
	}
	if (theForm.chkscarrepair.checked)
	{		
		return (true);
	}
	if (theForm.chkbirthmarkremoval.checked)
	{
		return (true);
	}
	if (theForm.chkmoleremoval.checked)
	{
		return (true);
	}
	if (theForm.chkbreastenlargement.checked)
	{
		return (true);
	}
	if (theForm.chkbreastlift.checked)
	{
		return (true);
	}
		
	if (theForm.chkbreastimplant.checked)
	{		
		return (true);
	}
	if (theForm.chkbreastreduction.checked)
	{		
		return (true);
	}
	if (theForm.chkface.checked)
	{
		return (true);
	}
	if (theForm.chkneck.checked)
	{
		return (true);
	}
	if (theForm.chkarms.checked)
	{
		return (true);
	}
	if (theForm.chkbody.checked)
	{
		return (true);
	}
	if (theForm.chkback.checked)
	{
		return (true);
	}
	if (theForm.chkabdomen.checked)
	{		
		return (true);
	}
	if (theForm.chkwaist.checked)
	{
		return (true);
	}
	if (theForm.chkknees.checked)
	{
		return (true);
	}
	if (theForm.chkankles.checked)
	{
		return (true);
	}
	if (theForm.chktummytuck.checked)
	{
		return (true);
	}
		
	if (theForm.chkarmlift.checked)
	{		
		return (true);
	}
	if (theForm.chkthighlift.checked)
	{		
		return (true);
	}
	if (theForm.chkbodylift.checked)
	{
		return (true);
	}
	if (theForm.chknecklift.checked)
	{
		return (true);
	}
	if (theForm.chkeyelidsurgery.checked)
	{
		return (true);
	}
	if (theForm.chkfacelift.checked)
	{
		return (true);
	}
	if (theForm.chknosereshaping.checked)
	{
		return (true);
	}
	if (theForm.chkforeheadlift.checked)
	{		
		return (true);
	}
	if (theForm.chkearsurgery.checked)
	{
		return (true);
	}
	if (theForm.chklipaugmentation.checked)
	{
		return (true);
	}
	if (theForm.chkchinaugmentation.checked)
	{
		return (true);
	}
	if (theForm.chkcheekaugmentation.checked)
	{
		return (true);
	}
	if (theForm.chkmalebreast.checked)
	{
		return (true);
	}
	if (theForm.chkfemale.checked)
	{
		return (true);
	}	

	return false;
}

function ValidateData(theForm)
{


	if ((theForm.reasonrequest1.checked==false) && (theForm.reasonrequest2.checked==false) && 
	    (theForm.reasonrequest3.checked==false) && (theForm.reasonrequest4.checked==false))
	{
		alert('Please, select a option in "I am making this request because".');
		theForm.reasonrequest1.focus();
		return (false);
	}
	
	CheckValues(theForm);

	if (IsSelectedProcedure(theForm)==false)
	{
		alert('Please, select a procedure.');
		theForm.chkbotox.focus();
		return (false);
	}

	if ((theForm.consideringsince1.checked==false) && (theForm.consideringsince2.checked==false) && (theForm.consideringsince3.checked==false))
	{
		alert('Please, select a option in "How long have you been considering cosmetic surgery?".');
		theForm.consideringsince1.focus();
		return (false);
	}
	
	if ((theForm.consultedotherdoctors1.checked==false) && (theForm.consultedotherdoctors2.checked==false))
	{
		alert('Please, select a option in "Have you consulted other doctors about cosmetic surgery?".');
		theForm.consultedotherdoctors1.focus();
		return (false);
	}

	if (theForm.age.value == "")
	{
		alert('Please, enter your age.');
		theForm.age.focus();
		return (false);
	}
	
	if ((theForm.gender1.checked==false) && (theForm.gender2.checked==false))
	{
		alert('Please, select your gender.');
		theForm.gender1.focus();
		return (false);
	}

	if ((theForm.expectedbudget1.checked==false) && (theForm.expectedbudget2.checked==false) && 
	    (theForm.expectedbudget3.checked==false) && (theForm.expectedbudget4.checked==false) &&
	    (theForm.expectedbudget5.checked==false) && (theForm.expectedbudget6.checked==false))
	{
		alert('Please, select a option in "What is your expected budget".');
		theForm.expectedbudget1.focus();
		return (false);
	}
	
	if ((theForm.howmuchknow1.checked==false) && (theForm.howmuchknow2.checked==false) && 
	    (theForm.howmuchknow3.checked==false) && (theForm.howmuchknow4.checked==false))
	{
		alert('Please, select a option in "How much do you know about the cosmetic procedures you are considering?".');
		theForm.howmuchknow1.focus();
		return (false);
	}
	
	if ((theForm.howsoon1.checked==false) && (theForm.howsoon2.checked==false) && 
	    (theForm.howsoon3.checked==false) && (theForm.howsoon4.checked==false) &&
	    (theForm.howsoon5.checked==false))
	{
		alert('Please, select a option in "How soon are you considering having a cosmetic procedure?".');
		theForm.howsoon1.focus();
		return (false);
	}
	
	if (theForm.feet.value == "")
	{
		alert('Please, choose your height.');
		theForm.feet.focus();
		return (false);
	}
	
	if (theForm.inches.value == "")
	{
		alert('Please, choose your height.');
		theForm.inches.focus();
		return (false);
	}
	
	if (theForm.weight.value == "")
	{
		alert('Please, choose your weight.');
		theForm.weight.focus();
		return (false);
	}
	
	if ((theForm.smoker1.checked==false) && (theForm.smoker2.checked==false))
	{
		alert('Please, select a option in "Do you smoke?".');
		theForm.smoker1.focus();
		return (false);
	}
	
	if (theForm.questionanswereddoctor.value == "")
	{
		alert('Please, select a option in "What questions you want Dr. Vitenas to answer about cosmetic procedures?".');
		theForm.questionanswereddoctor.focus();
		return (false);
	}
	
	if (theForm.firstname.value == "")
	{
		alert('Please, enter your first name.');
		theForm.firstname.focus();
		return (false);
	}
	
	if (theForm.lastname.value == "")
	{
		alert('Please, enter your last name.');
		theForm.lastname.focus();
		return (false);
	}
	
	if ((theForm.contactmevia1.checked==false) && (theForm.contactmevia2.checked==false) && 
	    (theForm.contactmevia3.checked==false))
	{
		alert('Please, select a option in "I prefer to contacted by".');
		theForm.contactmevia1.focus();
		return (false);
	}
	
	if ((theForm.emailaddress.value == "") || (theForm.emailaddress.value == 'Email'))
	{
		alert('Please, enter your email.');
		theForm.emailaddress.focus();
		return (false);
	}
	else
	{
		if(!ValidateEmail(theForm.emailaddress.value))
		{
			alert("Please check the emails address");
			theForm.emailaddress.focus();
			return false;
		}
	}
	
	if (theForm.areacode.value == "")
	{
		alert('Please, enter your area code.');
		theForm.areacode.focus();
		return (false);
	}
	
	if (theForm.phone.value == "")
	{
		alert('Please, enter your number.');
		theForm.phone.focus();
		return (false);
	}
	
	if (theForm.besttimecall.value == "")
	{
		alert('Please, choose a option in "Best time to call is".');
		theForm.besttimecall.focus();
		return (false);
	}
	
	return true;
	
}



function CheckValues(theForm)
{
	if (theForm.chkbotox.checked)
	{
		theForm.chkbotox.value = 'true';
	}
	else
	{
		theForm.chkbotox.value = 'false';
	}
	
	if (theForm.chkfatinjections.checked)
	{		
		theForm.chkfatinjections.value = 'true';
	}
	else
	{
		theForm.chkfatinjections.value = 'false';
	}
	
	if (theForm.chkrestylane.checked)
	{
		theForm.chkrestylane.value = 'true';
	}
	else
	{
		theForm.chkrestylane.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.chklaserskin.checked)
	{
		theForm.chklaserskin.value = 'true';
	}
	else
	{
		theForm.chklaserskin.value = 'false';
	}
	
	if (theForm.chkdermabrasion.checked)
	{
		theForm.chkdermabrasion.value = 'true';
	}
	else
	{
		theForm.chkdermabrasion.value = 'false';
	}
	
	if (theForm.chkscarrepair.checked)
	{		
		theForm.chkscarrepair.value = 'true';
	}
	else
	{
		theForm.chkscarrepair.value = 'false';
	}
	
	if (theForm.chkbirthmarkremoval.checked)
	{
		theForm.chkbirthmarkremoval.value = 'true';
	}
	else
	{
		theForm.chkbirthmarkremoval.value = 'true';
	}
	
	if (theForm.chkmoleremoval.checked)
	{
		theForm.chkmoleremoval.value = 'true';
	}
	else
	{
		theForm.chkmoleremoval.value = 'false';
	}
	
	if (theForm.chkbreastenlargement.checked)
	{
		theForm.chkbreastenlargement.value = 'true';
	}
	else
	{
		theForm.chkbreastenlargement.value = 'false';
	}
	
	if (theForm.chkbreastlift.checked)
	{
		theForm.chkbreastlift.value = 'true';
	}	
	else
	{
		theForm.chkbreastlift.value = 'false';
	}
		
	if (theForm.chkbreastimplant.checked)
	{
		theForm.chkbreastimplant.value = 'true';
	}
	else
	{
		theForm.chkbreastimplant.value = 'false';
	}
		
	if (theForm.chkbreastreduction.checked)
	{
		theForm.chkbreastreduction.value = 'true';
	}
	else
	{
		theForm.chkbreastreduction.value = 'false';
	}
	
	if (theForm.chkface.checked)
	{
		theForm.chkface.value = 'true';
	}
	else
	{
		theForm.chkface.value = 'false';
	}	
	
	if (theForm.chkneck.checked)
	{
		theForm.chkneck.value = 'true';
	}
	else
	{
		theForm.chkneck.value = 'false';
	}
	
	if (theForm.chkarms.checked)
	{
		theForm.chkarms.value = 'true';
	}
	else
	{
		theForm.chkarms.value = 'false';
	}
	
	if (theForm.chkbody.checked)
	{
		theForm.chkbody.value = 'true';
	}
	else
	{
		theForm.chkbody.value = 'false';
	}
	
	if (theForm.chkback.checked)
	{
		theForm.chkback.value = 'true';
	}
	else
	{
		theForm.chkback.value = 'false';
	}
	
	if (theForm.chkabdomen.checked)
	{
		theForm.chkabdomen.value = 'true';
	}
	else
	{
		theForm.chkabdomen.value = 'false';
	}
		
	if (theForm.chkwaist.checked)
	{
		theForm.chkwaist.value = 'true';
	}
	else
	{
		theForm.chkwaist.value = 'false';
	}
	
	if (theForm.chkthighs.checked)
	{
		theForm.chkthighs.value = 'true';
	}
	else
	{
		theForm.chkthighs.value = 'false';
	}
	
	if (theForm.chkknees.checked)
	{
		theForm.chkknees.value = 'true';
	}
	else
	{
		theForm.chkknees.value = 'false';
	}
	
	if (theForm.chkankles.checked)
	{
		theForm.chkankles.value = 'true';
	}
	else
	{
		theForm.chkankles.value = 'false';
	}
	
	if (theForm.chktummytuck.checked)
	{
		theForm.chktummytuck.value = 'true';
	}
	else
	{
		theForm.chktummytuck.value = 'false';
	}
	
	if (theForm.chkarmlift.checked)
	{
		theForm.chkarmlift.value = 'true';
	}
	else
	{
		theForm.chkarmlift.value = 'false';
	}
	
	if (theForm.chkthighlift.checked)
	{
		theForm.chkthighlift.value = 'true';
	}
	else
	{
		theForm.chkthighlift.value = 'false';
	}
	
	if (theForm.chkbodylift.checked)
	{
		theForm.chkbodylift.value = 'true';
	}
	else
	{
		theForm.chkbodylift.value = 'false';
	}
	
	if (theForm.chknecklift.checked)
	{
		theForm.chknecklift.value = 'true';
	}
	else
	{
		theForm.chknecklift.value = 'false';
	}
	
	if (theForm.chkeyelidsurgery.checked)
	{
		theForm.chkeyelidsurgery.value = 'true';
	}
	else
	{
		theForm.chkeyelidsurgery.value = 'false';
	}
	
	if (theForm.chkfacelift.checked)
	{
		theForm.chkfacelift.value = 'true';
	}
	else
	{
		theForm.chkfacelift.value = 'false';
	}
	
	if (theForm.chknosereshaping.checked)
	{
		theForm.chknosereshaping.value = 'true';
	}
	else
	{
		theForm.chknosereshaping.value = 'false';
	}
	
	if (theForm.chkforeheadlift.checked)
	{
		theForm.chkforeheadlift.value = 'true';
	}
	else
	{
		theForm.chkforeheadlift.value = 'false';
	}
	
	if (theForm.chkearsurgery.checked)
	{
		theForm.chkearsurgery.value = 'true';
	}
	else
	{
		theForm.chkearsurgery.value = 'false';
	}
	
	if (theForm.chklipaugmentation.checked)
	{
		theForm.chklipaugmentation.value = 'true';
	}
	else
	{
		theForm.chklipaugmentation.value = 'false';
	}
	
	if (theForm.chkchinaugmentation.checked)
	{
		theForm.chkchinaugmentation.value = 'true';
	}
	else
	{
		theForm.chkchinaugmentation.value = 'false';
	}
	
	if (theForm.chkcheekaugmentation.checked)
	{
		theForm.chkcheekaugmentation.value = 'true';
	}
	else
	{
		theForm.chkcheekaugmentation.value = 'false';
	}
	
	if (theForm.chkmalebreast.checked)
	{
		theForm.chkmalebreast.value = 'true';
	}
	else
	{
		theForm.chkmalebreast.value = 'false';
	}
	
	if (theForm.chkfemale.checked)
	{
		theForm.chkfemale.value = 'true';
	}
	else
	{
		theForm.chkfemale.value = 'false';
	}
}

function ValidateDataContact(theForm)
{

	if (theForm.contactDate.value != "")
	{
		alert("Test");		
		return (false);
	}
	if (theForm.firstname.value == "")
	{
		alert('Please, enter your first name.');
		theForm.firstname.focus();
		return (false);
	}

	if (theForm.lastname.value == "")
	{
		alert('Please, enter your last name.');
		theForm.lastname.focus();
		return (false);
	}

	if ((theForm.email.value == "") || (theForm.email.value == 'Email'))
	{
		alert('Please, enter your email.');
		theForm.email.focus();
		return (false);
	}
	else
	{
		if(!ValidateEmail(theForm.email.value))
		{
			alert("Please check the emails address");
			theForm.email.focus();
			return false;
		}
	}
	
	if (theForm.phone.value == "")
	{
		alert('Please, enter your phone.');
		theForm.phone.focus();
		return (false);
	}
	
	if (theForm.comments.value == "")
	{
		alert('Please, enter your comments.');
		theForm.comments.focus();
		return (false);
	}
}


function ValidateEmail(valor)
{
    if (/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/.test(valor))
        return true;
    else
        return false;
}