/* Author: Gaëtan Janssens // plopcom.fr
*/




$(document).ready(function() {
     if( $("td.flammes").width() < 106 ){
        $("td.flammes").width(120);
     }
     $(".categoryBox").hover(
        function () {
        $(this).addClass('hover');
        }, 
        function () {
        $(this).removeClass('hover');
        }
    );
    $("td.adresse a.discret").hover(
        function () {
        $("#infos span").addClass('hover');
        }, 
        function () {
        $("#infos span").removeClass('hover');
        }
    );
    $("#infos span").hover(
        function () {
        $("#infos span").addClass('hover');
        }, 
        function () {
        $("#infos span").removeClass('hover');
        }
    );
    $("#infos span").click(
        function () {
        window.location = $("td.adresse a.discret:first").attr("href");
        }
    );

});

function OnEmptyVal($elementId, $chaine){
    if (!$($elementId).val()) {
        $($elementId).val($chaine);
        $($elementId).addClass("new");
        $($elementId).focus(function () {
            if ($(this).hasClass("new"))
            {
                $(this).val("");
                $(this).removeClass("new");
            }
        });
        $($elementId).focusout(function () {
            if (!$(this).val()) {
                $(this).val($chaine);
            }
            if ($(this).val() == $chaine) {
                $(this).addClass("new");
            }
        });
    }
 }
function OnDefaultVal($elementId, $chaine){
    if ($($elementId).val() == $chaine) {
        $($elementId).val("");
      }
 }
 
 

$(window).load(function(){
		init_slideshow()
})

init_slideshow = function()
{
	$('#home_slides').cycle({
		fx:'fade',
		timeout:5000,
		pager:'#slide_navigation',
		after:update_slide_caption,
		before:fade_slide_caption
	})
}

fade_slide_caption = function(next, previous)
{
	caption_container = $('#project_caption')
	caption_container.fadeOut('fast')
}

update_slide_caption = function(next, previous)
{
	caption_container = $('#project_caption')

	caption = $('span.slide_caption', previous)
	caption_container.fadeIn('fast')
	caption_container.html(caption.html())
	
}



















