// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function popUp(URL) {
  day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=461,height=231');");
}

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox()
  $(document).pngFix()
})

function toggleYield(elm) {
	if (elm.options[elm.selectedIndex].value == "4") {
		$('#yield_icon').show();
		$('#account_type_yield').show();
	} else {		
		$('#yield_icon').hide();
		$('#account_type_yield').hide();
	}
}
function sendDelayedForm() {
  var zip = $('#zipcode').val();
  if (isNumeric(zip) && zip.length == 5) {
    $('#form_container').hide(); 
    $('#searching_container').show(); 
    window.setTimeout('$(\'form:first\').submit();', 3000); 
  } else {
    alert("Please enter a valid, 5-digit zipcode.");
  }
}
function isNumeric(sText) {
  var ValidChars = "0123456789.";
  var IsNumber=true;
  var Char;
  for (i = 0; i < sText.length && IsNumber == true; i++) { 
    Char = sText.charAt(i); 
    if (ValidChars.indexOf(Char) == -1) {
      IsNumber = false;
    }
  }
  return IsNumber;
}