Cufon.replace('.chalet-lite, .feature-left h3.powering', { fontFamily: 'Chalet' });
Cufon.replace('.chalet, .feature-left h3.tag', { hover: true, fontFamily: 'Chalet-Bold' });

jQuery.noConflict();

function assign_fitted() {
  jQuery('.clickable').fitted();
}

function sub_nav(){


  var path = location.pathname.substring(1);
  jQuery('.subNav a[href$="' + path + '"]').parent().addClass('nav_active'); // check path as typed exactly
  jQuery('.subNav a[href$="' + path + '/"]').parent().addClass('nav_active'); // check path with an extra trailing slash added



}

function sidebar_rotator() {
    jQuery('#spotlight .client-rotator').cycle({ 
        fx: 'fade', prev: '#client-prev', next: '#client-next', timeout: 0 
    });
}

function form_input_classes(){
    jQuery('input[name=email]').addClass('input_email');
    jQuery('input[name=firstname]').addClass('input_firstname');
    jQuery('input[name=lastname]').addClass('input_lastname');
    jQuery('input[name=addr1]').addClass('input_addr1');
    jQuery('input[name=addr2]').addClass('input_addr2');
    jQuery('input[name=city]').addClass('input_city');
    jQuery('input[name=zip]').addClass('input_zip');
    jQuery('select[name=state_cd]').addClass('select_state_cd');
    jQuery('select[name=country]').addClass('select_country');
    jQuery('input[name=phone]').addClass('input_phone');

    jQuery('input[type="text"]').addClass('text');
    jQuery('input[type="password"]').addClass('text');
    jQuery('input[type="checkbox"]').addClass('checkbox');
    jQuery('input[type="radio"]').addClass('radiobutton');
    jQuery('input[type="submit"]').addClass('submit');
    jQuery('input[type="image"]').addClass('buttonImage');
}

function form_labelize(){  
    jQuery(".labelize input:text").clearingInput(); 
    jQuery("#searchbox input:text").clearingInput();
}   

jQuery(document).ready(function() {
    assign_fitted();
    form_input_classes();
    form_labelize();
    sidebar_rotator();
    sub_nav();
});
