function detailWindow(URL) {
		window.open(URL,"details","scrollbars, width=570, height=700");
	}

	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function bolFilter(form)
{
	var choice;
	choice = form.acctselect.value;
	switch (choice)
	{
	case "A" : location.href = "AccountActivityMortgage.html";
			   break;
	case "B" : location.href = "AccountActivityLine.html";
			   break;
	case "" : alert ('Please select an account.');
			   break;	   
	default : alert ('Please select an account.');
			   break;
	}			
	return true;
	
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function KIA_toggleLayers() { //Programmed by Kariże Idigoras, Sep 2000
  var i,v,obj,args=KIA_toggleLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) {
    if ((obj=MM_findObj(args[i]))!=null) {
      if (obj.style) {
        obj=obj.style;
        if (obj.visibility=='visible')
          obj.visibility='hidden';
        else if (obj.visibility=='hidden')
          obj.visibility='visible';
      }
      else {
        if (obj.visibility=='show')
          obj.visibility='hide';
        else if (obj.visibility=='hide')
          obj.visibility='show';
      }
    }
  }
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
  }
  return null;
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function getUnreadCount()
{
   var count = 0;
   var unreadcountStr = GetCookie("unreadcount");
   var endStr = unreadcountStr.indexOf(":");
   var lastendStr = unreadcountStr.lastIndexOf(":");
   var unreadcount = unreadcountStr.substring(0, endStr);
   count = unreadcountStr.substring((endStr + 1), lastendStr);
   return count;
}

function getGlobalCount()
{
   var unreadcountStr = GetCookie("unreadcount");
   var lastendStr = unreadcountStr.lastIndexOf(":");
   var globalcount = unreadcountStr.substring((lastendStr + 1), unreadcountStr.length);
   return globalcount;
}

//Begin Variables
var SecureWinHandle = null;
var SecureWinCloseAlertMessage = "Closing Parent Window will close the existing Dedicated Messaging Window";
//End Variables
//The smwinurl that is being passed should be a concatenation of
//SecureWinURL and the LOB_CODE that is being passed.

function openSecureWin( secureWinURL )
{
    	if ( secureWinURL == null  ||  secureWinURL == ""  ||   secureWinURL == "undefined")
   	{    		//alert("secureWinURL" + secureWinURL);
    	}
    	else
    	{
            if(document.layers)
    	    {
	  	SecureWinHandle = window.open(secureWinURL,'SecureMessagingWindow','width=650,height=500,screenX=150,screen=150,top=150,left=150,scrollbars=yes');
            }
            else {
		SecureWinHandle = window.open(secureWinURL,'SecureMessagingWindow','width=636,height=500,screenX=150,screen=150,top=150,left=150,scrollbars=yes');
	    }
	    SecureWinHandle.focus();
    	}
}

//The following function helps to reconfirm the closing of
//Child window. This feature is NOT a requirement but if there is an
//existing feature.

function confirmCloseSecureWin(){
  //The following might not work in IE 5.0, refer the following bug report
  //http://support.microsoft.com/default.aspx?scid=KB;en-us;q241109
  if(!SecureWinHandle.closed){
    if(confirm(SecureWinCloseAlertMessage))
    {
     //close Secure window

      closeSecureWin();
    }
  }
}

//The following function helps to close the secure messaging window
//if needed, The logoff will incorporate this method

function closeSecureWin(){
  if(SecureWinHandle && !SecureWinHandle.closed)
    SecureWinHandle.close();
}

/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/

var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
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);}

function isIns(form)
{
    if (form.ins.value == "1")
    {
        MM_showHideLayers('taxes','','hide','insurance','','show');
        return false;
    }
    return true;
}

function show(obj) {
  eval("document.all." + obj + ".style.display='block'");
   if(document.getElementById(obj).style.display == 'none'){
      document.getElementById(obj).style.display = 'block';
    }
}
function hide(obj) {
  eval("document.all." + obj + ".style.display='none'");
}



var imagenumber = 4 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "/images/LeftBanners/insurance2.gif"
images[2] = "/images/LeftBanners/vistabanner.gif"
images[3] = "/images/LeftBanners/creditcard.gif"
images[4] = "/images/LeftBanners/insurance3.gif"

var image = images[rand1]
links = new Array
links[1] = "/serv/serv/sec/Insurance.jsp"
links[2] = "http://www.chase.com/chase/gx.cgi/FTcs?pagename=Chase/Href&urlname=personal/prodservs/vistafunds"
links[3] = "http://creditcardsatchase.com"
links[4] = "/serv/serv/sec/Insurance.jsp"

var link = links[rand1]

// ******************************
//  toggleElements(section,action) function,
//	enablerArray data array
//
//	Usage:
//  Toggles access to conditional fields in an ADA-compliant way.
// 	'section' provides a handle to the data array row,
//	'action' is either "turnOn" or "turnOff" - indicates action to take on the form elements/labels
//
//  Data arrary format: 
//		1) form section name (handle by which function is called, identifies form elements and form label texts, 
//  	2) list of form elements (fields) to enable/disable, 
//		3) list of labels to toggle gray or black
// ******************************
// M.Mahoney 3/22/2005


var enablerArray = [
["Co_Borrower",
	["Co_Borrower_Name","Co_Borrower_Address","Co_Borrower_City","Co_Borrower_State","Co_Borrower_Zip","Co_Borrower_Home_Phone","Co_Borrower_Work_Phone","Co_Borrower_Cell_Phone", "Co_Borrower_Best_Number","Co_Borrower_Num_Household","Co_Borrower_Own_Rent","Co_Borrower_How_Long"],
	["Co_Borrower_Name_Label","Co_Borrower_Address_Label","Co_Borrower_City_Label","Co_Borrower_State_Label","Co_Borrower_Zip_Label","Co_Borrower_Home_Phone_Label","Co_Borrower_Work_Phone_Label","Co_Borrower_Cell_Phone_Label", "Co_Borrower_Best_Number_Label","Co_Borrower_Num_Household_Label","Co_Borrower_Own_Rent_Label","Co_Borrower_How_Long_Label"]],
["Property",
	["Property_Price","Property_Realator_Name","Property_Realator_Phone"],
	["Property_Price_Label","Property_Realator_Name_Label","Property_Realator_Phone_Label"]],
["Vehicle",
	["Vehicle_1_Model_YR","Vehicle_1_Value","Vehicle_2_Model_YR","Vehicle_2_Value","Vehicle_3_Model_YR","Vehicle_3_Value"],
	["Vehicle_Model_Year_Label","Vehicle_Value_Label","Vehicle_1_Label","Vehicle_2_Label","Vehicle_3_Label"]],
["OtherVehicle",
	["Vehicle_4","Vehicle_4_Model_YR","Vehicle_4_Value","Vehicle_5","Vehicle_5_Model_YR","Vehicle_5_Value","Vehicle_6","Vehicle_6_Model_YR","Vehicle_6_Value"],
	["OtherVehicle_Label","OtherVehicle_Model_Year_Label","OtherVehicle_Value_Label"]],
["AdditionalIncome",
	["Borrower_1_Type_Income_1","Borrower_1_Add_Take_Home_1","Borrower_1_Add_Often_Paid_1","Borrower_1_Type_Income_2","Borrower_1_Add_Take_Home_2","Borrower_1_Add_Often_Paid_2","Borrower_2_Type_Income_1","Borrower_2_Add_Take_Home_1","Borrower_2_Add_Often_Paid_1","Borrower_2_Type_Income_2","Borrower_2_Add_Take_Home_2","Borrower_2_Add_Often_Paid_2"],	
	["AdditionalIncomeType_Label","AdditionalIncomeAmount_Label","AdditionalIncomeFrequency_Label","AdditionalIncomeBorrower1_1_Label","AdditionalIncomeBorrower1_2_Label","AdditionalIncomeBorrower2_1_Label","AdditionalIncomeBorrower2_2_Label"]]
];

function toggleElements(section,action) {
	for (i = 0; i < enablerArray.length; i++) {
		// Which section are we talking about?
		if (enablerArray[i][0] == section) {
			for (j = 0; j < enablerArray[i][1].length; j++) {
				// enable or disable the input fields and make sure text is black (on) or wipe out text (off)
				var fieldStatus = eval('document.HOAForm.' + enablerArray[i][1][j]);
				if (action == "turnOff") {
					fieldStatus.value = "";				// wipe out any existing values
					fieldStatus.style.color="gray";		// eliminate 'ghost' text
					fieldStatus.disabled = true;
				} else if (action == "turnOn") {
					fieldStatus.style.color="black";
					fieldStatus.disabled = false;
				}

				// turn the actual input field background colors to white (on) or gray (off)
				var fieldBgColor = eval('document.HOAForm.' + enablerArray[i][1][j]);
				if (action == "turnOff") {
					fieldBgColor.style.backgroundColor = "gray";
				} else if (action == "turnOn") {
					fieldBgColor.style.backgroundColor = "white";
				}
			}

			for (k = 0; k < enablerArray[i][2].length; k++) {
				// turn any field label text items gray (off) or black (on)
				var label = enablerArray[i][2][k];
				if (action == "turnOff") {
					document.getElementById(label).style.color = "gray";
				} else if (action == "turnOn") {
					document.getElementById(label).style.color = "black";
				}
			}
			
			// if we've turned on the form elements in this section, then position cursor at the first field
			var firstFieldStatus = eval('document.HOAForm.' + enablerArray[i][1][0]);
			if (action == "turnOn") {
				firstFieldStatus.focus();			// put cursor in first field
			}
		}
	}
}
// End of function toggleElements(section,action)

// reusable select list option sets
var expenseOptions = 
'<option value=" " selected>  </option>' +
'<option value="Alimony/Child Support">Alimony/Child Support </option>' +
'<option value="Automobile gasoline">Automobile gasoline </option>' +
'<option value="Automobile insurance">Automobile insurance </option>' +
'<option value="Automobile loan">Automobile loan </option>' +
'<option value="Automobile maintenance">Automobile maintenance </option>' +
'<option value="Automobile parking">Automobile parking </option>' +
'<option value="Cable TV/Satellite">Cable TV/Satellite </option>' +
'<option value="Child care">Child care </option>' +
'<option value="Club and Union dues">Club and Union dues </option>' +
'<option value="Clubs, sports, hobbies">Clubs, sports, hobbies </option>' +
'<option value="Credit cards ">Credit cards  </option>' +
'<option value="Dental expense">Dental expense </option>' +
'<option value="Dry cleaning/Clothing/Uniforms">Dry cleaning/Clothing/Uniforms </option>' +
'<option value="Entertainment, Movies, Dinners, etc">Entertainment, Movies, Dinners, etc </option>' +
'<option value="Finance company/Installment loan">Finance company/Installment loan </option>' +
'<option value="Financial counsel">Financial counsel </option>' +
'<option value="Furniture/Appliances">Furniture/Appliances </option>' +
'<option value="Groceries">Groceries </option>' +
'<option value="Health insurance (not payroll deducted)">Health insurance (not payroll deducted) </option>' +
'<option value="Heating/Electricity">Heating/Electricity </option>' +
'<option value="Homeowners assoc special assesment">Homeowners assoc special assesment </option>' +
'<option value="Homeowners assoc/Condo fees">Homeowners assoc/Condo fees </option>' +
'<option value="IRA">IRA </option>' +
'<option value="IRS payments">IRS payments </option>' +
'<option value="Insurance (Non-primary residence)">Insurance (Non-primary residence) </option>' +
'<option value="Insurance (Pimary residence)">Insurance (Pimary residence) </option>' +
'<option value="Legal counsel">Legal counsel </option>' +
'<option value="Life insurance">Life insurance </option>' +
'<option value="Medical expenses">Medical expenses </option>' +
'<option value="Online service">Online service </option>' +
'<option value="Other expense">Other expense </option>' +
'<option value="Other loan">Other loan </option>' +
'<option value="Other mortgage">Other mortgage </option>' +
'<option value="Prescription drugs">Prescription drugs </option>' +
'<option value="Property maintenance (Non-primary residence)">Property maintenance (Non-primary residence) </option>' +
'<option value="Property maintenance (Primary residence)">Property maintenance (Primary residence) </option>' +
'<option value="Real estate taxes (Non-primary residence)">Real estate taxes (Non-primary residence) </option>' +
'<option value="Real estate taxes (Primary residence)">Real estate taxes (Primary residence) </option>' +
'<option value="Religious/Charitable contributions">Religious/Charitable contributions </option>' +
'<option value="Rent">Rent </option>' +
'<option value="Savings bonds">Savings bonds </option>' +
'<option value="School tuition">School tuition </option>' +
'<option value="Second mortgage/Home equity loan">Second mortgage/Home equity loan </option>' +
'<option value="Spending money">Spending money </option>' +
'<option value="Student loan ">Student loan  </option>' +
'<option value="Taxes on primary residence">Taxes on primary residence </option>' +
'<option value="Telephone/Pager/Cell Phone">Telephone/Pager/Cell Phone </option>' +
'<option value="Time-share property">Time-share property </option>' +
'<option value="Utilities (Non-primary residence)">Utilities (Non-primary residence) </option>' +
'<option value="Vacations">Vacations </option>' +
'<option value="Water/Sewage">Water/Sewage </option>';

var stateOptions =
'<option value=" ">  </option>' +
'<option value="AK">AK </option>' +
'<option value="AL">AL </option>' +
'<option value="AR">AR </option>' +
'<option value="AZ">AZ </option>' +
'<option value="CA">CA </option>' +
'<option value="CO">CO </option>' +
'<option value="CT">CT </option>' +
'<option value="DC">DC </option>' +
'<option value="DE">DE </option>' +
'<option value="FL">FL </option>' +
'<option value="GA">GA </option>' +
'<option value="HI">HI </option>' +
'<option value="IA">IA </option>' +
'<option value="ID">ID </option>' +
'<option value="IL">IL </option>' +
'<option value="IN">IN </option>' +
'<option value="KS">KS </option>' +
'<option value="KY">KY </option>' +
'<option value="LA">LA </option>' +
'<option value="MA">MA </option>' +
'<option value="MD">MD </option>' +
'<option value="ME">ME </option>' +
'<option value="MI">MI </option>' +
'<option value="MN">MN </option>' +
'<option value="MO">MO </option>' +
'<option value="MS">MS </option>' +
'<option value="MT">MT </option>' +
'<option value="NC">NC </option>' +
'<option value="ND">ND </option>' +
'<option value="NE">NE </option>' +
'<option value="NH">NH </option>' +
'<option value="NJ">NJ </option>' +
'<option value="NM">NM </option>' +
'<option value="NV">NV </option>' +
'<option value="NY">NY </option>' +
'<option value="OH">OH </option>' +
'<option value="OK">OK </option>' +
'<option value="OR">OR </option>' +
'<option value="PA">PA </option>' +
'<option value="RI">RI </option>' +
'<option value="SC">SC </option>' +
'<option value="SD">SD </option>' +
'<option value="TN">TN </option>' +
'<option value="TX">TX </option>' +
'<option value="UT">UT </option>' +
'<option value="VA">VA </option>' +
'<option value="VT">VT </option>' +
'<option value="WA">WA </option>' +
'<option value="WI">WI </option>' +
'<option value="WV">WV </option>' +
'<option value="WY">WY </option>';

var howLongOptions =
'<option value=" ">  </option>' +
'<option value="1 yr">1 yr </option>' +
'<option value="2 yrs">2 yrs </option>' +
'<option value="3 yrs">3 yrs </option>' +
'<option value="4 yrs">4 yrs </option>' +
'<option value="5 yrs">5 yrs </option>' +
'<option value="6 yrs">6 yrs </option>' +
'<option value="7 yrs">7 yrs </option>' +
'<option value="8 yrs">8 yrs </option>' +
'<option value="9 yrs">9 yrs </option>' +
'<option value="10 yrs">10 yrs </option>' +
'<option value="10+ yrs">10+ yrs </option>';

var payFrequencyOptions =
'<option value=" ">  </option>' +
'<option value="weekly">weekly </option>' +
'<option value="semi-monthly">semi-monthly </option>' +
'<option value="monthly">monthly </option>';

var incomeOptions =
'<option value=" ">  </option>' +
'<option value="alimony">alimony </option>' +
'<option value="child support">child support </option>' +
'<option value="disability">disability </option>' +
'<option value="other">other </option>' +
'<option value="pension">pension </option>' +
'<option value="rent">rent </option>' +
'<option value="retirement">retirement </option>' +
'<option value="social security">social security </option>' +
'<option value="trust fund">trust fund </option>' +
'<option value="unemployment">unemployment </option>' +
'<option value="workers compensation">workers compensation </option>';

var vehicleOptions =
'<option value=" ">  </option>' +
'<option value="Automobile">Automobile </option>' +
'<option value="Boat">Boat </option>' +
'<option value="Motorcycle">Motorcycle </option>' +
'<option value="Motorhome">Motorhome </option>' +
'<option value="Airplane">Airplane </option>';
