﻿/* 
*	Name : JQueryContentSliderJS.js
*  Author : Soumyo Jyoti Pal
*	Date : 28th February 2010
*
*/

$(function () {
    /*
    * All the code is written within the anonymous function.
    */

    $("#Prev").click(function () {

        /*
        *	Notes :-
        * 1. This function handles the things to be done when previous link is clicked.
        * 2. animate function has four speed options : slow, normal, fast and any custom number in milliseconds for speed.
        * 3. Change in the numbers may be required if the width of the SlidingPanel or the content tabs or the window is changed. 
        */

        if ($("#SlidingPanel").css("left") == "0px") {
            $("#SlidingPanel").animate({ "left": "+=50px" }, "slow").animate({ "left": "-=1050px" }, 1200);
        }
        else {
            $("#SlidingPanel").animate({ "left": "+=500px" }, "slow");
        }

    });

    $("#Next").click(function () {
        /*
        *	Notes :-
        *	1. This function handles the things to be done when next link is clicked.
        *	2. animate function has four speed options : slow, normal, fast and any custom number in milliseconds for speed.
        *	3. Change in the numbers may be required if the width of the SlidingPanel or the content tabs or the window is changed.
        */

        if ($("#SlidingPanel").css("left") == "-1000px") {
            $("#SlidingPanel").animate({ "left": "-=50px" }, "slow").animate({ "left": "+=1050px" }, 1200);
        }
        else {
            $("#SlidingPanel").animate({ "left": "-=500px" }, "slow");
        }
    });

});
