function SetupHeaderSearch()
{
    $("#searchinput").blur(function(){
        if($(this).attr('value') == '' || $(this).attr('value') == null)
        {
            var dom = ($(this).get())[0];
            $(this).attr('value', dom.defaultValue);
        }
    });

    $("#searchinput").focus(function(){
        var dom = ($(this).get())[0];
        if($(this).attr('value') == dom.defaultValue)
        {
            $(this).attr('value', "");
        }
    });

    $("#searchbutton").click(function(){
        var dom = ($("#searchinput").get())[0];
        if($("#searchinput").attr('value') == '' || $("#searchinput").attr('value') == dom.defaultValue)
        {
            dom.focus();
            return false;
        }
        return true;
    });
    
    $(".smallgreybox").blur(function(){
        if($(this).attr('value') == '' || $(this).attr('value') == null)
        {
            var dom = ($(this).get())[0];
            $(this).attr('value', dom.defaultValue);
        }
    });

    $(".smallgreybox").focus(function(){
        var dom = ($(this).get())[0];
        if($(this).attr('value') == dom.defaultValue)
        {
            $(this).attr('value', "");
        }
    });
    
    $(".greybox").blur(function(){
        if($(this).attr('value') == '' || $(this).attr('value') == null)
        {
            var dom = ($(this).get())[0];
            $(this).attr('value', dom.defaultValue);
        }
    });

    $(".greybox").focus(function(){
        var dom = ($(this).get())[0];
        if($(this).attr('value') == dom.defaultValue)
        {
            $(this).attr('value', "");
        }
    });
}

function SetupHeaderRollovers()
{
     $("a.navlink").mouseover(function(){  
        if(!$(this).hasClass('current'))
        {    
            $(this).find("img.bullet").each(function(){
                $(this).attr("src", "/~/media/DA32241E88EA4E6CB779D29DF9E7C8C0.ashx");
            });
        }
    }).mouseout(function(){
        if(!$(this).hasClass('current'))
        {  
            $(this).find("img.bullet").each(function(){
                $(this).attr("src", "/~/media/C73594F82913490791DA05D66575EE68.ashx");
            });
        }
    });
    
    $("a.newwindow").live("click", function(){
        window.open($(this).attr("href"));
        return false;
    });
}

function SetupITHeaderRollovers()
{
    $("#navigation li").mouseover(function(){
        $(this).find("img.bullet:not(.current)").each(function(){
            $(this).attr("src", "/~/media/DA32241E88EA4E6CB779D29DF9E7C8C0.ashx");
        });
        $(this).css("background-color", "#929292");
        $(this).find("a").css("color", "white");
    }).mouseout(function(){
        if(!$(this).hasClass('current'))
        {
            $(this).find("img.bullet:not(.current)").each(function(){
                $(this).attr("src", "/~/media/C73594F82913490791DA05D66575EE68.ashx");
            });
            $(this).css("background-color", "#E6E6E2");
            $(this).find("a").css("color", "#929292");
        }
    });
    
    $("a.newwindow").live("click", function(){
        window.open($(this).attr("href"));
        return false;
    });
}

function SetupCaseStudyPopup()
{
    $(".close").live("click", function(){
        $(".casestudypopup").hide(400);
    });
    
    $(".popup").live("click", function(e){
        var target = $(this).attr('rel');
        var popup = $('#' + target);
        
        var parent = $(this).parents(".left");
        var offset = parent.offset();
        var left = offset.left + 40;
        var top = $(this).offset().top - 60;
        popup.css('top', top);
        popup.css('left', left);
        popup.css('position', 'absolute');
        popup.show(600);
        
        e.stopPropagation();
    });
}
