﻿function leavingCSB(obj){
    if(confirm("You are leaving the College Savings Bank web site. College Savings Bank does not control nor endorse the content at the external Web site or its sponsors.  The privacy policy of the external site may differ from the Bank's privacy policy. Investments outside of this site are subject to investment risk and may lose value. They are not FDIC-insured, not bank deposits or obligations thereof, and not bank guaranteed.  To remain at our site, click cancel.  To continue to the external site, click OK.")){
      
    }else{
     obj.href="";
    }
    
}

function EnsureNumeric()
{
    var key = window.event.keyCode;
    if (key < 48 || key > 57) 
        window.event.returnValue = false; 
        
}

function recordClick(e){
  if (window.pageLocation == null){return;}
  if (window.pageLocation == this.href){return;}
  if (window.pageLocation + "#" == this.href){return;}

	new Ajax.Request('/ajax/recordClick.aspx?from=' + window.pageLocation + '&to=' + this.href,{method:'get',asynchronous:false})
}

function displayYearEnd(myTxt){
  var d = new Date();

  if (d.getMonth() > 7){
    document.write(myTxt);
  }

}

function onPageLoad(){
	//var len = document.getElementsByTagName("A").length;
	jQuery.noConflict();

        jQuery(document).ready(function($){
		$("a").bind('click', recordClick);

	});
}

//window.onload = onPageLoad;
jQuery.noConflict();
onPageLoad();
