﻿  
var lastSelected=null;
function PlayRadio()
    {
        //debugger 
       
       if (lastSelected != null)
        {
            lastSelected.className = '';
        }
       
        
        var objval=arguments[0];
        var objtype=arguments[1];
        var hiddendata=document.getElementById(objtype+objval).innerHTML; 
        var hidden_array=hiddendata.split("@@");
         
         var strBaseUrl = 'http://www.livemint.com/';

         var FlashName = "Livemint Videos FlashUnit";

                           
         for(var i=0;i<5;i++)
         {
          
             var objcontent='divContent'+objtype+i;
          
          
           var objdivcontent=document.getElementById(objcontent);
       
          if(objdivcontent == null)
           {
           break;
           }
           else
           {
            if(i==objval)
            {
             
                   lastSelected = objdivcontent;
                 //lastSelected.className='clickvideoimg';
               
            }
            else
            {
            objdivcontent.className='';
              
               
            }
            }
         }
         
          
            var FlashURL=hidden_array[2];
            var VideoFlashUrlarr=FlashURL.split('\\');
            var VideoFlashUrlarrlen=VideoFlashUrlarr.length;
            var VideoFlashUrl=strBaseUrl+'Audio/'+VideoFlashUrlarr[VideoFlashUrlarrlen-1];
           
            var divaudio=document.getElementById('divaudio');
            var divheading=document.getElementById('audioheader');
            var divAbs=document.getElementById('audioAbstract');
            
            //var Readstory=document.getElementById('Readstory');
            //Readstory.href=strBaseUrl+hidden_array[3];
            
            var Loadcomment=document.getElementById('Loadcomment');
            var LoadEmail=document.getElementById('LoadEmail');
            var LoadReadstory=document.getElementById('LoadReadstory');
            var LoadMore=document.getElementById('LoadMore');
            Loadcomment.innerHTML=hidden_array[7]+' Comments |';
            Loadcomment.href=strBaseUrl+'ArticleComments/PostReplytoComment.aspx?aid='+hidden_array[3];
            LoadEmail.href=strBaseUrl+'Articles/EmailArticle.aspx?Eartid='+hidden_array[4];
            LoadReadstory.href=strBaseUrl+hidden_array[3];
            LoadMore.href=strBaseUrl+hidden_array[3];
            
            var curArtid=document.getElementById('curArtid');
            
            var showimg=document.getElementById('Showimg');
            
            showimg.src=hidden_array[4]+"_rdovpf.jpg";
            curArtid.innerHTML=hidden_array[4];
           
            divheading.innerHTML=hidden_array[5];
          
            divAbs.innerHTML=hidden_array[1];
            
            
            
           // VideoFlashUrl="http://localhost:2825/HTbizlive_12/ADO/SamPitroda_Part1_KamlaShow.mp3";
         
          // var strFlashString = "<object type=\"application/x-shockwave-flash\" data=\"ADO/player.swf\" id=\"audioplayer1\" height=\"34\" width=\"150\" ><param name=\"movie\" value=\"ADO/player.swf\"><param name=\"FlashVars\" value=\"playerID=1&amp;autostart=yes&amp;soundFile="+VideoFlashUrl+"\" ><param name=\"quality\" value=\"high\"><param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"transparent\"></object>"
            
         
         //divaudio.innerHTML =strFlashString;
         
            /* var watchshows=document.getElementById('watchshows');
            
            if(hidden_array[6]=='B' || hidden_array[6]=='V')
            {
            watchshows.style.display = 'block';
            }
            else
            {
            watchshows.style.display = 'none';
            
            }*/
         
            var s1 = new SWFObject("articles/player.swf","ply","280","20","9","");
		    s1.addParam("allowfullscreen","true");
	    	s1.addParam("allowscriptaccess","always");	    	
		    s1.addParam("flashvars","file=" + VideoFlashUrl +"&autostart=false&displayclick=none");
		    s1.write("divaudio");
    }     


function OpenRadio()
    {
    var curArtid=document.getElementById('curArtid');
    var artid= curArtid.innerHTML;
    window.open(arguments[1]+'?id='+artid, "PopUp", "width=850,height=600,top=50,left=150,toolbars=no,scrollbars=no,resizable=no");
    }
    
    
    //var lastSelected=null;
   function ChangePodcastlist()
    {
       //debugger 
       
       if (lastSelected != null)
        {
            lastSelected.className = '';
        }
       
         
         var objval=arguments[0];
         var DLValue=arguments[1];
     var hiddendata=document.getElementById('Podcast'+objval).innerHTML; 
    var hidden_array=hiddendata.split("@@");
         
         var strBaseUrl = 'http://www.livemint.com/';

         var FlashName = "Livemint Audio FlashUnit";

                           
         for(var i=0;i<20;i++)
         {
            var objmsimgname='btnaudioImg'+i;
             var objcontent='Divtable'+i;
             var objdownload='imgdownload'+ i;
            var objSpkimg= 'btnaudioImg'+i;
           
            var objmsimg=document.getElementById(objmsimgname);
           var objdivcontent=document.getElementById(objcontent);
           var imgdownload=document.getElementById(objdownload);
           var spkimg=document.getElementById(objSpkimg);
           
           
          
          if(objdivcontent == null)
           {
           break;
           }
           else
           {
            if(i==objval)
            {
                 
                 lastSelected = objdivcontent;
                 lastSelected.className='Selectpodcast';
               
                 spkimg.src="images/speaker_red.gif"
              
            }
            else
            {
            objdivcontent.className='';
            
             spkimg.src="images/speaker_blue.gif"
             
               
            }
            }
         }
         
             var FlashURL=hidden_array[2];
            var AudioFlashUrlarr=FlashURL.split('\\');
            var AudioFlashUrlarrlen=AudioFlashUrlarr.length;
            var AudioFlashUrl=strBaseUrl+'Audio/'+AudioFlashUrlarr[AudioFlashUrlarrlen-1];
           
            var Divplayer=document.getElementById('Divplayer');
            
            var divAbs=document.getElementById('divabstract');
             divAbs.innerHTML="<b>Description:</b>"+hidden_array[1];

            if(DLValue =='K')
             {
              var Seevideo=document.getElementById('Seevideo');
              var VideoURL=hidden_array[6];
            var VideoFlashUrlarr=VideoURL.split('\\');
            var VideoFlashUrlarrlen=VideoFlashUrlarr.length;
            var VideoFlashUrl=strBaseUrl+'Video/'+VideoFlashUrlarr[VideoFlashUrlarrlen-1];
           
           var hiddenVideoURL=document.getElementById('hiddenVideoURL');
          var DivpImg=document.getElementById('DivplayerImg');
          DivpImg.style.display = 'block';
           
            if(hidden_array[5]=='B')
            {
            Seevideo.style.display = 'block';
           hiddenVideoURL.innerHTML=VideoFlashUrl;
          
            }
            else
            {
            Seevideo.style.display = 'none';
            
            }
        }
            
            var s1 = new SWFObject("articles/player.swf","ply","399","20","9","");
		    s1.addParam("allowfullscreen","true");
	    	s1.addParam("allowscriptaccess","always");
	    
		    s1.addParam("flashvars","file=" + AudioFlashUrl +"&autostart=false&displayclick=none");
		    s1.write("Divplayer");
		    
		    
		    

    }
    
     function PlayVideoAlso()
    {
    var hiddenVURL=document.getElementById('hiddenVideoURL');
    var Vurl=hiddenVURL.innerHTML;
    var Divplayer=document.getElementById('Divplayer');
    
    var DivpImg=document.getElementById('DivplayerImg');
    DivpImg.style.display = 'none';
    
    
     var s1 = new SWFObject("articles/player.swf","ply","399","320","9","");
		    s1.addParam("allowfullscreen","true");
	    	s1.addParam("allowscriptaccess","always");
	    
		    s1.addParam("flashvars","file=" + Vurl +"&autostart=false&displayclick=none");
		    s1.write("Divplayer");
		   
   
    }
    
     function PlayVideo()
    {
    
    var Vurl='http://www.livemint.com/video/Mint Newsroom and Studio.flv';
    var Divplayer=document.getElementById('Divplayer');
  
     var s1 = new SWFObject("articles/player.swf","ply","399","320","9","");
		    s1.addParam("allowfullscreen","true");
	    	s1.addParam("allowscriptaccess","always");
	    
		    s1.addParam("flashvars","file=" + Vurl +"&autostart=false&displayclick=none");
		    s1.write("Divplayer");
		   
   
    }
    
    
    //----------------------Audio story popup--------------------------
 
 
 function ChangeAudiostorylist()
    {
       //debugger 
       
       if (lastSelected != null)
        {
            lastSelected.className = '';
        }
       
         
         var objval=arguments[0];
         var DLValue=arguments[1];
     var hiddendata=document.getElementById('Audio'+objval).innerHTML; 
    var hidden_array=hiddendata.split("@@");
         
         var strBaseUrl = 'http://www.livemint.com/';

         var FlashName = "Livemint Audio FlashUnit";

                     
                 var objmsimgname='btnaudioImg'+objval;
                 var objcontent='Divtable'+objval;
                 var objdownload='imgdownload'+ objval;
                var objSpkimg= 'btnaudioImg'+objval;
           
                var objmsimg=document.getElementById(objmsimgname);
               var objdivcontent=document.getElementById(objcontent);
               var imgdownload=document.getElementById(objdownload);
               var spkimg=document.getElementById(objSpkimg);            
                           
//         for(var i=0;i<20;i++)
//         {
                
           
           
          
          if(objdivcontent == null)
           {
           //break;
//           objdivcontent.className='';
//                
//           spkimg.src="images/speaker_blue.gif"
           }
           else
           {
//                if(i==objval)
//                {
                     
                     lastSelected = objdivcontent;
                     lastSelected.className='Selectpodcast';
                   
                     //spkimg.src="images/speaker_red.gif"
                  
//                }
//                else
//                {
//                objdivcontent.className='';
//                
//                 spkimg.src="images/speaker_blue.gif"
//                 
//                   
//                }
            }
         //}
         
             var FlashURL=hidden_array[2];
            var AudioFlashUrlarr=FlashURL.split('\\');
            var AudioFlashUrlarrlen=AudioFlashUrlarr.length;
            var AudioFlashUrl=strBaseUrl+'Audio/'+AudioFlashUrlarr[AudioFlashUrlarrlen-1];
           
            var Divplayer=document.getElementById('Divplayer');
            
            var divAbs=document.getElementById('divabstract');
             divAbs.innerHTML="<b>Description:</b>"+hidden_array[1];
             
             
            
            
            var s1 = new SWFObject("articles/player.swf","ply","399","20","9","");
		    s1.addParam("allowfullscreen","true");
	    	s1.addParam("allowscriptaccess","always");
	    
		    s1.addParam("flashvars","file=" + AudioFlashUrl +"&autostart=true&displayclick=none");
		    s1.write("Divplayer");
		    
		    
		    

    }
    
    //----------------------Audio story popup--------------------------