(function($) { 
$(document).ready(function(){
    $.noConflict();
    /*image gallery*/
    $('#slides').slides({
        preload: true,
        preloadImage: 'images/loading.gif',
        play: 5000,
        pause: 6000,
        slidesLoaded: function() {
            $('.pagination').show();
        }
    });

    /*Left  dropdown menu*/
    $.fn.slideMenu = function(options) {
        return this.each(function(i, v){
            var $obj =$(this);
            var $hide =  $(this).next('ul.div-inner');
            //$hide.hide();
            $obj.click(function(){
                if( $(this).next().attr('class') =='div-inner'){
                if($hide.css('display')==='none'){
                    $hide.stop('true', 'true').slideDown('fast');
                }
                else{
                    $hide.stop('true', 'true').slideUp('fast');
                }
                return false;
                }

            });
        });
    }
    $('.division a').slideMenu();

    /*Choose the highest block*/
    $(window).load(function(){
        var max = Math.max.apply( null, $('.liq').children('.liquid').map(function(){
            return $(this).height();
        }).get() );
        $('.liquid').height(max);
    });


    /*search*/
    $('.search').focus(function() {
        if (this.value == this.defaultValue) {
            this.value = '';
            this.style.backgroundColor="#ff9933";
        }
    })
    .blur(function() {
        if (this.value == '') {
            this.value = this.defaultValue;
            this.style.backgroundColor="#9999cc";
        }
    });
    /*ie pic clicking*/
     if(($.browser.msie && $.browser.version=="6.0") || ($.browser.msie && $.browser.version=="7.0")){
           $('.tbl').append('<span class="l-over"></span>');
     }

});
})(jQuery);
