﻿/// <reference path="jquery-1.2.6.js" />

/// <reference path="Jquery-intellisense.js" />

 $(document).ready(function() {
   // do stuff when DOM is ready
   
        $("#anchor_Previous").bind("click",function()
        {
             PreviousClick();
        }
            
        )
        
        $("#anchor_Next").bind("click",function()
        {
            NextClick();
        }
        )
 
 });
 
 function ChangeImage(sender)
 {
    $img = $("#" + sender);
   
    $mainImage = $("#MainImage");
//            $_selectedImage.attr("src", "/assets/images/hpsliderplay.png");

    $mainImage.attr("src", $img[0].src);

    $_li= $img.parent().find("div");
    var text = $_li.text();
    
    $("#caption").text(text);
 }

function PreviousClick()
{
    $_lis = $("#album").children();
    
    var _lastCss =  $("#album").find("li.last")[0];
    
    var _lastTop = parseInt($(_lastCss).css("top"));
    
    if(_lastTop != -330)
    {
        $_lis.each(function()
        { 
            var _css = parseInt($(this).css("top"));  
            $(this).css("top", _css - 110);
        })
    }
}

function NextClick()
{
    $_lis = $("#album").children();
    
    var _firstCss = parseInt($("#0").css("top"));
    if(_firstCss < 0)
    {
    $_lis.each(function()
    { 
        var _css = parseInt($(this).css("top"));  
        $(this).css("top", _css + 110);
    })
    }
}
