function ponticlaro_handle_nav(){
    // 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(/.gif$/ig,"_f2.gif");
        $("<img>").attr("src", rollON);
    });
    
    // Navigation rollovers
    $("#nav 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(/.gif$/ig,"_f2.gif"); // strip off extension
        $(this).children("img").attr("src", imgsrcON);
        }
    });
        
    $("#nav a").mouseout(function(){
        $(this).children("img").attr("src", imgsrc);
    });
};


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(/.gif$/ig,"_f2.gif");
        $("<img>").attr("src", rollON);
    });
    
    // Navigation rollovers
    $("#footer 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(/.gif$/ig,"_f2.gif"); // strip off extension
        $(this).children("img").attr("src", imgsrcON);
        }
    });
        
    $("#footer a").mouseout(function(){
        $(this).children("img").attr("src", imgsrc);
    });
};

function ponticlaro_handle_clientsnav(){
    // modified from
    // http://www.atlantajones.com/2007/09/27/
    // easy-reusable-image-rollovers-with-jquery/
    
    // Preload all rollovers
    $("#clientsnav img").each(function() {
        // Set the original src
        rollsrc = $(this).attr("src");
        rollON = rollsrc.replace(/.jpg$/ig,"_f2.jpg");
        $("<img>").attr("src", rollON);
    });
    
    // Navigation rollovers
    $("#clientsnav 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);
        }
    });
        
    $("#clientsnav a").mouseout(function(){
        $(this).children("img").attr("src", imgsrc);
    });
};





function handleTIPJquery(){   
     ponticlaro_handle_type();

    $("a#clientsdropdown").mouseover(function() { 
        $("#clientsmenu").css({ display:"block" });
    });
    
    $("a#clientsdropdown").mouseout(function() { 
        $("#clientsmenu").css({ display:"none" });
    });

    $("#clientsmenu").mouseover(function() { 
        $("#clientsmenu").css({ display:"block" });
    });
    
    $("#clientsmenu").mouseout(function() { 
        $("#clientsmenu").css({ display:"none" });
    });
    
    // rollovers
    //ponticlaro_handle_nav();
    //ponticlaro_handle_footer();
    ponticlaro_handle_clientsnav();
    
    $("div#map-highlights").hide();
    $("div#recovery").hide();
    
    // JOB LOSS PAGE
    $('#read-map-highlights').click(function () {
        $("div#recovery").hide();
        $("#read-recovery").show();
        
        if ($("div#map-highlights").is(":hidden")) {
            $("div#map-highlights").slideDown("slow");
            $("#read-map-highlights").hide();
        } else {
            $("div#map-highlights").hide();
        }
    });

    // JOB LOSS PAGE
    $('#read-recovery').click(function () {
        $("div#map-highlights").hide();
        $("#read-map-highlights").show();
        
        if ($("div#recovery").is(":hidden")) {
            $("div#recovery").slideDown("slow");
            $("#read-recovery").hide();
        } else {
            $("div#recovery").hide();
        }
    });
};


function ponticlaro_handle_type(){

    // Headline Replacement
    FLIR.init({path:'/wp-content/themes/tip/js/facelift/', mode:'wrap'});
    
    // H1
    FLIR.replace('h1', 
                        new FLIRStyle({ mode:'wrap', 
                                        cFont:'eurostile', 
                                        cColor:'487F7F', 
                                        cSize:'15' }, 
        /* hover */     new FLIRStyle({ mode: 'wrap',
                                        cFont:'eurostile',
                                        cColor:'3F3E29'}) ) );
 
    // H2
    FLIR.replace('h2',  
                        new FLIRStyle({ mode:'wrap', 
                                        cFont:'eurostile', 
                                        cColor:'CDC8C2', 
                                        cSize:'32' }, 
        /* hover */     new FLIRStyle({ mode: 'wrap', 
                                        cFont:'eurostile', 
                                        cColor:'3F3E29', 
                                        cSize:'32'}) ) );
    
    // H2 - Section Title
    FLIR.replace('h2.sectiontitle', 
                        new FLIRStyle({ mode:'wrap', 
                                        cFont:'eurostile', 
                                        cColor:'A19589', 
                                        cSize:'32' }, 
        /* hover */     new FLIRStyle({ mode:'wrap',
                                        cFont:'eurostile', 
                                        cColor:'3F3E29', 
                                        cSize:'32'}) ) );
    
    // H3
    FLIR.replace('h3', 
                        new FLIRStyle({ mode:'wrap',
                                        cFont:'eurostile' ,
                                        cColor:'ABA14E',
                                        cSize:'15'}, 
        /* hover */     new FLIRStyle({ mode:'wrap',
                                        cFont:'eurostile', 
                                        cColor:'3F3E29',
                                        cSize:'15'}) ) );
 
    // H4
    FLIR.replace('h4', 
                        new FLIRStyle({ mode:'auto',
                                        cFont:'eurostile' ,
                                        cColor:'487F7F',
                                        cSize:'15'}, 
        /* hover */     new FLIRStyle({ mode:'auto',
                                        cFont:'eurostile', 
                                        cColor:'3F3E29',
                                        cSize:'15'}) ) );
}
