(jQuery.noConflict())(function($){
	
	//detect IE5 - 6
	var badBrowser = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");

	$("ul > li:last-child").addClass("last");
	$("ul > li:first-child").addClass("first");
	
	$(".copyright-text > p:first-child").addClass("copy");
    
    /*Hack pour nextgen gallery*/
    var i = 0;
    $(".event-content-extra .ngg-galleryoverview IMG").each(function(){
    	if((i++ % 4) == 3)
    	{
    		$(this).css({'margin-right': '0px'});
    	}
    });
    
    var i = 0;
    $(".expo-img .ngg-galleryoverview .ngg-gallery-thumbnail-box").each(function(){
    	if((i++ % 3) == 2)
    	{
    		$(this).addClass('endRow');
    	}
    	$(this).css({'width': 'auto'});
    });
    
    $(".input-button").hover(
    		function(){
    			$(this).addClass('input-button-hover');
    		},
    		function(){
    			$(this).removeClass('input-button-hover');
    		}
    );

   
});

/**
 * Function used to autofill a field with a default value and put back this value whan field is empty
 * 
 * @param id element id
 * @param v element value
 */
function autoFill(id, v){
	jQuery(id).attr({ value: v }).focus(function(){
		if(jQuery(this).val()==v){
			jQuery(this).val("");
		}
	}).blur(function(){
		if(jQuery(this).val()==""){
			jQuery(this).val(v);
		}
	});
}



//Cufon.replace('#top-menu', { fontFamily: 'ConduitITC-Light' });

Cufon.replace('h1, #content h2, .widget-title, .expo-section .expo-item .expo-date, .expo-section .expo-item .expo-title, .entry-date, #reply-title, #comments-title, a.collection-title', { fontFamily: 'ConduitITCStd-Bold' });

