﻿// JScript File 



function ChangeImage(imgId, array, index,repeaterId,panelId)

{

    var img = document.getElementById(imgId);

    img.src = array[index];

    img.title = index+1;

    

    var controlPanel = document.getElementById(panelId);

    var links = controlPanel.getElementsByTagName("a");

    

    for(i=0; i < links.length-2; i++)

    {

        links[i].style.fontWeight= 'normal';

        links[i].style.color= '';            

    }



    if( index < 10 )    

        link = document.getElementById(repeaterId+'_ctl0'+index+'_indexLink');        

    else

        link = document.getElementById(repeaterId+'_ctl'+index+'_indexLink');  

        

    link.style.fontWeight= 'bold';

    link.style.color = '#ffffff';    

   

    MM_preloadImages(array[GetNextIndex(array.length,index)]);

    

}



function GetNextIndex(arraylength, index)

{    

    index++;

    if(index == arraylength)

    {

        return 0;

    }

    else

    {

        return index;

    }

}



function GetPrevIndex(arraylength, index)

{    

    index--;

    if(index < 0)

    {

        return arraylength - 1;

    }

    else

    {

        return index;

    }

}



function MM_preloadImages() { //v3.0

  

  //alert(MM_preloadImages.arguments[0]);

  

  var d=document; 

  if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];  }}

    //alert(a[i]);

}





    // for hexcode control

function SetColor(c,divName)

{       



    //alert(divName);

           

    try

    {                

        div = document.getElementById(divName);

        if(c.indexOf("_") == -1 && c.length == 6)

        {           

            div.style.backgroundColor = '#' + c; 

        }



    }

    catch(err)

    {

        //alert(err.description );

    }

                

}



