/*global document:true, $:true window:true *//*jslint indent:4 maxlen:80 */// Default JS file
/*

To configure the warn if modified alert do something like the following:

            $(':input', "#id").bind("change", function() {
                   window.onbeforeunload = WarnModified;x
                       $("button").click(function(){
                           window.onbeforeunload = DontWarnModified;
                           });
                   }); // Prevent accidental navigation away

         });

*/function WarnIfError(){"use strict";return"Any unsaved changes to this form will be lost.\n\nFix any errors on this form by looking for any section tab to the left of the form body that has an '!' in a red circle.\n\nSelect each tab marked as having errors and scroll through it correcting errors in any form field marked as having an error.\n\nYou should then click save or submit at the bottom of this form to preserve your changes."}function WarnModified(){"use strict";return"Any unsaved changes to this form will be lost.\n\nYou should click save or submit at the bottom of this form to preserve your changes."}function DontWarnModified(){"use strict"}function aPopup(a){"use strict";var b=window.open(a,"popUpWindow","height=700,width=1000,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes")}function calculateScore(){"use strict";var a=0;$(".score").each(function(){a+=parseInt($(this).val(),10)});$("#total").html(a);$("#sidetotal").html(a)}function addDeformID(a){var b=document.getElementsByTagName("*");for(i=0;i<b.length;i++)b[i].className==a&&b[i].setAttribute("id","deformInsertBefore")}$(function(){"use strict";var a=$("#sidebar"),b=a.offset();a.length>0&&$(window).scroll(function(){$(this).scrollTop()>b.top+a.height()&&a.hasClass("default")?a.fadeOut("fast",function(){$(this).removeClass("default").addClass("fixed").fadeIn("fast")}):$(this).scrollTop()<=b.top&&a.hasClass("fixed")&&a.fadeOut("fast",function(){$(this).removeClass("fixed").addClass("default").fadeIn("fast")})})});$(document).ready(function(){"use strict";$("#cv-body").hide();$("a.cv-body").click(function(){$("#cv-body").slideToggle(200);setTimeout(function(){window.location="#cv-section"},200)});$("button[value=cancel]").attr("onClick","history.back()");$("#gobutton").click(function(a){a.preventDefault();if($(this).hasClass("disabled"))return!1;window.location.href=$(this).attr("href")});$("#gotoapp").change(function(){$(this).prop("checked")?$("#gobutton").removeClass("disabled"):$("#gobutton").addClass("disabled")});$("input[name=location1]").twipsy({title:function(){return $("label[for="+$(this).attr("id")+"]").attr("title")},trigger:"focus"});$("input[name=location2]").twipsy({title:function(){return $("label[for="+$(this).attr("id")+"]").attr("title")},trigger:"focus"});$("input[name=location3]").twipsy({title:function(){return $("label[for="+$(this).attr("id")+"]").attr("title")},trigger:"focus"});$("#intl-scholar-application").closest(".container-fluid").addClass("removeSidebar");$("#educator-application-form").closest(".container-fluid").addClass("removeSidebar");$("#affiliated-event-application").closest(".container-fluid").addClass("removeSidebar");$("#yi-recommendation-form").closest(".container-fluid").addClass("removeSidebar");if($("#content-row").hasClass("removeSidebar")){$(".sidebar").remove();$("#content-row section").addClass("noSidebar")}$(".noSidebar .deformSeq").closest("li").addClass("addDegrees");$(".noSidebar .buttons").prev().addClass("lastField");$(".noSidebar #form").parents("div").addClass("formWrapper");$(".noSidebar #intl-scholar-application").closest("div").addClass("hasContactInfo");$(".noSidebar #educator-application-form").closest("div").addClass("hasContactInfo");$(".noSidebar #affiliated-event-application").closest("div").addClass("hasContactInfo");$(".noSidebar #intl-scholar-application ul li:first-child").next("li").addClass("contactInfoWrapper");$(".noSidebar #educator-application-form ul li:first-child").next("li").addClass("contactInfoWrapper");$(".noSidebar #affiliated-event-application ul li:first-child").addClass("contactInfoWrapper");$(".noSidebar li").hasClass("error")&&$(".noSidebar form").addClass("hasErrors");if($(".noSidebar form").hasClass("hasErrors")){$(".noSidebar #educator-application-form ul li:nth-child(2)").removeClass("contactInfoWrapper");$(".noSidebar #educator-application-form ul li:nth-child(3)").addClass("contactInfoWrapper");$(".noSidebar #intl-scholar-application ul li:nth-child(2)").removeClass("contactInfoWrapper");$(".noSidebar #intl-scholar-application ul li:nth-child(3)").addClass("contactInfoWrapper")}if($(".contactInfoWrapper").hasClass("error")){$(".noSidebar #affiliated-event-application ul li:nth-child(1)").removeClass("contactInfoWrapper");$(".noSidebar #affiliated-event-application ul li:nth-child(2)").addClass("contactInfoWrapper");$(".noSidebar #affiliated-event-application ul li:nth-child(3)").addClass("functionDetailsWrapper");$(".noSidebar #affiliated-event-application ul li:nth-child(4)").addClass("facilityDetailsWrapper");$(".noSidebar #affiliated-event-application ul li:nth-child(4)").addClass("facilityDetailsWrapper");$(".noSidebar #affiliated-event-application ul li ul li:nth-child(4)").removeClass("facilityDetailsWrapper");$(".noSidebar #affiliated-event-application .facilityDetailsWrapper ul li").removeClass("functionDetailsWrapper");$(".noSidebar #affiliated-event-application .facilityDetailsWrapper ul li").removeClass("contactInfoWrapper");$(".noSidebar #affiliated-event-application .facilityDetailsWrapper ul li ul li").removeClass("contactInfoWrapper")}else{$(".noSidebar #affiliated-event-application ul li:nth-child(2)").addClass("functionDetailsWrapper");$(".noSidebar #affiliated-event-application ul li ul li:nth-child(2)").removeClass("functionDetailsWrapper");$(".noSidebar #affiliated-event-application ul li:nth-child(3)").addClass("facilityDetailsWrapper");$(".noSidebar #affiliated-event-application ul li ul li:nth-child(3)").removeClass("facilityDetailsWrapper")}$(".contactInfoWrapper ul li:not(:first-child)").addClass("contactContainer");$(".noSidebar #intl-scholar-application ul li ul li ul li").removeClass("contactContainer");$(".noSidebar #educator-application-form ul li ul li ul li").removeClass("contactContainer");$(".noSidebar #affiliated-event-application ul li ul li ul li").removeClass("contactContainer");$(".contactInfoWrapper .contactContainer .deformMappingFieldset").closest("li").addClass("deformItem");$("#affiliated-event-application .contactInfoWrapper .deformItem").next().addClass("afterDeform");$("#affiliated-event-application .contactInfoWrapper .afterDeform").next().addClass("phone");$(".noSidebar .contactInfoWrapper .deformItem fieldset ul .section").insertAfter(".noSidebar .contactInfoWrapper .deformItem li:not(.section):first");$("<li class='section contactInfoWrapper'><div>Please spell out your country (i.e. United States, Botswana)</div></li>").insertAfter("#affiliated-event-application .contactInfoWrapper .deformItem li:not(.section):last");$(".noSidebar .contactInfoWrapper .contactContainer:last").addClass("last");$(".noSidebar #affiliated-event-application .contactInfoWrapper .contactContainer:last").removeClass("last");$(".noSidebar #affiliated-event-application .contactInfoWrapper .contactContainer:last").addClass("agentDropdown");$(".noSidebar #affiliated-event-application .contactContainer.agentDropdown").prev().addClass("last");$(".noSidebar .contactContainer.last .desc").insertAfter(".noSidebar .contactContainer.last ul li:first");$(".noSidebar .deformFileupload").prev().addClass("fileUpload");$(".noSidebar textarea").prev().addClass("textarea");$(".deformSeqAdd").click(function(a){$(".noSidebar textarea").prev().addClass("textarea")});addDeformID("deformInsertBefore");$(".noSidebar .facilityDetailsWrapper ul li:first").addClass("first");$(".noSidebar .facilityDetailsWrapper ul li:nth-child(3)").addClass("scheduling");$(".noSidebar .facilityDetailsWrapper ul li:nth-child(4)").addClass("roomSetup");$(".noSidebar p:empty").remove()});var allHTMLTags=new Array;
