function ponticlaro_handle_footer(){
    // modified from
    // http://www.atlantajones.com/2007/09/27/easy-reusable-image-rollovers-with-jquery/
    
    // Preload all rollovers
    $("#footer img").each(function() {
        // Set the original src
        rollsrc = $(this).attr("src");
        rollON = rollsrc.replace(/.jpg$/ig,"_f02.jpg");
        $("<img>").attr("src", rollON);
    });
    
    // Navigation rollovers
    $("#footer a").mouseover(function(){
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_f02/);
        
        
        // don't do the rollover if state is already ON
        if (!matches) {
        imgsrcON = imgsrc.replace(/.jpg$/ig,"_f02.jpg"); // strip off extension
        $(this).children("img").attr("src", imgsrcON);
        }
        
    });
        
    $("#footer a").mouseout(function(){
        $(this).children("img").attr("src", imgsrc);
    });    
}

function ponticlaro_handle_header(){
    // modified from
    // http://www.atlantajones.com/2007/09/27/easy-reusable-image-rollovers-with-jquery/
    
    // Preload all rollovers
    $("#nav img").each(function() {
        // Set the original src
        rollsrc = $(this).attr("src");
        rollON = rollsrc.replace(/.jpg$/ig,"_f02.jpg");
        $("<img>").attr("src", rollON);
    });
    
    // Navigation rollovers
    $("#nav a").mouseover(function(){
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_f02/);
        
        
        // don't do the rollover if state is already ON
        if (!matches) {
        imgsrcON = imgsrc.replace(/.jpg$/ig,"_f02.jpg"); // strip off extension
        $(this).children("img").attr("src", imgsrcON);
        }
        
    });
        
    $("#nav a").mouseout(function(){
        $(this).children("img").attr("src", imgsrc);
    });    
}

function ponticlaro_handle_homepage(){
    // modified from
    // http://www.atlantajones.com/2007/09/27/easy-reusable-image-rollovers-with-jquery/
    
    // Preload all rollovers
    $("#home img").each(function() {
        // Set the original src
        rollsrc = $(this).attr("src");
        rollON = rollsrc.replace(/.jpg$/ig,"_f2.jpg");
        $("<img>").attr("src", rollON);
    });
    
    // Navigation rollovers
    $("#home a").mouseover(function(){
        imgsrc = $(this).children("img").attr("src");
        matches = imgsrc.match(/_f2/);
        
        
        // don't do the rollover if state is already ON
        if (!matches) {
        imgsrcON = imgsrc.replace(/.jpg$/ig,"_f2.jpg"); // strip off extension
        $(this).children("img").attr("src", imgsrcON);
        }
        
    });
        
    $("#home a").mouseout(function(){
        $(this).children("img").attr("src", imgsrc);
    });    
}



function finoJquery(){
	$('#popups > li').hover(function() {
		if (obj) {
			obj.find('ul').fadeOut('fast');
			obj = null;
		} //if
		
		$(this).find('ul').fadeIn('fast');
	}, function() {
		obj = $(this);
		setTimeout(
			"checkHover()",
			400);
	});
	
	ponticlaro_handle_footer();
	ponticlaro_handle_header();
	ponticlaro_handle_homepage();
	
    /*********************************************************
        PNG images
    *********************************************************/
    $('img[@src$=.png]').ifixpng(); 

	
	    
    /*********************************************************
        Slideshow
    *********************************************************/
    var slideshowSpeed = 800;
    var slideshowTimeout = 3000;    
    
    $('#s1').cycle({ 
        fx:      'fade', 
        speed:    slideshowSpeed, 
        timeout:  slideshowTimeout,
        continuous: 0, // set this to 0 so timeout will work
        slideExpr: 'li',
        cleartype: '1',
        prev: '#prev1',
        next: '#next1'
    });
    
    $('#s1').cycle('pause');   
    
    $('#auto1on').click(function() { 
        $('#s1').cycle('pause'); 
        $(this).fadeOut('fast');
        $('#auto1off').fadeIn('slow');
    });
    
    $('#auto1off').click(function() { 
        $('#s1').cycle('resume'); 
        $(this).fadeOut('fast');
        $('#auto1on').fadeIn('slow');
    });
    
    


}