/**************************************
*  GUI functions tool kit (non obscruptive js)

*  required jQuery
*      
* author:  erational(http://www.erational.org)
* version: 0.1
* date:    2009.03.03 (tadao a une autite)
* licence: GPL 3.0    
***********************************/


$(document).ready(function(){
    // menu init
    value = $(".submenu h3 a.on").parent().parent().children("ul").html();
    if (value) {
            value = "<ul>"+value+"<ul>";
            $("#subnav .in").empty().append(value);
    } 
    
    // menu action
    $(".submenu").hover(    
    	function(){
        value = $(this).children("ul").html();
        if (value) {
            value = "<ul>"+value+"<ul>";
            $("#subnav .in").empty().append(value);
        }      
    	},
    	function(){
        // rien a la sortie survol
    	}
    );
    // #menu init
    
    // Font resizer
    // doc: http://www.shopdev.co.uk/blog/text-resizing-with-jquery/

    // Increase Font Size
    $(".increaseFont").click(function(){
      var currentFontSize = $('html').css('font-size');
      var currentFontSizeNum = parseFloat(currentFontSize, 10);
      var newFontSize = currentFontSizeNum*1.2;
      $('html').css('font-size', newFontSize);
      return false;
    });
    // Decrease Font Size
    $(".decreaseFont").click(function(){
      var currentFontSize = $('html').css('font-size');
      var currentFontSizeNum = parseFloat(currentFontSize, 10);
      var newFontSize = currentFontSizeNum*0.8;
      $('html').css('font-size', newFontSize);
      return false;
    });

    // #Font resizer
    
    // Printer
    $(".printer").click(function(){
        window.print();
        return false;
    });
    // #Printer
    
     
    
});

