﻿function CidadesAnimacao() {
    var $div = $('#cidades-slide');
    var $a = $('.bt-seta-cidades');

    var height = $div.height();
    $div.hide().css({ height: 0 });

    $('.abreCidade').click(function() {
        if ($div.is(':visible')) {
            $div.animate({ height: 0 }, { duration: 1000, complete: function() {
                $div.hide();
                $a.css({ "background": "url('/img/ico-bt-cidades-a.gif') no-repeat scroll 0 0 transparent" });

            }
            });

        } else {
            $div.show().animate({ height: height }, { duration: 1000, complete: function() {
                $a.css({ "background": "url('/img/ico-bt-cidades-hover.gif') no-repeat scroll 0 0 transparent" });
            } 
            });

        }

        return false;
    });
}

$(document).ready(function() { CidadesAnimacao(); });
