function adjustHeight()
{

    $("div.banner_partner_group").each(

      function (intIndex) {

        var group = $(this);
        var group_height = 0;

        group.children().filter("div").each (

          function (intIndex2) {

            var div = $(this);
            var div_height = div.height();

            if (div_height > group_height) group_height = div_height;

          }

        );

        group.height(group_height);

      }

    );

}

function adjustPosition()
{

    $("div.banner_partner_group div.active").each(

     // For each hottie, run this code. The "indIndex" is the
     // loop iteration index on the current element.
     function( intIndex ) {

     // Bind the onclick event to simply alert the
     // iteration index value.
     var active = $(this);

    	var activeHeight = active.height();
        var parent_height = active.parent().height();
        var margin = Math.ceil((parent_height - activeHeight) / 2);

        active.css('top', margin);


     }

    );



}


function slideSwitch(group_id) {

    var active = $(group_id + " div.active");

    if (active.length == 0 ) active = $(group_id + " div:last");

    var nextEl =  active.next().length ? active.next()
        : $(group_id + " div:first");







    //$active.addClass('last-active');

    //$next.css({opacity: 0.0}).animate({opacity: 1.0}, 1000, function() {  });


    active.removeClass('active');

    //$next.css({opacity: 0.0}).animate({opacity: 1.0}, 1000, function() {  });
    
    
    nextEl.children().find("img").each(
    
      function(intIndex) {


        var currentEl = $(this);
        
        currentEl.css({opacity: 0.0});

      
      }
    
    );
    
    


    nextEl.addClass('active');



    nextEl.children().find("img").each(
    
      function(intIndex) {

        var currentEl = $(this);
      
        if (intIndex > 0)
          currentEl.wait(1000*intIndex).animate({opacity: 1.0}, 1000);        
        else
          currentEl.animate({opacity: 1.0}, 1000);

        

      }
    
    );


    //adjustPosition();



}