
/**
 *  Pix-l v.4 - global public scripts
 *
 *  @author     alex, frank, paul
 *  @version    spip.2.0.9
 */

$(function()
{
	//      fancy box
	$("a.zoom").fancybox({
		'frameWidth': 700,
		'frameHeight': 500
	});

	//      boite col droite
	$("#menu-droit .box").css("height",$('.contenu-principal').height()-315);
	
	//      footer
	//      toutes les bordures  meme taille
	$(".footer-box").css("height",$('#footer').height()-10);
	
	//      carroussel
	$("#wheeled").scrollable().mousewheel();

	//      mise en place du target blank pour les liens hors du site
	$(".pdf").attr("target","_blank");
	$(".spip_out").attr("target","_blank");
    $(".spip_out").each(function()
    {
        title =  " (nouvelle fenêtre)";
        if ( $(this).attr( "title" )) title = $(this).attr("title") + " (nouvelle fenêtre)";
        $(this).attr( "title", title );
    });
	
	//      virer le texte par defaut des inputs text et textareas (cf. contact)
	$('.default-val-switcher').each(function()
	{
        var default_val = $(this).val();
        $(this).click( function() { if ( $(this).val() == default_val ) $(this).val( '' ); });
        $(this).focus( function() { if ( $(this).val() == default_val ) $(this).val( '' ); });
        $(this).blur( function() { if ( $(this).val() == '' ) $(this).val( default_val ); });
    });
});
