// JavaScript Document
jQuery(document).ready(function($){
    
// remove borders
    $('.front_post:last').css('background', 'none');
    $('.product_front_post:last').css('background', 'none');
    $('.homepost:last').css('background', 'none');
    
    // add coloring to main menu item in nav bar when sub menu is displayed
    $('.menu li ul').hover(function() {
        $(this).prev('.menu a').addClass('hover_stay');
    }, function() {
        $(this).prev('.menu a').removeClass('hover_stay');
    });
        
    // control fade cycle of home page slideshow
    $('#fade').cycle({
       fx: 'fade',
       timeout: 10000,
        speed: 500,
        pause: 1,
        cleartypeNoBg: true //fix for ie white background
    });
    
    // control the display of labels on sidebar email forms
    $('.overlabel').click(function() {
        $(this).next('input').focus();
    });
    $('#contact_small input').focus(function() {
        $(this).prev('label').hide();
    });
    $('#contact_small input').blur(function() {
        var text = $(this).val();
        if (text == "") {
            $(this).prev('label').show();
        }
    });
    $('#contact_small #message').focus(function() {
        $(this).prev('label').hide();
    });
    $('#contact_small #message').blur(function() {
        var text = $(this).text();
        if (text == "") {
            $(this).prev('label').show();
        }
    });
});