function showIRC() 
{
	var message = "The following information(s) is required/incorrect: \n";
	var dy = document.frm_quote_form.Birthday.value;
	var mn = document.frm_quote_form.BirthMonth.value;
	var yr = document.frm_quote_form.BirthYear.value;

	test_date_val = testDate(dy,mn,yr, "Date of Birth");
	if(test_date_val != "Valid")
	{
		message = message + " -" + test_date_val + "\n";
	}

	if(message == "The following information(s) is required/incorrect: \n")
	{
		var link_var = "http://quotes.lifeinsure.com/help/show_IRC.php?BirthMonth="+ document.frm_quote_form.BirthMonth.value + 
			"&Birthday=" + document.frm_quote_form.Birthday.value + 
			"&BirthYear=" + document.frm_quote_form.BirthYear.value + 
			"&State=" + document.frm_quote_form.State.value + 
			"&Health=PP&Category=A&FaceAmount=0&IncReplace1=Calculator";
		if(document.frm_quote_form.Sex[0].checked)
			link_var += "&Sex=M";
		else
			link_var += "&Sex=F";
		if(document.frm_quote_form.Smoker[0].checked)
			link_var += "&Smoker=N";
		else
			link_var += "&Smoker=Y";
	
        if( window.ircWindow && ircWindow.closed == false )
	      ircWindow.close();
        ircWindow = window.open("" + link_var + "","IncomeReplacementCalc","alwaysRaised=yes,dependent=yes,height=370,screenx=500,location=no,menubar=no,screeny=230,width=440,scrollbars=yes");
	}
	else
		alert (message);
}
function testDate(day,month,year,field)
	{
	dayy = new String(day);
	monthh = new String(month);
	yearr = new String(year);

	if(isNaN(dayy) || isNaN(monthh) || isNaN(yearr))
	{
		return ("Enter valid " + field);
	}
	else if(dayy == "" || month == "" || yearr == "")
	{
		return ("Enter complete " + field);
	}
	var datee = new String(dayy + "/" + monthh + "/" + yearr);
	var monthDay = new Array([1,31],[2,28],[3,31],[4,30],[5,31],[6,30],[7,31],[8,31],[9,30],[10,31],[11,30],[12,31])

	if(month < 1 || month > 12)
	  {
	  return ("Invalid month selection for " + field + ".");
	  }
	 if(day > monthDay[month-1][1])
  	     {
  	       if(month == 2  && year%4 == 0 && day == 29)
		   {
			return("Valid");
		   }
		   else
    	   {
		  	return("Invalid days for the selected month in " + field + ".");
		   }
	    }
	  else
	    {
	    	return ("Valid");
	    }

	return("Valid");
}

function validate_form()
{
	var message = "The following information(s) is required/incorrect: \n";
	var dy = document.frm_quote_form.Birthday.value;
	var mn = document.frm_quote_form.BirthMonth.value;
	var yr = document.frm_quote_form.BirthYear.value;
	test_date_val = testDate(dy,mn,yr, "Date of Birth");
	if(test_date_val != "Valid")
	{
		message = message + " -" + test_date_val + "\n";
	}

	if(document.frm_quote_form.Weight.value == -1)
		message = message + " -Select your weight.\n";
		
	document.frm_quote_form.parm3.value = document.frm_quote_form.Weight.value;
	document.frm_quote_form.parm4.value = document.frm_quote_form.Feet.value;
	document.frm_quote_form.parm5.value = document.frm_quote_form.Inches.value;

	document.frm_quote_form.parm1.value = "Universal Life";
	catg = document.frm_quote_form.Catagory.value;
	if(catg == "J")
		document.frm_quote_form.parm1.value = "15 Year";
	else if(catg == "K")
		document.frm_quote_form.parm1.value = "20 Year";
	else if(catg == "L")
		document.frm_quote_form.parm1.value = "20 Year";
	else if(catg == "M")
		document.frm_quote_form.parm1.value = "30 Year";

	//document.frm_quote_form.parm2.value = "Universal Life";
	if(message == "The following information(s) is required/incorrect: \n")
		return true;
	else
		alert (message);
	return false;
}