/* File: js/generic.js, Ratio: 59.1% */

$(document).ready(function(){$("#quick_searchDegree").change(function(){$("#quick_searchState").removeAttr("disabled");});var triggers=$("a[rel]").overlay({expose:{color:'#333',loadSpeed:200,opacity:0.9}});$(".campus_city_link").click(function(){var location=this.name;if($(this).attr("hp")!==undefined&&$(this).attr("hp")!="0"){var hp=$(this).attr("hp");$("#lead_formCampus").val(location).change();$("#lead_formHp").val(hp).change();$.get("/offers/build_lead_form/"+location,{cache:false},function(response){$("#lead_form_fields").html(response);});}});function validate_form(field,msg){var field_value=$("#"+field).val();if($.trim(field_value)===""){alert(msg);$("#"+field).val("").change();$("#"+field).focus();$("#"+field).addClass("form_error");return false;}else{return true;}}
function validate_email(field,msg){var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;var address=$("#"+field).val();if(reg.test(address)===false){alert(msg);$("#"+field).focus();$("#"+field).addClass("form_error");return false;}else{return true;}}
$("#lead_formCampus").change(function(){var campus_id=this.value;$.get("/offers/build_lead_form/"+campus_id,{cache:false},function(response){$("#lead_form_fields").html(response);});});$("#lead_form_submit").click(function(){var submitForm=true;$("#lead_form_fields .input input").each(function(){if(validate_form(this.id,"Please fill out all fields.")===false){submitForm=false;return false;}});if(submitForm===true){return true;}else{return false;}});$("#lead_form_continue").click(function(){$("#career_test_set_2").show();$("#career_test_set_1").hide();var target_offset=$("#top").offset();var target_top=target_offset.top;$('html, body').animate({scrollTop:target_top},500);event.preventDefault();});$("#lead_form_back").click(function(){$("#career_test_set_2").hide();$("#career_test_set_1").show();var target_offset=$("#top").offset();var target_top=target_offset.top;$('html, body').animate({scrollTop:target_top},500);event.preventDefault();});});
