﻿// JScript File

function GetDetails()
{
urls=document.getElementById("ctl00_MainBody_IPLSlideShow_txturls").value;
images= urls.split(",");
kickers = document.getElementById("ctl00_MainBody_IPLSlideShow_txtKicker").value;
PhotoKicker=kickers.split("~");
slideshow_automatic(); 
}
function Changecur(id)
{
        try
        {
           
            document.getElementById("ctl00_MainBody_IPLSlideShow_"+id).style.cursor = 'pointer';
        }
        catch(e)
        {
            document.getElementById(id).style.cursor = 'pointer';
        }
}

function image_effects()
{

   //set the transition to the number selected in the list
 document.getElementById("ctl00_MainBody_IPLSlideShow_photo").style.filter ="progid:DXImageTransform.Microsoft.Fade(duration=1,overlap=1.0)"
 document.getElementById("ctl00_MainBody_IPLSlideShow_photo").filters[0].Apply();
 document.getElementById("ctl00_MainBody_IPLSlideShow_photo").filters[0].Play();

  
}


function ShowImage(imgid)
{
if(running)
{
Pause_image();
}
        if(browserName == "Netscape")
        {
        }
        else
        {
        image_effects();
        }
ShowNumber(imgid);
num=imgid;
document.getElementById("ctl00_MainBody_IPLSlideShow_photo").src=images[imgid];
document.getElementById("ctl00_MainBody_IPLSlideShow_lblKicker").innerHTML=PhotoKicker[imgid];


}

function ShowNumber(imgid1)
{
    for(var t=0;t<tphoto;t++)
    {

    if(t==imgid1)
    {    
        document.getElementById("Image"+t).className='numbr-black-bg';
        document.getElementById("Num"+t).className='numbr-black-txt';
        //num=t;
    }
    else
    {  
       document.getElementById("Image"+t).className='numbr-white-bg';
       document.getElementById("Num"+t).className='numbr-white-txt';
       
    }
    

    }
}

function ShowTab(id)
{

for(var t=1;t<=2;t++)
{
    if(t==id)
    {
    document.getElementById("Tab"+t).style.display='block';
    document.getElementById("tabwt"+t).className='tab-wt';
    document.getElementById("tabtxt"+t).className='tab-wt-txt';
    }
    else
    {
    document.getElementById("Tab"+t).style.display='none';
    document.getElementById("tabwt"+t).className='tab-gry';
    document.getElementById("tabtxt"+t).className='tab-gry-txt';
    }
}

}


function slideshow_automatic()
{ 
try
{
running=true;
    if (num<tphoto-1)
     {
       num++;
       current++;
       timeDelay=setTimeout("slideshow_automatic()",4000); 
       if(browserName == "Netscape")
       { 
       document.getElementById("ctl00_MainBody_IPLSlideShow_photo").src=images[num];
       document.getElementById("ctl00_MainBody_IPLSlideShow_lblKicker").innerHTML=PhotoKicker[num];
       ShowNumber(num);
       }
       else
       {
       image_effects();
       document.getElementById("ctl00_MainBody_IPLSlideShow_photo").src=images[num];
       document.getElementById("ctl00_MainBody_IPLSlideShow_lblKicker").innerHTML=PhotoKicker[num];
       ShowNumber(num);
       }  
     }
       
     else if (num==tphoto-1) 
     {
       
       num=0;
       current=1;  
         
       //sets the timer value to 4 seconds,we can create a timing loop by using the setTimeout method
       timeDelay=setTimeout("slideshow_automatic()",4000); 
       
       if(browserName == "Netscape")
       {       
       document.getElementById("ctl00_MainBody_IPLSlideShow_photo").src=images[num];
       document.getElementById("ctl00_MainBody_IPLSlideShow_lblKicker").innerHTML=PhotoKicker[num];
       ShowNumber(num);
       }
       else
       {
       image_effects();
       document.getElementById("ctl00_MainBody_IPLSlideShow_photo").src=images[num];
       document.getElementById("ctl00_MainBody_IPLSlideShow_lblKicker").innerHTML=PhotoKicker[num];
       ShowNumber(num);
       }
     }
     }
     catch(errr)
     {
          
     
     }
   }  
   
function Pause_image()
{
if(running)
{
running=false;
window.clearTimeout(timeDelay);
timeDelay =0;
document.getElementById("imgplay").src="http://www.hindustantimes.com/fullcoverage/images/play.jpg";
}
else
{
timeDelay=setTimeout("slideshow_automatic()",4000); 
document.getElementById("imgplay").src="http://www.hindustantimes.com/fullcoverage/images/pause.jpg";
}
}


