﻿$(document).ready(function() {


    //To switch directions up/down and left/right just place a "-" in front of the top/left attribute
    //Vertical Sliding
    $('.boxgrid.slidedown').hover(function() {
        $(".cover", this).stop().animate({ top: '-260px' }, { queue: false, duration: 300 });
    }, function() {
        $(".cover", this).stop().animate({ top: '0px' }, { queue: false, duration: 300 });
    });
    //Horizontal Sliding
    $('.boxgrid.slideright').hover(function() {
        $(".cover", this).stop().animate({ left: '325px' }, { queue: false, duration: 300 });
    }, function() {
        $(".cover", this).stop().animate({ left: '0px' }, { queue: false, duration: 300 });
    });
    //Diagnal Sliding
    $('.boxgrid.thecombo').hover(function() {
        $(".cover", this).stop().animate({ top: '260px', left: '325px' }, { queue: false, duration: 300 });
    }, function() {
        $(".cover", this).stop().animate({ top: '0px', left: '0px' }, { queue: false, duration: 300 });
    });
    //Partial Sliding (Only show some of background)
    $('.boxgrid.peek').hover(function() {
        $(".cover", this).stop().animate({ top: '90px' }, { queue: false, duration: 160 });
    }, function() {
        $(".cover", this).stop().animate({ top: '0px' }, { queue: false, duration: 160 });
    });
    //Full Caption Sliding (Hidden to Visible)
    $('.boxgrid.captionfull').hover(function() {
        $(".cover", this).stop().animate({ top: '160px' }, { queue: false, duration: 160 });
    }, function() {
        $(".cover", this).stop().animate({ top: '260px' }, { queue: false, duration: 160 });
    });

    //Caption Sliding (Partially Hidden to Visible)
    $('#dropdownclick').hover(function() {
        //$('#dropdownbox').stop().animate({ top: '79px' }, { queue: false, duration: 300 });
    });

    $('#dropdownclick').click(function() {
        //doSomething(event);
        //capmouse(event);
        //this.style.cursor='default';
        $('#dropdownbox').stop().animate({ top: '79px' }, { queue: false, duration: 250 });
    });


    $('#dropdownbox').hover(function() {
    }, function() {
        //var dd = document.getElementById('dropdowngrid');
        //alert(dd.style.zIndex);
        //dd.style.zIndex = 0;
        //.style.zIndex = 0;
        //var dd = document.getElementById('dropdownbox');
        //dd.style.top = '-274px';
        $('#dropdownbox').stop().animate({ top: '-195px' }, { queue: false, duration: 700 });

        //dd.style.zIndex = 0;
    });


    //alert($('#dropdownbox').visibility)
    $('#dropdownbox').stop().animate({ top: '-195px' }, { queue: false, duration: 800 });

});






function doSomething(e) {
    var posx = 0;
    var posy = 0;
    if (!e) var e = window.event;
    if (e.pageX || e.pageY) {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY) {
        posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
        posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
    }
    alert(posx);
    // posx and posy contain the mouse position relative to the document
    // Do something with this information
}

