        (function ($) {
            $.fn.textbox = function (change) {
                $(this).prepend('<input type="text" id="quick_downloads_search" class="allied_textbox" />');

                var caption = "type in the type of form you want to download";
                var elem = $(this).find(".allied_textbox").val(caption);

                elem.click(function () {
                    if ($(this).val() == caption)
                        $(this).val("").css({"color": "gray" });
                });

                elem.focusout(function () {
                    if ($(this).val() == "")
                        $(this).val(caption).css({ "color": "#c0c0c0" });
                });

                elem.bind("keydown keyup change",change);
            };
        })(jQuery);
        
        $(function(){
		            //menu
            $("#menu li:first").css("margin-left", "0px");
            $("#menu li").hover(
            function () { 
			if ($(this).css("opacity") == "1")
				{
					play = false;
					$(this).animate({ opacity: .7 }, 500); 
				}
			},
            function () {
			if (parseInt($(this).css("opacity")) < .7)
				{
					$(this).animate({ opacity: 1 }, 500); 
				
				}
			}
            );
            //END menu
            


            function filter(){var a = $("#quick_downloads_result li:visible").slice(4); if (a.length > 4) a.hide();}    
            filter();

            $("#quick_downloads").textbox(function () {
                var val = $(this).val().toLowerCase();
                var elem = $("#quick_downloads_result li a.download_link");
                elem.each(function () {
                    var html = new String($(this).html().toLowerCase());
                    if (html.search(val) != -1)
                        $(this).parent().show();
                    else
                        $(this).parent().hide();
    
                }); 
            filter();                
            });

            $(".allied_paragraph table td:even").css({"background-color":"#c0c0c0"});
            $(".allied_paragraph table td:odd").css({"background-color":"#f0f0f0", color:"gray"});
            $(".allied_paragraph table td:odd").hover(function(){ $(this).parent().find("td:first").css("color","#003399"); },function(){ $(this).parent().find("td:first").css("color","white"); });
            
            $("#quickdownload_toggle").click(function(){
              $("#quick_downloads").animate({opacity:1},300);
              $(this).remove();
            
            
            });
            
            
                        //build contents -- parse contents and add to navigation / contents
              var selected = 1;            
            $(".nav_contents_allied").hide().each(function(){
              var title = $(this).find(".nav_title").html();
              var contents = $(this).find(".nav_title_contents");
              var article_num = $(this).attr("id").slice("nav_title_content".length);
			  var article_yrr = $(this).find(".nav_title");
			  var art_yr = article_yrr.attr("art_year");
              var article_id = "nav_article_link" +  article_num;
              
              $(".nav_contents_allied:first").show();              
              $("#allied_navigation li:first").css({color:"#003399", "font-size" : "18px"});
              
              $("#allied_navigation").append("<li id='"+article_id+"' art_yr='"+art_yr+"'>" +title+ "</li>");
              $("#"+article_id).click(function(){
               if (article_id != selected)
               { 
                $("#allied_navigation li").css({color:"white",  "font-size" : "13px"});
                $(this).css({color:"#003399",  "font-size" : "15px", "font-weight" : "bold"});
                $(".nav_contents_allied").hide();
                $("#nav_title_content" + article_num).fadeIn();
                selected =  article_id;
               } 
              });
            });
            //END build
        $(".allied_paragraph ul").each(function(){
          $(this).find("li:last").css("border","none");
         });
            //menu
            var border_left = $("#menu li:first").css("border-right");
            $("#menu li:first").css({"margin-left":"0px","border-left":"solid 1px #e7e7e7","-moz-border-radius-topleft" : "5px","-moz-border-radius-bottomleft" : "5px"});
            $("#menu li:last").css({"-moz-border-radius-topright" : "5px","-moz-border-radius-bottomright" : "5px"});
            
            //END menu                   
        
        $("#allied_navigation li:first").trigger("click");
        
        var select = String(window.location.search).substring(1);
        if (select && select.substring(0,1) == "i")
        {
             var article = "nav_article_link" + select.substring(2);
             $("#"+article).trigger("click");
        }

        });
