
<!-- Revision 1.2 - 05/28/2009 -->

var win=null;
function PopUpWindow(mypage,myname,w,h,scroll,pos)
{
	LeftPosition=(screen.width)?(screen.width-w)/2-14:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
	return false;
}

function Submit(stateName)
{
	document.frmStatesOfOperation.action = "https://loans.citifinancialauto.com/Application.asp?StateCd=" + stateName;
	document.frmStatesOfOperation.submit();
}

function SubmitOnRefi(stateName)
{
	document.frmStatesOfOperationRefi.action = "https://loans.citifinancialauto.com/Application.asp?StateCd=" + stateName;
	document.frmStatesOfOperationRefi.submit();
}



function ShowContinue(sProductLineId)
{
	
	
	if (sProductLineId == '1' ) 
	{	
	
		
		if((document.OnlineAppForm.PRI_CUR_YRS.value != "0") && (document.OnlineAppForm.PRI_CUR_EMP_YRS.value != "0") && (document.OnlineAppForm.TradeInIndicator[0].checked != true))
		{
	
			document.OnlineAppForm.SubmitPage2.value = "Submit";
			if (document.OnlineAppForm.indicatorOff3.width != 0)
			{
			
			
				AddEmailNewsLetter("tblEmailNewsletter");
				AddPrivacyPolicy("tblPrivacyPolicy");
				AddSpacer("tblSpacer")
			}
			document.OnlineAppForm.indicatorOff3.width = 0;
		}
		else
		{
			if (document.OnlineAppForm.SubmitPage2.value != "Continue")
			{
				RemoveRows("tblEmailNewsletter");
				RemoveRows("tblPrivacyPolicy");
				RemoveSpacer("tblSpacer");
			}
			document.OnlineAppForm.SubmitPage2.value = "Continue";
			document.OnlineAppForm.indicatorOff3.width = 56;
		}
	}
	else
	{
	
		if((document.OnlineAppForm.PRI_CUR_YRS.value != "0") && (document.OnlineAppForm.PRI_CUR_EMP_YRS.value != "0"))
		{
			document.OnlineAppForm.SubmitPage2.value = "Submit";
			if (document.OnlineAppForm.indicatorOff3.width != 0)
			{
				AddEmailNewsLetter("tblEmailNewsletter");
				AddPrivacyPolicy("tblPrivacyPolicy");
				AddSpacer("tblSpacer")
			}
			document.OnlineAppForm.indicatorOff3.width = 0;
		}
		else
		{
			if (document.OnlineAppForm.SubmitPage2.value != "Continue")
			{
				RemoveRows("tblEmailNewsletter");
				RemoveRows("tblPrivacyPolicy");
				RemoveSpacer("tblSpacer");
			}
			document.OnlineAppForm.SubmitPage2.value = "Continue";
			document.OnlineAppForm.indicatorOff3.width = 56;
		}
	}
}




function RemoveRows(sTableID)
{
	var oTable = window.document.getElementById(sTableID);
	oTable.deleteRow(1);
	oTable.deleteRow(0);
}




function AddPrivacyPolicy(sTableID)
{
	var oTable = window.document.getElementById(sTableID);
	var oRows = oTable.getElementsByTagName('tr');
	var oNewRow = oTable.insertRow(0);
	var oNewCell = oNewRow.insertCell();
	oNewCell.className = 'AppFormSectionTitle';
	oNewCell.colSpan = 3;
	oNewCell.innerHTML = 'Privacy Policy';
	var oNewRow2 = oTable.insertRow(1);
	var oNewCell1 = oNewRow2.insertCell();
	oNewCell1.width = 50;
	var oNewCell2 = oNewRow2.insertCell();
	oNewCell2.width = 20;
	var oNewCell3 = oNewRow2.insertCell();
	oNewCell3.className = 'AppFormText'
	var sinnerHTML = 'By clicking the "SUBMIT" button below, you - for a joint application both you and the co-applicant ("You") - certify that all of the statements in this application are true and complete and are made for the purpose of obtaining credit. You authorize CitiFinancial Auto to share the application and related information with its business partners in order to complete the processing of this application. You authorize CitiFinancial Auto and its business partners to retain and rely on this application, and to obtain additional information, including credit reports. You further authorize any lender who receives this application to inform CitiFinancial Auto of its credit decision.<br><br>'
	sinnerHTML = sinnerHTML + 'Applications submitted on the CitiFinancial Auto Web site are reviewed by CitiFinancial Auto Credit, Inc.<br><br>'
	oNewCell3.innerHTML = sinnerHTML + 'Click "SUBMIT" to process your application.'
}



function AddEmailNewsLetter(sTableID)
{
	var oTable = window.document.getElementById(sTableID);
	var oRows = oTable.getElementsByTagName('tr');
	var oNewRow = oTable.insertRow(0);
	var oNewCell = oNewRow.insertCell();
	oNewCell.className = 'AppFormSectionTitle';
	oNewCell.colSpan = 3;
	oNewCell.innerHTML = 'E-Mail Newsletter';
	var oNewRow2 = oTable.insertRow(1);
	var oNewCell1 = oNewRow2.insertCell();
	oNewCell1.width = 50;
	var oNewCell2 = oNewRow2.insertCell();
	oNewCell2.width = 20;
	oNewCell2.vAlign = 'top';
	oNewCell2.innerHTML = '<input type="checkbox" name="PVY_EML_OPT" id ="PVY_EML_OPT"  value="1" checked>';
	var oNewCell3 = oNewRow2.insertCell();
	oNewCell3.className = 'AppFormText'
	oNewCell3.innerHTML = 'Yes, I want to receive the CitiFinancial Auto Newsletter. This monthly update includes auto-related news, money saving tips and special offers from CitiFinancial Auto, its affiliates or third parties. I can discontinue my subscription at any time. My information will not be given to anyone.';
}



function RemoveSpacer(sTableID)
{
	var oTable = window.document.getElementById(sTableID);
	oTable.deleteRow(0);
}



function AddSpacer(sTableID)
{
	var oTable = window.document.getElementById(sTableID);
	var oNewRow = oTable.insertRow(0);
	var oNewCell = oNewRow.insertCell();
	oNewCell.innerHTML = '<img src=""images/spacer.gif"" width=""1"" height=""10"">';
}



function SubmitApplication(submitButton)
{
	document.OnlineAppForm.hdnTBD.name = submitButton.name;
	submitButton.disabled = true;
	document.OnlineAppForm.submit();
}
