if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;


/*
META TAGS CONTENT AND DESCRIPTION BELOW
META TAGS CONTENT AND DESCRIPTION BELOW
META TAGS CONTENT AND DESCRIPTION BELOW
*/
document.write('<meta name="keywords" content="Capital Communications Federal Credit Union, Bank, capcomfinancial, A financial institution of excellence, featuring secure Internet-based services including Home Banking, Bill Payment, Bill Presentment, Quicken and Money interfaces, Stock Quotes, on-line applications, financial calculators, useful links and a wealth of financial information">');


document.write('<meta name="description" content="ATM, ATM Locations, Account Access, Account Transfer, Automobile Loans, AutoVantage, Bank, Bank Account, Banking, Bill Payment, Bill Presentment, Brokerage, Cash, CDs, Certificates of Deposit, Checks, Checking Accounts, Consumer Loans, Convenience Services, Credit, Credit Card, Credit Card Applications, Credit Union, Digital Insight, Finance, Financial Calculator, Financial Institution, Financial Wizard, Loans, Home Loans, IRA, Money, Term Investment, Online Banking, Order Checks, Personal Financial Management, Rates, Mortgage Rates, Loan Rates, Terms, Retirement, Savings Accounts, Savings, Savings and Loan, Stock Quotes, Stocks, Student Loans, Student, Term Share Certificates, Thrifts, Visa Credit Cards">');
/*
META TAGS CONTENT AND DESCRIPTION ABOVE
META TAGS CONTENT AND DESCRIPTION ABOVE
META TAGS CONTENT AND DESCRIPTION ABOVE
*/


/*
CALL TO CORRECT DIRECTORY
CALL TO CORRECT DIRECTORY
CALL TO CORRECT DIRECTORY
CALL TO CORRECT DIRECTORY
*/


//if you are on homepage you need <script> var homepage = "yes";</script> to make codework properly

var imgdir;
var sitedir;
var securedir;
var homedir;

if(window.homepage)
{
imgdir="images/";
sitedir="site/";
securedir="site/";
homedir="";
}
else if(window.absolutepage)
{
imgdir="http://www.capcomfinancial.com/images/"
sitedir="http://www.capcomfinancial.com/site/"
securedir="http://www.capcomfinancial.com/site/"
homedir="http://www.capcomfinancial.com/"
}
else if(window.securepage)
{
imgdir="https://www.capcomfinancial.com/images/"
sitedir="http://www.capcomfinancial.com/site/"
securedir="https://www.capcomfinancial.com/site/"
homedir="http://www.capcomfinancial.com/"
}
else
{
imgdir="../images/";
sitedir="../site/";
securedir="../site/";
homedir="../";
}


function showCalc(calc)
{
	location.href=calc;
}

function tabover(howmuch)
{
var farover = '';
farover += '<img src="../images/clearpix.gif" width="' + howmuch + '" height="1" alt="Clearpix" border="0">';
document.write(farover);
}

function open_apps(nameofapp)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 350)
var pHeight = (((parseInt(screen.height) / 2)) - 300)
aWindow = window.open('https://www.capcomfinancial.org/Forms/OnlineForm.cgi?form=' + nameofapp,'application',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=700,height=600,top=" + pHeight + ",left=" + pWidth + ",scrollbars=1,resizable=1,status=1");
}

function third_party(page)
{
var pWidth = ( ((parseInt(screen.width) / 2)) - 300)
var pHeight = (((parseInt(screen.height) / 2)) - 200)

bWindow = window.open(page,'thirdpartywin',"toolbar=0,location=0,directories=0,status=0,menubar=0,width=600,height=180,top=" + pHeight + ",left=" + pWidth);
	bWindow = null;
	return;
}

function newWindow(page)
{
bWindow = window.open(page,'newWin');
	bWindow = null;
	return;
}

// ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW
// ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW
// ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW ROLLOVER CODE BELOW


browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (((browserName == "Netscape") && (browserVer >= 3)) || ((browserName =="Microsoft Internet Explorer") && (browserVer >= 4)))
{
version = "ok";

one_on = new Image(15,17);
one_on.src = imgdir + "keyin-1-on.gif";

one_off = new Image(15,17);
one_off.src = imgdir + "keyin-1-off.gif";

two_on = new Image(15,17);
two_on.src = imgdir + "keyin-2-on.gif";

two_off = new Image(15,17);
two_off.src = imgdir + "keyin-2-off.gif";

three_on = new Image(15,17);
three_on.src = imgdir + "keyin-3-on.gif";

three_off = new Image(15,17);
three_off.src = imgdir + "keyin-3-off.gif";

four_on = new Image(15,17);
four_on.src = imgdir + "keyin-4-on.gif";

four_off = new Image(15,17);
four_off.src = imgdir + "keyin-4-off.gif";

}
else
version = "x";

function img_act(imgName)
{
if (version == "ok")
{
imgOn = eval(imgName + "_on.src");
document [imgName].src = imgOn;
}
}

function img_inact(imgName)
{
window.status = "";
 if (version == "ok")
{
imgOff = eval(imgName + "_off.src");
document [imgName].src = imgOff;
}
}

function writeImage() {
      var alt="Home Page Image";
       var border = 0;
       var width=422; // default
       var height=185; // default
       var imageArray = new Array(
        "images/pic-home1.jpg",
        "images/pic-home2.jpg",
        "images/pic-home3.jpg",
        "images/pic-home4.jpg");
        var numImages = imageArray.length;
        var iteratorNum = ( rand(numImages) - 1); //-1 to take into account that array starts at 0
        var imgCode='<img src="' + imageArray[iteratorNum] + '" width="'+ width +'" height="'+ height +'" alt="' + alt + '" title="" border="' + border + '" />';
        document.write(imgCode);
    }//end writeImage

    function rand(number) {
      return Math.ceil((Math.random()* number));
    }



// ** FORM VALIDATION FUNCTIONS ** 
  function isFilled(elm,minsize) {
    if (!minsize)  minsize = 1;
    return (elm.value=="" || elm.value==null || elm.value.length<minsize) ? false : true;
  }
  function isPhone(elm,numType) {
  // numType either blank or not set to "full"
    var pattern = /(^[0-9]{3}[\-\.][0-9]{4}$)|([0-9]{3}[\-\.][0-9]{3}[\-\.][0-9]{4})/; 
    // US area code optional
    if (numType=="full") {
      pattern = /[0-9]{3}[\-\.][0-9]{3}[\-\.][0-9]{4}/;  
      // US area code required
    }     
    return (pattern.test(elm.value)) ? true : false;
  }
  function isEmail(elm) {
  // check for valid format of username@domain/machinename.top-leveldomainname
    var pattern = /^[a-zA-Z0-9\-\.\_ ]+\@[a-zA-Z0-9 \-\.]+\.([a-zA-Z]{2,4})$/;
    return (pattern.test(elm.value)) ? true : false;
  }
  function isZip(elm,ctry) {
  // check for valid US zip format of #####(-####)
    var pattern = /^[0-9]{5}$|^[0-9]{5}-[0-9]{4}$/
  // ctry code allows for future country-based zip tests (ie canada)
    return (pattern.test(elm.value)) ? true : false;
  }
  function isMoney(elm,monType) {
  // check for valid money format of ###,###,###.##
    var pattern = /(^[0-9]{1,3})(,?[0-9]{3}){0,2}(\.[0-9]{2})$/;
    if (monType=="roundamt") {
    var pattern = /(^[0-9]{1,3})(,?[0-9]{3}){0,2}(\.[0-9]{2}){0,1}$/;
    // round dollar amount - decimal and cents optional
    }
    return (pattern.test(elm.value)) ? true : false;
  }
  function isGoodDate(elm) {
  // check date for MM/DD/YYY format
    var pattern = /^([0-9]{2})+[\/\-\.]([0-9]{2})+[\/\-\.]((19[0-9]{2})|(200[0-5]))$/;
    return (pattern.test(elm.value)) ? true : false;
  }

  function isFullYear(elm) {
  // check for valid year of 1900-current
    var pattern = /(^18[0-9]{2})|(^19[0-9]{2})|(^200[0-5])/;
    return (pattern.test(elm.value)) ? true : false;
  }
  function isChecked(elm) {
  // check to see if any of the given element have been checked
    var chkFound = false;
    for (var i=0; i<elm.length; i++){
     if (elm[i].checked) { chkFound = true; break; }
    }
    return chkFound;
  }
  function isSelected(elm) {
    return (elm.selectedIndex > 0) ? true : false;
  }
  function isSSN(elm) {
  // check SSN for ######### or ###-##-#### format
    var pattern = /(^[0-9]{9}$)|(^([0-9]{3})+[\-\.]([0-9]{2})+[\-\.]([0-9]{4})$)/;
    return (pattern.test(elm.value)) ? true : false;
  }

  function specialDate(arrayname,month,day) {
  // checks presence of input month and date within designated array of special days
    var m = arrayname[month];
    if (!m) { return false; }
    for (var i in m) if (m[i] == day) return true;
    return false; 
  }

  function formAlert(mText) {
    var aText = "---------------------------------------------------------------\n";
    aText += "The form was not submitted because of the following error(s)\n";
    aText += "Please correct the indicated values and re-submit.\n";
    aText += "---------------------------------------------------------------\n";
    aText += mText;
    alert(aText);
    aText = "";
    mText = "";
  }

// ** mimics :focus pseudo-class for IE **
/* must be called from head of document for INPUT and TEXTAREA tags 
   within form and appropriate style elements must be present */
  function suckerfish(type, tag, parentId) {
	if (window.attachEvent) {
		window.attachEvent("onload", function() {
			var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
			type(sfEls);
		});
	}
  }

  sfHover = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
  }

  sfFocus = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onfocus=function() {
			this.className+=" sffocus";
		}
		sfEls[i].onblur=function() {
			this.className=this.className.replace(new RegExp(" sffocus\\b"), "");
		}
	}
  }


