document.write('<link rel="stylesheet" href="css/sifr-adjust.css" type="text/css">');
document.write('<link rel="stylesheet" href="../css/sifr-adjust.css" type="text/css">');
document.write('<link rel="stylesheet" href="../../css/sifr-adjust.css" type="text/css">');
$(document).ready(function(){
		
     /* add on-state to menu item  */
		$("ul.nav-submenu").find("a").each(function(){
	        if(location.href.indexOf(this.href) != -1) {
	            $(this).addClass("current").click(function() { return false; });
			}
        });

	/* set menu section to be closed unless it gets set below in the href search */
        var menuSection = -1;

        $("a.nav-topic").filter(function(index) {
                if ($(this).next("ul.nav-submenu").children("li").children().is("a.current")) {
                        // set the menu to open on this section; see after Accordion below -.activate(index)
                        menuSection = index;
                        return false;
                }
        });
		
	 /* vertical navigation only - accordion plugin */
        if(document.getElementById("nav")) {
            if($("#nav-menu ul.nav-submenu").length != 0) {
                $('#nav-menu').Accordion({
					active:false,
	                header:'.nav-topic',
					speed:'3500',
                    selectedClass:'selected',
	                alwaysOpen:false,
					animated:'easeslide',
	                navigation:false,
					autoheight:false
                }).change(function(){
					if($("#nav-menu li a.selected").next("ul.nav-submenu").is(":visible")) {
						$("#nav-menu li a.selected").parent("li").addClass("highlight").siblings("li").removeClass("highlight");
					}
					else {
						$("#nav-menu li a").parent("li").removeClass("highlight");
					}
				}).activate(menuSection);
            }
        }

    /* to allow no margin hover */
    $("#nav-menu li a.nav-topic").hover(
  function () {
    $(this).parent("li").addClass("hover");
  },
  function () {
    $(this).parent("li").removeClass("hover");
  }
);
	   $("#nav-menu li a.nav-topic-link").hover(
  function () {
    $(this).parent("li").addClass("hover");
  },
  function () {
    $(this).parent("li").removeClass("hover");
  }
);

	 /* site search form box */
		var srchval = $("#searchbox").val();
        $("#searchbox").focus( function() {
                // test value to see if temp instruction text
                $(this).filter(function(){
                        return $(this).val() == srchval;
                }).val("");
                // highlight region bgrd
                $("#hd-srchbox").addClass("infocus");

                $("#searchbox").blur( function() {
                        $(this).filter(function(){
                                return $(this).val().length == 0;
                        }).val(srchval);
                        // restore region bgrd
                        $("#hd-srchbox").removeClass("infocus");
                });
        });
	
/* equal column heights */
jQuery.fn.vjustify=function() {
    var maxHeight=0;
    this.each(function(){
        if (this.offsetHeight>maxHeight) {maxHeight=this.offsetHeight;}
    });
    this.each(function(){
        $(this).height(maxHeight + "px");
        if (this.offsetHeight>maxHeight) {
            $(this).height((maxHeight-(this.offsetHeight-maxHeight))+"px");
        }
    });
};
$(".equal").vjustify(); // just add 'class="equal"' to the collumns you want to effect

/* sIFR */
$("#intro h1 sup:contains('SM'), #intro h2 sup:contains('SM'), #content-body h3 sup:contains('SM'), #content-body h4 sup:contains('SM'), div.rt-col h2 sup:contains('SM'), #nav-menu-hdr h2 sup:contains('SM'), #nav-menu-hdr h3 sup:contains('SM')").replaceWith('&sect;').html();// this line replaces the the "SM" for service mark with "§" (&sect;), and we have custom edited our font file to render that character as the non-exsistant service mark.
$('#intro h1').sifr({fontSize: '28px'});
$('#intro h2').sifr({fontSize: '14px'});
$('#content-body h3, #content-body h4').sifr({fontSize: '14px'});
$('div.rt-col h2').sifr({fontSize: '20px'});
$('#nav-menu-hdr h2').sifr({fontSize: '18px'});
$('#nav-menu-hdr h3').sifr({fontSize: '13px'});
$('#content-body h3.homepage-only').sifr({fontSize: '25px'});
});


