﻿$(document).ready(
    function() {
        //for hover dropdown menu
        $('.collections').parent().height("81px").hover(menu_open, menu_close);
        //For Facebook & Twitter links
        $(".facebook").hover(function() {
            $(this).attr("src", "images/fb_hover.png");
        }, function() {
            $(this).attr("src", "images/fb.png");
        });
        $(".twitter").hover(function() {
            $(this).attr("src", "images/tw_hover.png");
        }, function() {
            $(this).attr("src", "images/tw.png");
        });
    }
);
    
var closetimer = 0;
var ddmenuitem = 0;

function menu_open() {
    ddmenuitem = $(this).parent().find('ul').eq(0).stop().css('visibility', 'visible').animate({
        height: '81px'
    }, 200, 'easeOutSine');
}

function menu_close() {
    if (ddmenuitem) {
        ddmenuitem.stop().animate({
            height: '0px'
        }, 200, function() {
        ddmenuitem.css('visibility', 'hidden');
        });
    }
}

jQuery.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
    }
}
