// This is a javascript library containing various javascript //functions

function edit_fields(field1, field2)
{
	var fldName = field1.name;
	var formName = field1.form.name;
	
	if ((field1.value.length > 0) && (field2.value.length > 0))
	{
		if (isSpaces(field1.value))
			return;

		if (isSpaces(field2.value))
			return;
		
		alert("You have entered data in both the 'business' and 'personal name' fields." + "\n" + "Please enter data in one field only!");
		field1.value = field1.defaultValue;
		setTimeout("doSelection(document." + formName + "." + fldName + ")", 0);
	}
}

function compare_fields(field1, field2, error_num)
{
	var fldName = field1.name;
	var formName = field1.form.name;
	
	if ((field1.value.length > 0) && (field2.value.length > 0))
	{
		if (isSpaces(field1.value))
			return;

		if (isSpaces(field2.value))
			return;
			
		switch (error_num)
		{
			case 1:
				alert("You have entered data in both the 'business' and 'personal' name fields." + "\n" + "Please enter data in one field only!");
				field1.value = field1.defaultValue;
				setTimeout("doSelection(document." + formName + "." + fldName + ")", 0);
				break;
			case 2:
				alert("You have entered data in both the 'individual owner' and 'Florida Document Number' fields." + "\n" + "'Florida Document Number' only applies to owners other than an individual");
				field1.value = field1.defaultValue;
				setTimeout("doSelection(document." + formName + "." + fldName + ")", 0);
				break;
			case 3:
				alert("You have entered data in both the 'individual debtor' and 'FEI Number' fields." + "\n" + "'FEI Number' only applies to owners other than an individual");
				field1.value = field1.defaultValue;
				setTimeout("doSelection(document." + formName + "." + fldName + ")", 0);
				break;
			case 4:
				alert("You have entered data in both the 'individual debtor' and 'DOS Document Number' fields." + "\n" + "'DOS Document Number' only applies to owners other than an individual");
				field1.value = field1.defaultValue;
				setTimeout("doSelection(document." + formName + "." + fldName + ")", 0);
				break;
			case 5:
				alert("You have entered data in both the 'individual owner' and 'FEI Number' fields." + "\n" + "'FEI Number' only applies to owners other than an individual");
				field1.value = field1.defaultValue;
				setTimeout("doSelection(document." + formName + "." + fldName + ")", 0);
				break;
			default:
				alert("Invalid error number");
				break;		
		}
	}
}


function doSelection(field1)
	{
	field1.focus();
	field1.select();
	}
	
function isSpaces(inputStr)
{
	for (var i = 0; i < inputStr.length; i++)
	{
		if (inputStr.charAt(i) != " ")
			return false;
	}
	return true;
}

function review_document_alert()
{
	alert("Please review the filing for accuracy. If you need to make corrections, do so at this time. The filing information will be added/edited exactly as you have entered it. Once you have submitted the information, your filing cannot be updated, removed, cancelled or refunded.");
}

function llc_ar_fee_alert()
{
	alert("The fee to file a 2008 Limited Liability Company Annual Report is $138.75.  Pursuant to section 607.193, F.S., a limited liability company must now pay an $88.75 supplemental fee in addition to the $50 filing fee required by section 608.452, F.S. ");
}

function accept_disclaimer_alert()
{
	if (document.form1.disclaimer_read.checked == false)
	{
		alert ('You must check the box indicating that you accept the terms of the disclaimer in order to continue.');
		return(false);
	}
	else
	{
		return(true);
	}
}

function copyPrincToMail()
{

	if (document.filingform.same_addr_flag.checked == true)
	{
		document.filingform.mail_addr1.value=document.filingform.princ_addr1.value;
		document.filingform.mail_addr2.value=document.filingform.princ_addr2.value;
		document.filingform.mail_city.value=document.filingform.princ_city.value;
		document.filingform.mail_st.value=document.filingform.princ_st.value;
		document.filingform.mail_zip.value=document.filingform.princ_zip.value;
		document.filingform.mail_cntry.value=document.filingform.princ_cntry.value;
	}
	if (document.filingform.same_addr_flag.checked == false)
	{
		document.filingform.mail_addr1.value="";
		document.filingform.mail_addr2.value="";
		document.filingform.mail_city.value="";
		document.filingform.mail_st.value="";
		document.filingform.mail_zip.value="";
		document.filingform.mail_cntry.value="";
	}

}

function ubrcopyPrincToMail()
{

	if (document.arform.same_addr_flag.checked == true)
	{
		document.arform.ar_old_mail_addr1.value=document.arform.ar_old_princ_addr1.value;
		document.arform.ar_old_mail_addr2.value=document.arform.ar_old_princ_addr2.value;
		document.arform.ar_old_mail_city.value=document.arform.ar_old_princ_city.value;
		document.arform.ar_old_mail_st.value=document.arform.ar_old_princ_st.value;
		document.arform.ar_old_mail_zip.value=document.arform.ar_old_princ_zip.value;
		document.arform.ar_old_mail_cntry.value=document.arform.ar_old_princ_cntry.value;
	}
	if (document.arform.same_addr_flag.checked == false)
	{
		document.arform.ar_old_mail_addr1.value="";
		document.arform.ar_old_mail_addr2.value="";
		document.arform.ar_old_mail_city.value="";
		document.arform.ar_old_mail_st.value="";
		document.arform.ar_old_mail_zip.value="";
		document.arform.ar_old_mail_cntry.value="";
	}

}

function displayPurposeText()
{
	if (document.filingform.purpose_flag.checked == true)
	{
		document.filingform.purpose.value="Any and all lawful business.";
	}
	if (document.filingform.purpose_flag.checked == false)
	{
		document.filingform.purpose.value="";
	}
}

function displayByLawsText()
{
	if (document.filingform.bylaws_flag.checked == true)
	{
		document.filingform.manner_dir_elected.value="As provided for in the bylaws.";
	}
	if (document.filingform.bylaws_flag.checked == false)
	{
		document.filingform.manner_dir_elected.value="";
	}
}

function displayCertOfStatusEmail_alert()
{
	if (document.arform.ar_cert_flag.checked == true)
	{
		alert ("The certificate of status you are requesting will be sent as an attachment to the e-mail address you will enter next. Please add CORWEBCUS to your address book to ensure delivery.");
		return(true); 
	}
	else
	{
		return(false);
	} 
}

function clearField(theText) 
{
     if (theText.value == theText.defaultValue)
     {
         theText.value = ""
     }
}

function openwindowEffDate()
{
     window.open("/EffectiveDate.html","mywindow","scrollbars=1,resizable=1,width=400,height=400");
}

function openwindowLP_EffDate()
{
     window.open("/LP_EffectiveDate.html","mywindow","scrollbars=1,resizable=1,width=400,height=420");
}

function openwindowLLC_EffDate()
{
     window.open("/LLC_EffectiveDate.html","mywindow","scrollbars=1,resizable=1,width=400,height=450");
}

function openwindowCertOfStatus()
{
     window.open("/CertOfStatus.html","mywindow","scrollbars=1,resizable=1,width=400,height=180");
}

function openwindowLLC_CertOfStatus()
{
     window.open("/LLC_CertOfStatus.html","mywindow","scrollbars=1,resizable=1,width=350,height=190");
}

function openwindowLP_CertOfStatus()
{
     window.open("/LP_CertOfStatus.html","mywindow","scrollbars=1,resizable=1,width=350,height=190");
}

function openwindowCertCopy()
{
     window.open("/CertifiedCopy.html","mywindow","scrollbars=1,resizable=1,width=350,height=150");
}

function openwindowLP_CertCopy()
{
     window.open("/LP_CertifiedCopy.html","mywindow","scrollbars=1,resizable=1,width=350,height=150");
}

function openwindowLLC_CertCopy()
{
     window.open("/LLC_CertifiedCopy.html","mywindow","scrollbars=1,resizable=1,width=350,height=150");
}

function openwindowCorp_StkShares()
{
     window.open("/Corp_StkShares.html","mywindow","scrollbars=1,resizable=1,width=400,height=435");
}

function openwindowRA()
{
     window.open("/RegisteredAgent.html","mywindow","scrollbars=1,resizable=1,width=400,height=380");
}

function openwindowJlienDOSNum()
{
     window.open("/JlienDosNum.html","mywindow","scrollbars=1,resizable=1,width=400,height=170");
}

function openwindowLLC_MGRM_MGR()
{
     window.open("/LLC_MGRM_MGR.html","mywindow","scrollbars=1,resizable=1,width=350,height=280");
}

function openwindowFicRen_CertOfStatus()
{
     window.open("/FicRen_CertOfStatus.html","mywindow","scrollbars=1,resizable=1,width=350,height=190");
}

function openwindowFicRen_CertCopy()
{
     window.open("/FicRen_CertifiedCopy.html","mywindow","scrollbars=1,resizable=1,width=350,height=190");
}
