//galerry 5 --slide show
// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 4000;
// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 0.4;


// =====================================
// Do not edit anything below this line!
// =====================================

var Picture = new Array(); // don't change this
var tss;
var iss;
var jss = 1;
var pss=0;
var mdid=0;

var preLoad = new Array();

function preSlideShow(newMdID)
{
    mdid=newMdID;
    
    pss = Picture.length-1;
    
    for (iss=1;iss<pss+1;iss++)
    {
        preLoad[iss] = new Image();
        preLoad[iss].src = Picture[iss];
    }
    
    //alert(preLoad.length);
    runSlideShow();
}

function runSlideShow()
{
    var imgMain=document.getElementById("imgMain"+mdid);
    
    if (document.all)
    {
        ////document.images.imgMain.style.filter=blendTrans(duration=2);
        //document.images.imgMain.style.filter="blendTrans(duration="+CrossFadeDuration+")";
        //document.images.imgMain.filters.blendTrans.Apply();
        imgMain.style.filter="blendTrans(duration="+CrossFadeDuration+")";
        imgMain.filters.blendTrans.Apply();
    }

    //document.images.imgMain.src = preLoad[jss].src;
    //if (document.all) document.images.imgMain.filters.blendTrans.Play();
    imgMain.src = preLoad[jss].src;
    if (document.all) imgMain.filters.blendTrans.Play();
    
    jss = jss + 1;
    if (jss > (pss)) jss=1;
        tss = setTimeout('runSlideShow()', SlideShowSpeed);
}


//-------------------------------------------------------------------//
//-------------------------------------------------------------------//
//-------------------------------------------------------------------//

var timer;
var speed = 2;

var isAClick=0;

var lastImagesContainerID="";

//----------------------------->  HORIZONTAL(IMAGES) <------------------------>
function move_index(valu) 
{
    //alert(valu);
    //divImages
    //tdScroller
    obj = document.getElementById("divImages");
    obj.scrollLeft = obj.scrollLeft + (speed*valu);	  
}

function xx(valu)
{
    timer = setTimeout('xx('+valu+')',1);
    move_index(valu);
}

function stopper()
{
    clearTimeout(timer);
}

function clearAllImageItems(count,catID)
{
    
    //alert(count);
    for (i=0;i<=count;i++)
    {
        //alert(i);
        document.getElementById("tdItem"+catID+i).className="tdItem";
        document.getElementById("imgItem"+catID+i).className="imgItem";
    }
}

//----------------------------->  VERTICAL(CATEGORIES) <------------------------>
function move_indexV(valu) 
{
    //alert(valu);
    //divImages
    //tdScroller
    obj = document.getElementById("divCategories");
    obj.scrollTop = obj.scrollTop + (speed*valu);	  
}

function xxV(valu)
{
    timer = setTimeout('xxV('+valu+')',1);
    move_indexV(valu);
}

function stopperV()
{
    clearTimeout(timer);
}

function clearAll(count,controlIdToStore)
{
    if (lastImagesContainerID!="")
    {
        document.getElementById(lastImagesContainerID).innerHTML=document.getElementById("divImagesContainter").innerHTML;
    }
    
    lastImagesContainerID=controlIdToStore;
    //alert(count);
    for (i=0;i<=count;i++)
    {
        document.getElementById("imgCat"+i).className="imgItemCategory";
        document.getElementById("tdCategory"+i).className="tdCategory";
    }

}



