function initExternalLinks(){var C=$("a[rel=external]");if(C.length>0){var B=" (warning: this link will take you to another website - use your browser's Back button to return here)";C.attr("title",function(){$(this).attr("title",$(this).attr("title")+B)});var A=C.children("img");if(A.length>0){A.attr("alt",function(){$(this).attr("alt",$(this).attr("alt")+B)})}}}function initDownloadLinks(){var C=$("a.download");if(C.length>0){var A=" (note: this link opens a download file - if it opens within your browser use your browser's Back button to return here)";C.attr("title",function(){$(this).attr("title",$(this).attr("title")+A)});var B=C.children("img");if(B.length>0){B.attr("alt",function(){$(this).attr("alt",$(this).attr("alt")+A)})}}}function initRequiredLabels(){var B=$("label.required");if(B.length>0){var C=" *";var A='<p class="requiredNote"><em>(fields marked with an asterisk are required)</em></p>';B.append(C);$(".hasRequired").after(A)}}function initEligibilityRows(){var A=$("#iSearchResults");if(A.length>0){$("#iSearchResults table tbody tr.eligibility td div dl dt.first").addClass("selected");$("#iSearchResults table tbody tr.eligibility td div dl dt.first").show();$("#iSearchResults table tbody tr.eligibility td div dl dt:not(.first)").next().hide();$("#iSearchResults table tbody tr.eligibility td div").hide();$("#iSearchResults table tbody tr.eligibility td h3 a").click(function(){var B=$(this).parent().next("div");B.toggle();if(B.css("display")=="none"){$(this).text("show")}else{$(this).text("hide");initEligibilityTabs()}});$("#iSearchResults table tbody tr.eligibility td a").hover(function(){$(this).addClass("hoverCursor")},function(){$(this).removeClass("hoverCursor")})}}function initEligibilityTabs(){var A=$("#iSearchResults table tbody tr.eligibility td div dl dt");if(A.length>0){A.click(function(){var E=$(this).parent();var D=E.children("dt");var C=E.children("dd");var B=$(this).next();D.removeClass("selected");$(this).addClass("selected");C.hide();B.show()});A.hover(function(){$(this).addClass("hoverCursor")},function(){$(this).removeClass("hoverCursor")})}}function initAjaxTypeAhead(){var C=$(".ajaxReq");if(C.length>0){C.attr("autocomplete","off");var F=$('<div id="iTypeAhead" class="ajaxTypeAhead"></div>');var B=$('<fieldset id="iTypeAheadFieldset"><legend id="iTypeAheadFieldsetLegend">select an existing item</legend></fieldset>');var E=$('<select id="iTypeAheadSelect" multi="multi" size="8"></select>');var D=$('<label for="iTypeAheadSelect">You can select an option below based on the value entered so far</label>');F.append(B);B.append(D);B.append(E);F.show();var A=$('<div class="ie6SelectBugReplaceContent"></div>');C.focus(function(){var I=$(this);var H=I.prev("label");var L=H.text();var K="[clear the current "+L+" input content]";var G="[close this selection box]";var M="kw";var J=(L.length>0?L.charAt(0):"");if(J=="q"){M="qn"}else{if(J=="p"){M="pn"}}I.keyup(function(){I.after(F);var O=$("#iTypeAhead fieldset legend");O.empty();O.html("select "+L);var N=M+"="+I.val();$.get("/Services/queryLsc.aspx",N,function(P){if(P.length>0){E.empty();$("<option></option>").text(G).appendTo(E);$("<option></option>").text(K).appendTo(E);$.each(P,function(Q,R){if(Q>0){$("<option></option>").text(R).appendTo(E)}});if($.browser.msie&&$.browser.version<7){$("#ctl00_ContentPlaceholderMainBody_searchForm_ddlQualification").prepend(A);$("#ctl00_ContentPlaceholderMainBody_searchForm_ddlQualification").hide()}F.show}},"json")});E.change(function(){if(E.val()==G){F.remove();if($.browser.msie&&$.browser.version<7){$("#ctl00_ContentPlaceholderMainBody_searchForm_ddlQualification").show();$("#ctl00_ContentPlaceholderMainBody_searchForm_ddlQualification").prev(".ie6SelectBugReplaceContent")}}else{if(E.val()==K){I.val("")}else{I.val(E.val())}}})});C.blur(function(){})}}$(document).ready(function(){initExternalLinks();initDownloadLinks();initRequiredLabels();initAjaxTypeAhead();initEligibilityRows()});