// Initialize the Scripts for this site.

$(document).ready(function() {
    
    
    // Opens up Smart Solutions in new window.
    $('.lnkBlank').click(function() {
        window.open($(this).attr('href'), 'newWindow', '');
        return false;
    });
    
    // Select the text in the search box:
    $('input.txtSearch').focus(function() {
        $(this).select();
    });
    
    // Hides list item images if no src is defined:
    $('img.listItemImage').each(function() {
        if ($(this).attr('src') == '') {
            $(this).hide();
        }
    });
    
    $('#Menu li:last').css({'background':'none'});
    
    // Set the height even on the two columns:
    borderTotal = 0;
    $('div.column').each(function() {
        
        borderTotal += parseInt($(this).css('borderTopWidth').replace('px',''));
        borderTotal += parseInt($(this).css('borderBottomWidth').replace('px',''));
        borderTotal += parseInt($(this).css('paddingTop').replace('px',''));
        borderTotal += parseInt($(this).css('paddingBottom').replace('px',''));
        //borderTotal += parseInt($(this).css('marginTop').replace('px',''));
        //borderTotal += parseInt($(this).css('marginBottom').replace('px',''));
        
        var totalHeight = parseInt($('#mainContent').height()) - borderTotal;
        $(this).css({'min-height':totalHeight});
        borderTotal = 0;
    });
    
    $('#slides').cycle({
        timeout:    5000
    });
    
});
