$( document ).ready(
function () {


/* CORNERS */
$("#main_header").corner("bl top 15px");
$("#main_footer").corner("bottom tr 15px");
$("#portfolio_bottom").corner("tl 10px");
$("#biography_link").corner("br 10px");


/* SEND IT - GÈRE TOUS LES ENVOIS HTML VERS D'AUTRES BALISES AU CHARGEMENT DE LA PAGE */
$("span.sendthis").each(function (i) {
$( '#'+$(this).attr("sendto") ).html( $(this).html() ); 
});


/* TRANSFERT DE DONNÉE HTML VERS UN AUTRE DIV. SUR MOUSE-OVER RETOUR DU HTML ORIGINAL */
$( '.innermove' ).hover( 
function(){ 
originalhtml = $( $( this ).attr("destinationmove") ).html();
$( $( this ).attr("destinationmove") ).html( $( this ).children("span.htmlinner").html() );
},
function(){ 
$( $( this ).attr("destinationmove") ).html(originalhtml);
});


/* CHANGEMENT DE CLASS ON MOUSEOVER */
$( '.overclass' ).hover( 
function () {  
$( this ).addClass( $( this ).attr("overclass") );
},
function () {  
$( this ).removeClass( $( this ).attr("overclass") ); 
}
);


/* AJAX */
/* CALL AJAX POUR TOUT LE SITE */
$( '.ajax' ).click( 
function () { 
$( '.ajax' ).css("color","");
$( this ).css("color","#000");
$( '#'+$( this ).attr("destination") ).load( $( this ).attr("ajax"), { post: $( this ).attr("post") });
} );


/* CHARGEMENT DE FACEBOX */	
jQuery(document).ready(function($) {
$('a[rel=facebox]').facebox();
})


/* FERMETURE DE FACEBOX EN PESANT ESC */
$(document).keydown( function(e) {
if (e.keyCode == 27) closefacebox();
});


/* FERMETURE FACEBOX */
$( '.closefacebox' ).click(
function() {
closefacebox(); }
);


/* FUNCTION POUR FERMETURE FACEBOX */
function closefacebox() {
$(document).trigger('close.facebox');
}


});