﻿// JScript File

        var curPage = 0;
        var currentPic = null;
        var currentDiv = null
        var zIndex = 2;
        var curPicId = 0;
        var myTimeOut = null;
        var isIE7 = false;
        var isMozz = false;
        var isOld = false;
        
        //alert(navigator.userAgent);
        
        if (window.XMLHttpRequest) 
        {
            if(document.documentElement && typeof document.documentElement.style.maxHeight!="undefined")
            {
                if(window.getComputedStyle)
                {
                    isMozz = true;
                    //alert("isMozz");
                }
                else
                {   
                    isIE7 = true;
                    //alert("ie7");
                }
            }
            else
            {
                if(window.getComputedStyle)
                {
                    isMozz = true;
                    //alert("isMozz");
                }
                else 
                {
                    isOld = true;
                    //alert("isOld");
                }
            }
        } 
        

        function prev()
        {
            if(curPage > 0)
            {
                var scrollingContent = document.getElementById("scrollingContent");
                AjaxControlToolkit.Animation.MoveAnimation.play(scrollingContent, 1, 30, 280, 0, true, 'px');
                curPage -= 1;
            }
        }
        
        function next()
        {
            var scrollingContent = document.getElementById("scrollingContent");
            AjaxControlToolkit.Animation.MoveAnimation.play(scrollingContent, 1, 30, -280, 0, true, 'px');
            curPage += 1;  
        }
        
        function showPic(id, stopTimeOut, lightOutUrl)
        {
            
            if(stopTimeOut)
            {
                window.clearTimeout(myTimeOut);
            }
            
            var div = document.getElementById("div" + id);
            var pic = document.getElementById("pic" + id) ;
            //var link = document.getElementById("link") ;
            
            if(lightOutUrl)
            {
                link.style.zIndex = 80;
                link.href = lightOutUrl;
            }
            
            if(pic != currentPic)
            {
                if(isOld)
                {
                    pic.style.visibility = 'visible';
                    if(currentPic)
                    {
                        currentPic.style.visibility = 'hidden';
                    }
                    currentPic = pic;
                }
                else
                {
                    if(currentPic)
                    {
                        zIndex++;
                        currentDiv.style.zIndex=zIndex;
                        AjaxControlToolkit.Animation.FadeOutAnimation.play(currentPic, 0.5, 30, 0, 100, false);
                    }
                   
                    div.style.zIndex=zIndex-1; 
                    pic.style.visibility = 'visible';
                    AjaxControlToolkit.Animation.FadeInAnimation.play(pic, 0.001, 30,0, 100, false);
                      
                    currentPic = pic;
                    currentDiv = div;
                    
               }
            }
        }
        
        
        
        
        function nothing()
        {
        }