﻿// JavaScript Document


function fixQTags()
{
	if($.browser.msie)
	{
		$("q").prepend("&#8220;").append("&#8221;");
	}
}


    


$(document).ready(function() {




var totalNum = 35; //the total number of images in a folder.
  var rndNum = Math.floor(Math.random() * totalNum);
  $("#top h1").css("background-image","url(/public/portraits/portrait" + rndNum  + ".jpg)");





$("dl#questions>dt").css({cursor:"help"});
$('dl#questions> dd:gt(0)').hide(); 

$('dl#questions> dt').click(function() {
	
	
$(this).next('dd:hidden').slideDown('slow')
    .siblings('dd:visible').slideUp('fast');

 });
 
 $('#changeTextSize').append('<label>Taille du texte : </label><button id="decTextSizeBt"><img src="/themes/gemmani/img/picto_police_moins.png" width="30" height="30" alt="réduire la taille du texte" /></button><button id="incTextSizeBt"><img src="/themes/gemmani/img/picto_police_plus.png" width="30" height="30" alt="augmenter la taille du texte" /></button>');
  $('#incTextSizeBt').bind("click", function(){
    var fontSize = $('body').css('font-size');
    var num = parseFloat(fontSize);
    var type = fontSize.slice(-2); 
    //if (type=='px' && fontSize<20px | type=='em' && fontSize<3 )
    //{
      $('body').css('font-size', (num*1.2)+type); 
   // }
    
  });
  
  $('#decTextSizeBt').bind("click", function(){
    var fontSize = $('body').css('font-size');
    var num = parseFloat(fontSize);
    var type = fontSize.slice(-2); 
  //  if (type=='px' && fontSize>9 | type=='em' && fontSize>0.5 )
   // {
      $('body').css('font-size', (num*0.8)+type); 
 //   }
    
  });
 
 

    
    

 
 
 $('.fisheyeItem img').css('width','80%');
$('.fisheyeItem span').css('display','none');
$('.fisheyeItem').css({width:'30px', padding: '0',position:'absolute'});
 
 $('#fisheye').Fisheye(
	{
		maxWidth: 44,
		items: 'a',
		itemsText: 'span',
		container: '.fisheyeContainer',
		itemWidth: 30,
		proximity: 60,
		halign : 'center',
		valign : 'top'
	})




 
 
 $(fixQTags);
 
});

