//Cufon.replace('nav li.level_1 > a, .akzidenz, .base h1, .base h2', { hover: true });
	
jQuery.noConflict();

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

function active_nav(){
  var path = location.pathname.substring(1);
  jQuery('#inner-sidebar li a[href$="' + path + '"]').parent().addClass('nav_active'); // check path as typed exactly
  jQuery('#inner-sidebar li a[href$="' + path + '/"]').parent().addClass('nav_active'); // check path with an extra trailing slash added
}

function equal_heights() {
    jQuery.fn.sameHeights = function() {

    jQuery(this).each(function(){
    var tallest = 0;

    jQuery(this).children().each(function(i){
    if (tallest < jQuery(this).height()) { tallest = jQuery(this).height(); }
    });
    jQuery(this).children().css({'height': tallest});
    });
    return this;
    };
}

function superfish() { 
    jQuery('ul.sf-menu').superfish({ 
            delay: 500, 
            animation: {opacity:'show',height:'show'},
            speed: 'normal',
            autoArrows: false
    });
} 
 
function form_input_classes(){
    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(); 
}   

function curtain_controls(){

    jQuery("#curtain").hide();

    jQuery('#main-nav li.node_hot-topics a').click(function () {
        
        jQuery("li.node_hot-topics a").toggleClass('active');
        
        jQuery("#curtain").slideToggle('400', function(){});
        
        return false;
    });
    
    jQuery('#close-curtain').click(function () {
    
        jQuery("li.node_hot-topics a").removeClass('active');
	
    	jQuery("#curtain").slideUp('400');
        
        return false;

    });
}

jQuery(document).ready(function() {
    form_input_classes();
    form_labelize();
    assign_fitted();
    superfish();
    active_nav();
    curtain_controls();
});
