﻿/*
    Simple Sprite Hover [v0.8]
    
    Use: Add the class'spritehover' to a Hyperlink5.
    
*/

$(document).ready(function () {

    //.spritehover
    var delay = 400;

    $("a.spritehover").css({ 'overflow': 'hidden', 'display': 'inline-block', 'position': 'relative' });
    $("a.spritehover img").css({ 'position': 'absolute' });

    $("a.spritehover img").load(function () {
        $(this).parent("a").height($(this).height() / 2).width($(this).width());
    }).each(function () {
        if (this.complete) { $(this).trigger("load"); } //Patch for IE cached images
    });

    $("a.spritehover").mouseover(function () {
        $(this).children("img").stop().animate({ top: '-' + $("a.spritehover img").height() / 2 }, delay);
        //"-" + 
    }).mouseout(function () {
        $(this).children("img").stop().animate({ top: '0px' }, delay);
    });





    $("#dropdownabout").mouseover(function () {
        $("#ctl00_lnkAbout").children("img").stop(true, true).animate({ top: '-36px' }, 0);
    });

    $("#dropdownabout").mouseout(function () {
        $("#ctl00_lnkAbout").children("img").stop(true, true).animate({ top: '0px' }, 0);
    });

    $("#dropdownproducts").mouseover(function () {
        $("#ctl00_lnkProducts").children("img").stop(true, true).animate({ top: '-36px' }, 0);
    });

    $("#dropdownproducts").mouseout(function () {
        $("#ctl00_lnkProducts").children("img").stop(true, true).animate({ top: '0px' }, 0);
    });

    $("#dropdownlogin").mouseover(function () {
        $("#ctl00_lnkLogin").children("img").stop(true, true).animate({ top: '-36px' }, 0);
    });

    $("#dropdownlogin").mouseout(function () {
        $("#ctl00_lnkLogin").children("img").stop(true, true).animate({ top: '0px' }, 0);
    });





    //Effect on thumbnails images.
    $("a.imagehover img, img.imagehover").mouseover(function () {
        $(this).stop().fadeTo(0, 0.35);
        $(this).stop().fadeTo(500, 1);
    });

});
