// JavaScript Document

function disableother()
{
//window.document.myform.rdlmt_other.disabled=true;
window.document.myform.rdlmt_other.value=""
}
function enableother()
{
window.document.myform.rdlmt_other.disabled=false;
}
function disablerd()
{
obj=window.document.getElementById("rdlmt3")
obj.checked=true;
}
function form_check125()
{
	var name_variable;
	var eff_date;
	var plan_date;
	var pack;
		pack = 0
			for (i=0;i<document.myform.chkdate.length;i++) 
			{ 
				if (document.myform.chkdate[i].checked==true) 
				eff_date=i; 
				
			} 
			for (i=0;i<document.myform.chkpdate.length;i++) 
			{ 
				if (document.myform.chkpdate[i].checked==true) 
				plan_date=i; 
				
			} 
			if (document.myform.rdpack1.checked==true)
			{ 	 
				pack=1; 
			}
			if (document.myform.rdpack2.checked==true)
			{ 	 
				pack=1; 
			}
			if (document.myform.rdpack3.checked==true)
			{ 	 
				pack=1; 
			}
			if (document.myform.rdpack4.checked==true)
			{ 	 
				pack=1; 
			}
				

	if(document.myform.txt_pur_fname.value=="")
	{
		alert (" Please Enter First Name ( Purchaser Information )");
		document.myform.txt_pur_fname.focus();
		return false;
	}
	else if(document.myform.txt_pur_lname.value=="")
	{
		alert (" Please Enter Last Name ( Purchaser Information )");
		document.myform.txt_pur_lname.focus();
		return false;
	}
	else if(document.myform.txt_pur_cmp.value=="")
	{
		alert (" Please Enter Company Name ( Purchaser Information )");
		document.myform.txt_pur_cmp.focus();
		return false;
	}
	else if(document.myform.txt_pur_add.value=="")
	{
		alert (" Please Enter Address ( Purchaser Information )");
		document.myform.txt_pur_add.focus();
		return false;
	}
	 else if(document.myform.txt_pur_city.value=="")
	{
		alert (" Please Enter Purchaser city ( Purchaser Information )");
		document.myform.txt_pur_city.focus();
		return false;
	}
	else if(document.myform.txt_pur_state.value=="")
	{
		alert (" Please Enter State ( Purchaser Information )");
		document.myform.txt_pur_state.focus();
		return false;
	}
	else if(document.myform.txt_pur_zip.value=="")
	{
		alert (" Please Enter Zip code ( Purchaser Information )");
		document.myform.txt_pur_zip.focus();
		return false;
	}
	else if(document.myform.txt_pur_phone.value=="")
	{
		alert (" Please Enter Phone Number ( Purchaser Information )");
		document.myform.txt_pur_phone.focus();
		return false;
	}
	else if(document.myform.txt_pur_email.value=="")
	{
		alert (" Please Enter Email Id ( Purchaser Information )");
		document.myform.txt_pur_email.focus();
		return false;
	}
	else if(document.myform.txt_emp_fname.value=="")
	{
		alert (" Please Enter First Name (Employer Information ).");
		document.myform.txt_emp_fname.focus();
		return false;
	}
	else if(document.myform.txt_emp_lname.value=="")
	{
		alert (" Please Enter Last Name (Employer Information ).");
		document.myform.txt_emp_lname.focus();
		return false;
	}
	else if(document.myform.txt_emp_comp.value=="")
	{
		alert (" Please Enter Company Name (Employer Information ).");
		document.myform.txt_emp_comp.focus();
		return false;
	}
	else if(document.myform.txt_emp_add.value=="")
	{
		alert (" Please Enter Address (Employer Information ).");
		document.myform.txt_emp_add.focus();
		return false;
	}
	
	else if(document.myform.txt_emp_city.value=="")
	{
		alert (" Please Enter City (Employer Information ).");
		document.myform.txt_emp_city.focus();
		return false;
	}
	else if(document.myform.txt_emp_state.value=="")
	{
		alert (" Please Enter State (Employer Information ).");
		document.myform.txt_emp_state.focus();
		return false;
	}
	else if(document.myform.txt_emp_zip.value=="")
	{
		alert (" Please Enter Zip code (Employer Information ).");
		document.myform.txt_emp_zip.focus();
		return false;
	}
		
	else if(document.myform.txt_emp_phone.value=="")
	{
		alert (" Please Enter Phone Number (Employer Information ).");
		document.myform.txt_emp_phone.focus();
		return false;
	}
	else if (document.myform.rdbus.selectedIndex==0)
	{
		alert (" Please Select the Business type");
		document.myform.rdbus.focus();
	 	return false;
	}
	else if(document.myform.txt_emp_fid.value=="")
	{
		alert (" Please enter the employer Federal Id");
		document.myform.txt_emp_fid.focus();
		return false;
	}
	else if ((document.myform.chkdate[0].checked==true) && (document.myform.txt_effdate.value==""))
	//else if (eff_date==-1)
	{
		alert (" Please Select the Effective Date.");
		document.myform.txt_effdate.focus();
	 	return false;
	}
	else if ((document.myform.chkdate[1].checked==true) && (document.myform.txt_effdate1.value==""))
	//else if (eff_date==-1)
	{
		alert (" Please Select the Effective Date.");
		document.myform.txt_effdate1.focus();
	 	return false;
	}
	
	else if ((document.myform.chkpdate[0].checked==true) && (document.myform.sdate.value==""))
	//else if (plan_date==-1)
	{
		alert (" Please Select the Beginning Plan date");
		document.myform.sdate.focus();
	 	return false;
	}
	else if ((document.myform.chkpdate[0].checked==true) && (document.myform.edate.value==""))
	//else if (plan_date==-1)
	{
		alert (" Please Select the Ending Plan date");
		document.myform.edate.focus();
	 	return false;
	}
	else if ((document.myform.chkpdate[1].checked==true) && (document.myform.sdate1.value==""))
	//else if (plan_date==-1)
	{
		alert (" Please Select the Beginning Plan date");
		document.myform.sdate1.focus();
	 	return false;
	}
	else if ((document.myform.chkpdate[1].checked==true) && (document.myform.edate1.value==""))
	//else if (plan_date==-1)
	{
		alert (" Please Select the Ending Plan date");
		document.myform.edate1.focus();
	 	return false;
	}

	else if (document.myform.hear_about.value=="angrej" && document.myform.otherhear.value=="")
	//else if (plan_date==-1)
	{
			alert (" Please Choose/Enter How did you hear about Core Documents?Option(s)");
			document.myform.hear_about.focus();
	 		return false;
	}
	
	else if (pack==0)
	{
		alert (" Please Choose Your Plan Option(s) ");
	 	return false;
	}
	else
	{
		return true;
	}
}

function radio_chk(obj)
{
var plan_date;
	for (k=0;k<document.myform.chkpdate.length;k++) 
			{ 
				if (document.myform.chkpdate[k].checked==true) 
				plan_date=k; 
			} 	
	if((plan_date==0) && (plan_date!=-1))
		{
			
			document.myform.sdate1.disabled=true;
			document.myform.edate1.disabled=true;
			document.myform.sdate.disabled=false;
			document.myform.edate.disabled=false;
			//if(document.myform.sdate.value=="") 
			//{
			//	alert("Please Enter the Plan date");
			//}
					//	document.myform.sdate.value=sd;
		}
		else
		{
			document.myform.sdate.disabled=true;
			document.myform.edate.disabled=true;
			document.myform.sdate1.disabled=false;
			document.myform.edate1.disabled=false;
			//if(document.myform.sdate1.value=="") 
			//{
			//	alert("Please Enter the Plan date");
			//}
			
		//	document.myform.sdate1.value=sd;
		}
}



function radio_chk1(obj)
{
var eff_date;
	for (j=0;j<document.myform.chkdate.length;j++) 
			{ 
				if (document.myform.chkdate[j].checked==true) 
				eff_date=j; 
			}  	
	if((eff_date==0) &&(eff_date!=-1))
		{
			
			document.myform.txt_effdate1.disabled=true;
			document.myform.txt_orginaldate.disabled=true;
			document.myform.txt_effdate.disabled=false;
			//if(document.myform.txt_effdate.value="")
			//{
			//alert("Please Enter the Effective date ");
			//}
			
		}
		else
		{
			
			document.myform.txt_effdate.disabled=true;
			document.myform.txt_effdate1.disabled=false;
			document.myform.txt_orginaldate.disabled=false;
			//if(document.myform.txt_effdate1.value="")
			//{
			//alert("Please Enter the Effective date ");
			//}
			
		//	document.myform.sdate1.value=sd;
		}
}


/*function focus2()
{
var plan_date;
	for (k=0;k<document.myform.chkpdate.length;k++) 
			{ 
				if (document.myform.chkpdate[k].checked==true) 
				plan_date=k; 
			} 	
	if((plan_date==0) &&(plan_date!=-1))
		{
		if(document.myform.edate.value=="")
			{
				alert("Please Enter the Plan End date");
				document.myform.edate.focus();
			}
		}
	else
		{
			if(document.myform.edate1.value=="")
			{
				alert("Please Enter the Plan End date");
				document.myform.edate1.focus();
			}
		}
}

function focus1()
{
var eff_date;
	for (j=0;j<document.myform.chkdate.length;j++) 
			{ 
				if (document.myform.chkdate[j].checked==true) 
				eff_date=j; 
			}  
	if (document.myform.txt_effdate.value!=""){			
		if((eff_date==0) &&(eff_date!=-1))
			{
					alert("Please Enter the Effective date ");
					document.myform.txt_effdate.focus();
				}
			}
	else
		{
			if(document.myform.txt_orginaldate.value=="")
			{
				alert("Please enter the original Date");
				document.myform.txt_orginaldate.focus();
			}
		}

}



/*function dated()
{
var plan_date;

	for (k=0;k<document.myform.chkpdate.length;k++) 
			{ 
				if (document.myform.chkpdate[k].checked==true) 
				plan_date=k; 
			} 	
	if((plan_date==0) &&(plan_date!=-1))
		{
			var sdate=document.myform.sdate.value;
			var edate=document.myform.edate.value;
			if(edate<=sdate)
			{	
				alert("Ending Date should be greater than Begining Date");
				document.myform.edate.value="";
				document.myform.edate.focus();
			}
			
		}
		else
		{
			var sdate1=document.myform.sdate1.value;
			var edate1=document.myform.edate1.value;
			if(edate1<=sdate1)
			{	
				alert("Ending Date should be greater than Begining Date");
				document.myform.edate1.value="";
				document.myform.edate1.focus();
			}
		}

}*/
