/* JER 2008 */
/* COMMON JAVASCRIPT FUNCTIONS */

/* SAME HEIGHT FOR SAME CLASS ELEMENTS */
function sameHeight(elt) {
	var heightBlockMax=0;
	jQuery(elt).each(function(){ if( jQuery(this).height() > heightBlockMax ) heightBlockMax = jQuery(this).height(); }); // get max height
	if (jQuery.browser.msie) {
		if (parseInt(jQuery.browser.version) <= "6") {
			jQuery(elt).each(function(){ jQuery(this).css("height",heightBlockMax); }); // assign max height
		} else {
			jQuery(elt).each(function(){ jQuery(this).css("min-height",heightBlockMax); }); // assign max height
		}
	} else {
		jQuery(elt).each(function(){ jQuery(this).css("min-height",heightBlockMax); }); // assign max height
	}
	heightBlockMax=0;
}

jQuery.fn.labelOver = function(overClass) {
	return this.each(function(){
		var label = jQuery(this);
		var f = label.attr('for');
		if (f) {
			var input = jQuery('#' + f);

			this.hide = function() {
			  label.css({ textIndent: -10000 })
			}

			this.show = function() {
			  if (input.val() == '') label.css({ textIndent: 0 })
			}

			// handlers
			input.focus(this.hide);
			input.blur(this.show);
		  label.addClass(overClass).click(function(){ input.focus() });

			if (input.val() != '') this.hide();
		}
	})
}

function myLabelOver(elt) {
	jQuery(elt).labelOver('over-apply');
}

function rubList(elt) {
	jQuery(elt).hide();
	jQuery('.active').show();
	jQuery("#contentSidebarInside h3").click( function () {
		jQuery(elt).removeClass('active').hide();
		jQuery(this).next(elt).addClass('active').show('fast');
		return false;
	});
}

jQuery(document).ready(function() {

    /* ADD hasJS CLASS TO BODY FOR ABS/REL POSITIONNING */
	jQuery("body").addClass("hasJS");

    /* HIDE QUICK LINKS */
	jQuery('#quickAccess').addClass('offLeft');

    /* LABEL OVER */
    if (jQuery('.labelOver').size() > 0) { initMyLabelOver = myLabelOver('.labelOver'); }

    /* HIDE/SHOW SUBNAVS IN SIDEBAR */
    if (jQuery('.rubList').size() > 0) { initRubList = rubList('.rubList'); }

});























/* END */