$(document).ready(function() {
    
    var prevTarg = '';
    var newLink  = '';
    var newTarg = '';
        
    jQuery('#sliders').accordion({ 
        active: false, 
        header: '.set', 
        animated: 'easeslide' 
    }).bind("change.ui-accordion", function(event, ui) { 
        if( prevTarg != '' ) {
           top.frames["frame-" + prevTarg].location.href = '/loading.html';
        }
    });
        
    $('#sliders .set').click(function () { 
        if( !$("#sliders").hasClass("open") ) {
            $("#sliders .set a").animate( { height:"45px" }, { queue:false, duration:1500 } );
            $("#sliders").addClass("open");
        }
    });
    
    $('#sliders .set a').click(function () { 
       prevTarg = newTarg;
       newLink = $(this).attr("href");
       newTarg = $(this).attr("target");
       top.frames["frame-" + newTarg].location.href = newLink;
    });

})

