$('#submitAPR').click(function(){$("#aprResult").html('');$("#monthlyPayment").html('');if(validateForm()){recalc_onclick('');$('.cal_Right_Mid').css('padding-bottom','20px');$('#monthlyPaymentLabel').show();$('#estimatedAPRLabel').show();}});$('#emailAddress').focusin(function(){$('#emailAddress').val('');});$('#emailAddress').focusout(function(){if($('#emailAddress').val().length==0){$('#emailAddress').val('you@example.com');}});$('#goEmailAddress').click(function(){$('#emailAddressError').hide();$('#stateError').hide();$('#emailAddressError').html('');$('#stateError').html('');var email=$('#emailAddress').val();var isEmailValid=isValidEmailAddress(email);if(email==""||!isEmailValid||email=='you@example.com'){$("#aprResult").html('');$("#monthlyPayment").html('');$('#emailAddressError').html('Valid Email is required');$('#emailAddressError').show();$('.cal_Right_Mid').css('padding-bottom','130px');$('#monthlyPaymentLabel').hide();$('#estimatedAPRLabel').hide();return false;}else{window.open("Top_Ten_Things_You_Should_Know_About_Paying_For_College_Final_20110418.pdf");callEmailServlet();}});function callEmailServlet(){var url='http://test.ihelploan.com/slfcpost.php?emailAddress='+$('#emailAddress').val()+'&state='+$('#state').val();$.ajax({type:'POST',url:url});}
function validateForm(){$('#emailAddressError').hide();$('#stateError').hide();$('#emailAddressError').html('');$('#stateError').html('');var email=$('#emailAddress').val();var state=$('#state').val();if(state==""){$('#stateError').html('State is required');$('#stateError').show();$('.cal_Right_Mid').css('padding-bottom','130px');$('#monthlyPaymentLabel').hide();$('#estimatedAPRLabel').hide();return false;}
$('#emailAddressError').hide();$('#stateError').hide();$('#emailAddressError').html('');$('#stateError').html('');return true;}
function isValidEmailAddress(emailAddress){var pattern=new RegExp(/^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/);return pattern.test(emailAddress);}
function isInteger(s){var isInteger_re=/^\s*(\+|-)?\d+\s*$/;return String(s).search(isInteger_re)!=-1}
function closeAll(){$('#blanket').hide();$('#beforeStartingPopup').hide();$('#programOverviewPopup').hide();$('#repaymentOptionsPopup').hide();$('#parentsLikePopup').hide();$('#understandLoanPopup').hide();}
$('#repaymentOptionsBtn').click(function(){closeAll();blanket_size('#programOverviewPopup');$('#blanket').toggle('explode');$('#repaymentOptionsPopup').center();$('#repaymentOptionsPopup').toggle('explode');return false;});$('#parentsLikeBtn').click(function(){closeAll();blanket_size('#programOverviewPopup');$('#blanket').toggle('explode');$('#parentsLikePopup').center();$('#parentsLikePopup').toggle('explode');return false;});$('#understandLoanBtn').click(function(){closeAll();blanket_size('#programOverviewPopup');$('#blanket').toggle('explode');$('#understandLoanPopup').center();$('#understandLoanPopup').toggle('explode');return false;});$('#programOverviewBtn').click(function(){closeAll();blanket_size('#programOverviewPopup');$('#blanket').toggle('explode');$('#programOverviewPopup').center();$('#programOverviewPopup').toggle('explode');return false;});$('#beforeStartingBtn').click(function(){closeAll();blanket_size('#beforeStartingPopup');$('#blanket').toggle('explode');$('#beforeStartingPopup').center();$('#beforeStartingPopup').toggle('explode');return false;});$('#understandLoanClose1').click(function(){closeAll();return false;});$('#understandLoanClose2').click(function(){closeAll();return false;});$('#parentsLikeClose1').click(function(){closeAll();return false;});$('#parentsLikeClose2').click(function(){closeAll();return false;});$('#repaymentOptionsClose1').click(function(){closeAll();return false;});$('#repaymentOptionsClose2').click(function(){closeAll();return false;});$('#programOverviewClose1').click(function(){closeAll();return false;});$('#programOverviewClose2').click(function(){closeAll();return false;});$('#beforeStartingClose1').click(function(){closeAll();return false;});$('#beforeStartingClose2').click(function(){closeAll();return false;});$('#moreInfo').click(function(){$('#repaymentOptionsBtn').show();$('#parentsLikeBtn').show();$('#understandLoanBtn').show();$('#leftNav').show();});jQuery.fn.center=function(){this.css("position","absolute");this.css("top",($(window).height()-this.height())/2+$(window).scrollTop()+"px");this.css("left",($(window).width()-this.width())/2+$(window).scrollLeft()+"px");return this;}
function getUrlVars(){var vars=[],hash;var hashes=window.location.href.slice(window.location.href.indexOf('?')+1).split('&');for(var i=0;i<hashes.length;i++){hash=hashes[i].split('=');vars.push(hash[0]);vars[hash[0]]=hash[1];}
return vars;}
