/*
  ------------------------------------------------
  PVII Equal CSS Columns scripts -Version 2
  Copyright (c) 2005 Project Seven Development
  www.projectseven.com
  Version: 2.1.0
  ------------------------------------------------
*/
/**
 * Usage:
 *
 * From JavaScript, use:
 *     $(<select>).ReverseText({minlength: <M>, maxlength: <N>});
 *     where:
 *       <div class="toolbox">
 *		<a href="recrutement/nos-metiers/#" class="decreaseFont" title="Réduire la taille de la police"><img src="fileadmin/templates/img/minus.png" alt="Réduire la taille de la police" /></a>
 *		<a href="recrutement/nos-metiers/#" class="increaseFont" title="Agrandir la taille de la police"><img src="fileadmin/templates/img/plus.png" alt="Agrandir la taille de la police" /></a>              <a href="recrutement/nos-metiers/#" class="print" title="Imprimer la page"><img src="fileadmin/templates/img/print.png" alt="Imprimer la page" /></a>
 *       </div>
 *
 *       <M> is the minimum length of string to reverse (optional)
 *       <N> is the maximum length of string to reverse (optional)
 */

(function($) {

	// jQuery plugin definition
	$.fn.addtoolbox = function(params) {
                var languesite = $('html').attr('lang');
                var titledecrease, titleincrease, titleprint = '';

                switch( languesite ){

                     case 'fr' :
                     default :
                        titledecrease = 'Decrease font size';
                        titleincrease = 'Increase font size';
                        titleprint = 'Print';
                     break;
                     case 'nl' :
                        titledecrease = 'Verminderen lettergrootte';
                        titleincrease = 'Groter lettertype';
                        titleprint = 'Print';
                     break;

                }
		// merge default and user parameters
		params = $.extend( {}, params);

                var toolboxhtml = '';
                toolboxhtml += '<div class="toolbox">';
                toolboxhtml += '<a href="javascript:;" class="decreaseFont" title="'+titledecrease+'"><img src="fileadmin/templates/images/minus.gif" alt="'+titledecrease+'" /></a>';
                toolboxhtml += '<a href="javascript:;" class="increaseFont" title="'+titleincrease+'"><img src="fileadmin/templates/images/plus.gif" alt="'+titleincrease+'" /></a>';
                toolboxhtml += '<a href="javascript:;" class="print" title="'+titleprint+'"><img src="fileadmin/templates/images/print.gif" alt="'+titleprint+'" /></a>';
                toolboxhtml += '</div>';

		$(this).append(toolboxhtml);





		// allow jQuery chaining
		return this;
	};

})(jQuery);

(function ($) {
$.fn.hint = function (blurClass) {
  if (!blurClass) {
    blurClass = 'blur';
  }

  return this.each(function () {
    // get jQuery version of 'this'
    var $input = $(this),

    // capture the rest of the variable to allow for reuse
      title = $input.attr('title'),
      $form = $(this.form),
      $win = $(window);

    function remove() {
      if ($input.val() === title && $input.hasClass(blurClass)) {
        $input.val('').removeClass(blurClass);
      }
    }

    // only apply logic if the element has the attribute
    if (title) {
      // on blur, set value to title attr if text is blank
      $input.blur(function () {
        if (this.value === '') {
          $input.val(title).addClass(blurClass);
        }
      }).focus(remove).blur(); // now change all inputs to title

      // clear the pre-defined text when form is submitted
      $form.submit(remove);
      $win.unload(remove); // handles Firefox's autocomplete
    }
  });
};
})(jQuery);





function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}





$(document).ready(function(){

		//hint
        $('input[title!=""]').hint();

        if( $('.sortable').length ) $('.sortable').tablesorter({
        // pass the headers argument and assing a object
        headers: {
            
            // assign the third column (we start counting zero)
            1: {
                // disable it by setting the property sorter to false
                sorter: false
            }
        }
    });




        equalHeight($(".divInte"));



		$('#slider').nivoSlider({directionNav:false, controlNav:false, effect:'fade,sliceDown,sliceUpDownLeft'});



        $('.titrePageActive').addtoolbox();

        // Reset Font Size
	if( jQuery("#main-content").length ) var originalFontSize = jQuery('#main-content').css('font-size');

	  // Increase Font Size
	if( jQuery(".increaseFont").length ){
		$(".increaseFont").click(function(){
		var currentFontSize = jQuery('#main-content').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*1.2;
		jQuery('#main-content').css('font-size', newFontSize);


		return false;
	  });
	}
	  // Decrease Font Size
	if( jQuery(".decreaseFont").length ){
		jQuery(".decreaseFont").click(function(){
		var currentFontSize = jQuery('#main-content').css('font-size');
		var currentFontSizeNum = parseFloat(currentFontSize, 10);
		var newFontSize = currentFontSizeNum*0.8;
		jQuery('#main-content').css('font-size', newFontSize);

		return false;
		});
	}

	//Bouton Imprimer
	if( jQuery(".print").length ){
		jQuery(".print").click(function(){
			window.print();
			return false;
		});
	}




});



