// Initialize the Scripts for this site.

$(document).ready(function() {
    
    // Store Minicart:
    pixelsilk2.renderSkin({skin: '['+'[StoreMiniCart]'+']', path:''}, function(html) {
        $('#logo').after(html);
    });
    
    // 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).attr('src') == '?w=150') {
            $(this).hide();
        }
    });
    
    $('.staffInfoItem span.text').each(function() {
        if ($(this).html() == '') {
            $(this).parent().hide();
        }
    });
    
    $('#mainContent').append('<img src="/corner-w-b.gif" width="20" height="20" id="bottomCorner" />');
    
    // If there is more than one slide, initialize Cycle:
    if ($('#slides').size() > 0 && $('#slides div.slide').size() > 1) {
        $('#slides').cycle(
            {
                timeout:    8000,
                pager:        '#pager',
                prev:        '#pagerLeft',
                next:        '#pagerRight'
            }
        );
    }
    
    // Hide Pager if only one slide exists:
    if ($('#slides div.slide').size() < 2) {
        $('#pager').hide();
    }
    
    $('#categoryList>li>ul>li>a').each(function() {
        $(this).prepend('<span class="subNavBullet" style="height:'+$(this).parent().height()+'px;"> &bull;</span>');
    });
    
    // IE6 Detector plugin:
    $('body').ieDetector();
    
});
