var totalprice = 0;
var reset_to = 0;
var packageprice = 0;
var selected_jur = "Temp";
function changeText2(chapters){
	document.getElementById('resultsChapters').innerHTML = chapters;
}

function changeText(pkginfo){
	document.getElementById('results').innerHTML = pkginfo;
}

function hidec13addon() {
	document.getElementById('resultsAddOnc13').innerHTML = " ";
}

function hidec7addon() {
	if(selected_jur=="cac") {
	} else {
	document.getElementById('resultsAddOnc7').innerHTML = " ";
	}
}

function addtoTotal(addto, district_name, lfurl){
	totalprice = addto+packageprice;
	document.getElementById('total_price').innerHTML = "<hr>Your current total is: $"+totalprice+"<br><p style='font-weight:normal'><em>Please note: prices do NOT include applicable sales tax or shipping</em></p>";

	
	document.getElementById('resultsAddOnc13').innerHTML = district_name + " Custom Chapter 13 Plan.<br><br><strong>$" + addto + "</strong><br><br> <a class=two target=_blank href='http://www.bestcase.com/localforms.htm#" + lfurl + "'>View Details</a>";
	selected_jur = lfurl;
}
function addtoTotalcac(addto, district_name, lfurl){
	var price = addto+totalprice;
	document.getElementById('total_price').innerHTML ="<hr>Your current total is: $"+price+"<br><p style='font-weight:normal'><em>Please note: prices do NOT include applicable sales tax or shipping</em></p>";

	document.getElementById('resultsAddOnc7').style.display = 'block';
	document.getElementById('resultsAddOnc7').innerHTML = district_name + " Local Forms Package.<br><br><strong>$" + addto + "</strong><br><br> <a class=two target=_blank href='http://www.bestcase.com/localforms.htm#" + lfurl + "'>View Details</a>";
	selected_jur = lfurl;
}
function resetTotal(reset_to){
	totalprice = reset_to;
	packageprice = reset_to;
	document.getElementById('total_price').innerHTML = "<hr>Your current total is: $"+totalprice+"<br><p style='font-weight:normal'><em>Please note: prices do NOT include applicable sales tax or shipping</em></p>";
	}
function resettoPkg() {
	document.getElementById('total_price').innerHTML = "<hr>Your current total is: $"+packageprice+"<br><p style='font-weight:normal'><em>Please note: prices do NOT include applicable sales tax or shipping</em></p>";
}
function iefix(optionValue)
{ selected_jur = optionValue;
	if (document.getElementById('chapter7').checked==true)
            {
								 switch( optionValue )
									{
										
										case "Temp" :
		
										break;
										
										case "cac" :
										
										addtoTotalcac(125.00, 'Central District of California', optionValue);
										
										break;
										
										default :
										document.getElementById('resultsAddOnc7').style.display = 'block';
										document.getElementById('resultsAddOnc7').innerHTML = "<a class=two target=_blank href='http://www.bestcase.com/localforms.htm#" + optionValue + "'>View Details on local forms for your jurisdiction offered by Best Case!</a>";
										resettoPkg();
									}
								            	
            	
  } else {
  

	switch( optionValue )
	{
		case "Temp" :
		
		hidec7addon();
		break;
		
		case "aln" :
		
		addtoTotal(150.00, 'Northern District of Alabama', optionValue);
		hidec7addon();
		break;
		
		case "alm" :
		
		addtoTotal(150.00, 'Middle District of Alabama', optionValue);
		hidec7addon();
		break;
		
		case "als" :
		
		addtoTotal(150.00, 'Southern District of Alabama', optionValue);
		hidec7addon();
		break;
		
		case "az" :
		
		addtoTotal(250.00, 'District of Arizona', optionValue);
		hidec7addon();
		break;
		
		case "ar" :
		
		addtoTotal(200.00, 'Eastern and Western Districts of Arkansas', optionValue);
		hidec7addon();
		break;
		
		case "ar" :
		
		addtoTotal(200.00, 'Eastern and Western Districts of Arkansas', optionValue);
		hidec7addon();
		break;
		
		case "cac" :
		
		addtoTotal(300.00, 'Central District of California', optionValue);
		addtoTotalcac(125.00, 'Central District of California', optionValue);
		break;
		
		case "cae" :
		
		addtoTotal(300.00, 'Eastern District of California', optionValue);
		hidec7addon();
		break;
		
		case "can" :
		
		addtoTotal(200.00, 'Northern District of California', optionValue);
		hidec7addon();
		break;
		
		case "cas" :
		
		addtoTotal(200.00, 'Southern District of California', optionValue);
		hidec7addon();
		break;
		
		case "co" :
		
		addtoTotal(150.00, 'District of Colorado', optionValue);
		hidec7addon();
		break;
		
		case "ct" :
		
		addtoTotal(150.00, 'District of Connecticut', optionValue);
		hidec7addon();
		break;

		
		case "dc" :
		
		addtoTotal(200.00, 'District of Colombia', optionValue);
		hidec7addon();
		break;
		
		case "de" :
		
		addtoTotal(250.00, 'District of Delaware', optionValue);
		hidec7addon();
		break;
		
		case "fln" :
		
		addtoTotal(100.00, 'Northern District of Florida', optionValue);
		hidec7addon();
		break;
		
		case "flm" :
		
		addtoTotal(250.00, 'Middle District of Florida', optionValue);
		hidec7addon();
		break;
		
		case "fls" :
		
		addtoTotal(150.00, 'Southern District of Florida', optionValue);
		hidec7addon();
		break;
		
		case "gan" :
		
		addtoTotal(150.00, 'Northern District of Georgia', optionValue);
		hidec7addon();
		break;
		
		case "gas" :
		
		addtoTotal(150.00, 'Southern District of Georgia', optionValue);
		hidec7addon();
		break;
		
		case "gam" :
		
		addtoTotal(150.00, 'Middle District of Georgia', optionValue);
		hidec7addon();
		break;
		
		case "hi" :
		
		addtoTotal(200.00, 'District of Hawaii', optionValue);
		hidec7addon();
		break;
		
		case "ida" :
		
		addtoTotal(200.00, 'District of Idaho', optionValue);
		hidec7addon();
		break;
		
		case "iln" :
		
		addtoTotal(250.00, 'Northern District of Illinois', optionValue);
		hidec7addon();
		break;
		
		case "ils" :
		
		addtoTotal(250.00, 'Southern District of Illinois', optionValue);
		hidec7addon();
		break;
		
		case "ins" :
		
		addtoTotal(200.00, 'Southern District of Indiana', optionValue);
		hidec7addon();
		break;
		
		case "kye" :
		
		addtoTotal(250.00, 'Eastern District of Kentucky', optionValue);
		hidec7addon();
		break;
		
		case "lae" :
		
		addtoTotal(100.00, 'Eastern District of Louisiana', optionValue);
		hidec7addon();
		break;
		
		case "lam" :
		
		addtoTotal(300.00, 'Middle District of Louisiana', optionValue);
		hidec7addon();
		break;
		
		case "law" :
		
		addtoTotal(200.00, 'Western District of Louisiana', optionValue);
		hidec7addon();
		break;
		
		case "md" :
		
		addtoTotal(150.00, 'District of Maryland', optionValue);
		hidec7addon();
		break;
		
		case "ma" :
		
		addtoTotal(200.00, 'District of Massachusetts', optionValue);
		hidec7addon();
		break;
		
		case "mie" :
		
		addtoTotal(300.00, 'Eastern District of Michigan', optionValue);
		hidec7addon();
		break;
		
		case "miw" :
		
		addtoTotal(300.00, 'Eastern District of Michigan', optionValue);
		hidec7addon();
		break;
		
		case "mn" :
		
		addtoTotal(150.00, 'District of Minnesota', optionValue);
		hidec7addon();
		break;
		
		case "msa" :
		
		addtoTotal(150.00, 'Northern District of Mississippi', optionValue);
		hidec7addon();
		break;
		
		case "msa" :
		
		addtoTotal(150.00, 'Southern District of Mississippi', optionValue);
		hidec7addon();
		break;
		
		case "moe" :
		
		addtoTotal(150.00, 'Eastern District of Missouri', optionValue);
		hidec7addon();
		break;
		
		case "mow" :
		
		addtoTotal(200.00, 'Western District of Missouri', optionValue);
		hidec7addon();
		break;
		
		case "mt" :
		
		addtoTotal(200.00, 'District of Montana', optionValue);
		hidec7addon();
		break;
		
		case "ne" :
		
		addtoTotal(150.00, 'District of Nebraska', optionValue);
		hidec7addon();
		break;
		
		case "nv" :
		
		addtoTotal(300.00, 'District of Nevada', optionValue);
		hidec7addon();
		break;
		
		case "nh" :
		
		addtoTotal(250.00, 'District of New Hampshire', optionValue);
		hidec7addon();
		break;
		
		case "nj" :
		
		addtoTotal(200.00, 'District of New Jersey', optionValue);
		hidec7addon();
		break;
		
		case "nm" :
		
		addtoTotal(200.00, 'District of New Mexico', optionValue);
		hidec7addon();
		break;
		
		case "nye" :
		
		addtoTotal(150.00, 'Eastern District of New York', optionValue);
		hidec7addon();
		break;
		
		case "nys" :
		
		addtoTotal(250.00, 'Southern District of New York', optionValue);
		hidec7addon();
		break;
		
		case "nyw" :
		
		addtoTotal(200.00, 'Western District of New York', optionValue);
		hidec7addon();
		break;
		
		case "nce" :
		
		addtoTotal(200.00, 'Eastern District of North Carolina', optionValue);
		hidec7addon();
		break;
		
		case "ncw" :
		
		addtoTotal(150.00, 'Western District of North Carolina', optionValue);
		hidec7addon();
		break;
		
		case "ncm" :
		
		addtoTotal(150.00, 'Middle District of North Carolina', optionValue);
		hidec7addon();
		break;
		
		case "ohn" :
		
		addtoTotal(200.00, 'Northern District of Ohio', optionValue);
		hidec7addon();
		break;
		
		case "ohs" :
		
		addtoTotal(300.00, 'Southern District of Ohio', optionValue);
		hidec7addon();
		break;
		
		case "or" :
		
		addtoTotal(150.00, 'District of Oregon', optionValue);
		hidec7addon();
		break;
		
		case "pam" :
		
		addtoTotal(150.00, 'Middle District of Pennsylvania', optionValue);
		hidec7addon();
		break;
		
		case "paw" :
		
		addtoTotal(150.00, 'Western District of Pennsylvania', optionValue);
		hidec7addon();
		break;
		
		case "pra" :
		
		addtoTotal(150.00, 'District of Puerto Rico', optionValue);
		hidec7addon();
		break;
		
		case "ria" :
		
		addtoTotal(200.00, 'District of Rhode Island', optionValue);
		hidec7addon();
		break;
		
		case "sc" :
		
		addtoTotal(150.00, 'District of South Carolina', optionValue);
		hidec7addon();
		break;
				
		case "tne" :
		
		addtoTotal(100.00, 'Eastern District of Tennessee', optionValue);
		hidec7addon();
		break;
		
		case "tnw" :
		
		addtoTotal(150.00, 'Western District of Tennessee', optionValue);
		hidec7addon();
		break;
		
		case "tnm" :
		
		addtoTotal(150.00, 'Middle District of Tennessee', optionValue);
		hidec7addon();
		break;
		
		case "txe" :
		
		addtoTotal(150.00, 'Eastern District of Texas', optionValue);
		hidec7addon();
		break;
		
		case "txn" :
		
		addtoTotal(300.00, 'Northern District of Texas', optionValue);
		hidec7addon();
		break;
		
		case "txs" :
		
		addtoTotal(200.00, 'Southern District of Texas', optionValue);
		hidec7addon();
		break;
		
		case "txw" :
		
		addtoTotal(250.00, 'Western District of Texas', optionValue);
		hidec7addon();
		break;
		
		case "uta" :
		
		addtoTotal(100.00, 'District of Utah', optionValue);
		hidec7addon();
		break;
		
		case "vt" :
		
		addtoTotal(150.00, 'District of Vermont', optionValue);
		hidec7addon();
		break;
		
		case "via" :
		
		addtoTotal(150.00, 'District of the Virgin Islands', optionValue);
		hidec7addon();
		break;
		
		case "va" :
		
		addtoTotal(200.00, 'Eastern District of Virginia', optionValue);
		hidec7addon();
		break;
		
		case "va" :
		
		addtoTotal(200.00, 'Western District of Virginia', optionValue);
		hidec7addon();
		break;
		
		case "wae" :
		
		addtoTotal(200.00, 'Eastern District of Washington', optionValue);
		hidec7addon();
		break;
		
		case "waw" :
		
		addtoTotal(200.00, 'Western District of Washington', optionValue);
		hidec7addon();
		break;
		
		case "wvn" :
		
		addtoTotal(250.00, 'Northern District of West Virginia', optionValue);
		hidec7addon();
		break;
		
		case "wvs" :
		
		addtoTotal(150.00, 'Southern District of West Virginia', optionValue);
		hidec7addon();
		break;
		
		case "wie" :
		
		addtoTotal(150.00, 'Eastern District of Wisconsin', optionValue);
		hidec7addon();
		break;
		
		default :
		
		document.getElementById('resultsAddOnc13').innerHTML = "<a class=two target=_blank href='http://www.bestcase.com/localforms.htm#" + optionValue + "'>View Details on local forms for your jurisdiction offered by Best Case!</a>";
		resettoPkg();
		hidec7addon();
		
		
	}

}
}

function hideobjects() 
{
document.getElementById('suc7').style.display = 'none';
document.getElementById('suc13').style.display = 'none';
document.getElementById('suall').style.display = 'none';
document.getElementById('muc7').style.display = 'none';
document.getElementById('muc13').style.display = 'none';
document.getElementById('muall').style.display = 'none';
document.getElementById('tab3').style.display = 'none';

document.getElementById('results').innerHTML = ' ';
document.getElementById('resultsChapters').innerHTML = ' ';
document.getElementById('resultsAddOnc7').innerHTML = ' ';
document.getElementById('resultsAddOnc13').innerHTML = ' ';


document.getElementById('tab1').style.display = 'block'
}

function clearprice(version) 
{

document.getElementById('suc7').style.display = 'none';
document.getElementById('suc13').style.display = 'none';
document.getElementById('suall').style.display = 'none';
document.getElementById('muc7').style.display = 'none';
document.getElementById('muc13').style.display = 'none';
document.getElementById('muall').style.display = 'none';

pkgs();

}
function pkgs() {
if (document.getElementById('singleuserrb').checked==true)
 		{
		if (document.getElementById('chapter7').checked==true)
			{
			document.getElementById('suc7').style.display = 'block';
			document.getElementById('suc13').style.display = 'none';
			document.getElementById('suall').style.display = 'none';
			document.getElementById('tab3').style.display = 'block';
			changeText('<strong>Single User License</strong><br><ul style="font-weight:normal;"><li>allows one attorney</li><li>one support worker</li><li>one office location</strong></li></ul>');
			changeText2('Chapter 7 Only - $900');
			resetTotal(900.00);
			iefix(selected_jur);
			hidec13addon();
			}
			if(document.getElementById('chapter13').checked==true) {
			document.getElementById('suc13').style.display = 'block';
			document.getElementById('suc7').style.display = 'none';
			document.getElementById('suall').style.display = 'none';
			document.getElementById('tab3').style.display = 'block';
			changeText('<strong>Single User License</strong><br><ul style="font-weight:normal;"><li>allows one attorney</li><li>one support worker</li><li>one office location</strong></li></ul>');
			changeText2('Chapters 7 & 13 - $1100');
			resetTotal(1100.00);
			iefix(selected_jur);
			hidec7addon();
			} 
			if(document.getElementById('chapterALL').checked==true) {
			document.getElementById('suall').style.display = 'block';
			document.getElementById('suc13').style.display = 'none';
			document.getElementById('suc7').style.display = 'none';
			document.getElementById('tab3').style.display = 'block';
			changeText('<strong>Single User License</strong><br><ul style="font-weight:normal;"><li>allows one attorney</li><li>one support worker</li><li>one office location</strong></li></ul>');
			changeText2('Chapters 7, 11, 12 & 13 - $1300');
			resetTotal(1300.00);
			iefix(selected_jur);
			hidec7addon();
			}
		
}
if (document.getElementById('multiuserrb').checked==true)
 		{	
	if (document.getElementById('chapter7').checked==true)
			{
			document.getElementById('muc7').style.display = 'block';
			document.getElementById('muc13').style.display = 'none';
			document.getElementById('muall').style.display = 'none';
			document.getElementById('tab3').style.display = 'block';
			changeText('<strong>Multi-User License</strong><br><ul style="font-weight:normal;"><li>Allows everone from one office location</li><li>three simultaneous users across a local area network</li></ul>');
			changeText2('Chapter 7 Only - $1400');
			resetTotal(1400.00);
			iefix(selected_jur);
			hidec13addon();
		  }
		  if(document.getElementById('chapter13').checked==true)
		  {
		  document.getElementById('muc13').style.display = 'block';
		  document.getElementById('muc7').style.display = 'none';
		  document.getElementById('muall').style.display = 'none';
		  document.getElementById('tab3').style.display = 'block';
		  changeText('<strong>Multi-User License</strong><br><ul style="font-weight:normal;"><li>Allows everone from one office location</li><li>three simultaneous users across a local area network</li></ul>');
		  changeText2('Chapters 7 & 13 - $1600');
		  resetTotal(1600.00);
		  iefix(selected_jur);
		  hidec7addon();
		  } 
		  if(document.getElementById('chapterALL').checked==true)
		  {
		  document.getElementById('muall').style.display = 'block';
		  document.getElementById('muc13').style.display = 'none';
		  document.getElementById('muc7').style.display = 'none';
		  document.getElementById('tab3').style.display = 'block';
		  changeText('<strong>Multi-User License</strong><br><ul style="font-weight:normal;"><li>Allows everone from one office location</li><li>three simultaneous users across a local area network</li></ul>');
		  changeText2('Chapters 7, 11, 12 & 13 - $1800');
		  resetTotal(1800.00);
		  iefix(selected_jur);
		  hidec7addon();
		  }
}
}

function clearForms()
{
  var i;
  for (i = 0; (i < document.forms.length); i++) {
    document.forms[i].reset();
  }
}
function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt);return false;
    }
  else
    {
    return true;
    }
  }
}

function validate_form(thisform)
{
with (thisform)
  {
  if (validate_required(url,"Please Select a Jurisdiction!")==false)
  {email.focus();return false;}
  }
}