﻿/// <reference path="jquery-1.3.2-vsdoc2.js" />
j$ = jQuery.noConflict();
j$(document).ready(function() {
    j$(function() {
        // setup ul.tabs to work as tabs for each div directly under div.panes
        //jQuery("ul.tabs").tabs("div.panes > div", { effect:'fade', fadeOutSpeed: 400 });
        j$("ul#flowtabs").tabs("div.panes > div");
    });

    j$("#mylink img").hover(
    function() {
        this.src = this.src.replace("_off", "_on");
    },
    function() {
        this.src = this.src.replace("_on", "_off");
    }
           );

    j$('#footer a.print').click(function() {
        window.print();
    }
    );


    j$.fn.equalHeights = function(px) {
        j$(this).each(function() {
            var currentTallest = 0;
            j$(this).children().each(function(i) {
                if (j$(this).height() > currentTallest) { currentTallest = j$(this).height(); }
            });
            //if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
            // for ie6, set height since min-height isn't supported
            if (j$.browser.msie && j$.browser.version == 6.0) { j$(this).children().css({ 'height': currentTallest }); }
            j$(this).children().css({ 'min-height': currentTallest });
        });
        return this;
    };

    j$('.boxes').equalHeights();
    j$('#content').equalHeights();

    j$(function() {
        j$('#search input[type=text]').focus
    (
            function() {
                j$(this).val('');
            });
    });

    j$(function() {
        var querystring = location.search.replace('?', '').split('&');
        var queryObj = {};
        for (var i = 0; i < querystring.length; i++) {
            // get name and value
            var name = querystring[i].split('=')[0];
            var value = querystring[i].split('=')[1];
            // populate object
            queryObj[name] = value;
        }

        if (queryObj["search"]) {
            var searchTerm = queryObj["search"].split('+');
            //var searchTerm = queryObj["search"].replaceAll('+', ' ');
            //j$('.content').highlight(searchTerm);
                        for (var a = 0; a < searchTerm.length; a++) {
                            j$('.content').highlight(searchTerm[a]+ ' ');
                        }

        }
    });


    j$(function() {
        //                if (j$.cookie('TEXT_SIZE')) {
        //                    j$('body').addClass(j$.cookie('TEXT_SIZE'));
        //                }
        j$('a.large, a.small, a.medium').click(function() {
            var textSize = j$(this).attr('class');
            j$('body').removeClass('small medium large').addClass(textSize);
            //            j$.cookie('TEXT_SIZE', textSize, { path: '/', expires: 10000 });
            //return false;
        });
    });
});
    
