﻿// JScript File
function changeColor(tag)
{
   tag.style.color="#FFD800";
   
   //tag.style.fontWeight="bold";
   
   
}
function changeToPreviousColor(tag)
{
    tag.style.color="#982F67";
    
     //tag.style.fontWeight="normal";
}

function showGallery(imgPath,itemID,catID)
{
    var org = document.URL;
	var what = /&/g;
	var newStr = org.replace(what,'@@@');
	var source = 'bigGallery.asp?path='+ imgPath + '&id='+ itemID+'&cat='+ catID +'&urlPath=' + newStr;
	win = window.open(source, "galleryBig", "top=0, left=0, status=no, resizable, scrollbars=yes")
}

function changeImg(imgP,graphic_file)
{
  
   document[imgP].src = graphic_file;
   
   
   
}
function changeToPreviousImg(imgP,graphic_file)
{
    
    document[imgP].src = graphic_file;
    
}
 
 // Set slideShowSpeed (milliseconds)
        var slideShowSpeed = 4000

        // Duration of crossfade (seconds)
        var crossFadeDuration = 2      
        var arrImg;
        var t;
        var j = 0;
        var p ;
        var preLoad = new Array();
        var preCaption = new Array();
        
        
        function getImg(path)
        {
            
              var arrImg1= document.getElementById('hdnImgArr').value.split('~');            
            p = arrImg1.length;            
            for (i = 0; i < arrImg1.length; i++)
            {
                var arrImg2=arrImg1[i].split(",");
                preLoad[i] = new Image();
                preLoad[i].src = path +  arrImg2[0];
                if(arrImg2[2] != "")
                    preCaption[i]='<a href="' + arrImg2[2] + '">' + arrImg2[1] + '</a>' ;
                else
                    preCaption[i]= arrImg2[1];
            }
        }
        
       

        function runSlideShow()
        {
           
           document.getElementById("caption").innerHTML=preCaption[j]
           if (document.all)
           {             
              document.images.SlideShow.style.filter="blendTrans(duration=2)"
              document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
              document.images.SlideShow.filters.blendTrans.Apply()      
           }
           document.images.SlideShow.src = preLoad[j].src
           if (document.all)
           {
              document.images.SlideShow.filters.blendTrans.Play()
           }
           j = j + 1
           if (j > (p-1)) j=0
           t = setTimeout('runSlideShow()', slideShowSpeed)
           
           
   
      }


