﻿// JScript File

function loadVideos(id,width,height)
{
//    if(id=='ubVisit' || id=='ndtvProfit' || id=='ads')
//    {
//        width='657';
//        height='364';
//    }
//    var winLoc=window.location.search.substring(1);
//    if(winLoc!='')
//    {
//        var queryVal=winLoc.split('=');
//        var divName=queryVal[1];
//        id=divName;
//        if(id=='ndtv')
//        {
//            var hidNdtvId=document.getElementById('hidNdtvId').value;
//            var tvDet=new Array();
//            tvDet=hidNdtvId.split('__');
//            var ctrlName='imgNDTVMain'+tvDet[0];
//            loadNdtv(tvDet[0], true ,'00',tvDet[1])
//        }

//    }
    
    
document.getElementById("videoID").innerHTML="";
document.getElementById('tblNdtv').style.display="none";

    var url="";
    var tit="";
    var objName="swf";
    switch(id)
    {
        case "kfw":
            url="http://www.youtube.com/v/9rVi_tZa9jI&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="Enter the World of KINGFISHER";
            width="445";
            height="364";
            objName="utube";
            break;
        case "ubVisit":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUAHOLlUj546OdaA2S_oDFKA=";
            tit="A Visit to United Breweries";
            width="657";
            height="364";
            break;
        case "ndtvProfit":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUULyzAtPl8zEohrcGUTGR-eg=";
            tit="NDTV Profit interviews Dr. Vijay Mallya";
            width="657";
            height="364";
            break;
        case "ads":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUD6ep2I1OWfLAq_C8SLkulk=";
            tit="ADS";
            width="657";
            height="364";
            break;
        case "ss2009Making":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUULME4dWKrxJ46-utFKgh2qk=";
            tit="Making of 2009 KINGFISHER Swimsuit Special";
            width="746";
            height="413";
            break;
        case "ss2008Making":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUD1nut3kOd4UpkG9XynfdqY=";
            tit="Making of 2008 KINGFISHER Swimsuit Special";
            width="657";
            height="364";
            break;
        case "ss2007Making":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUC5y2aKFF2y5sZgidvtkqT4=";
            tit="Making of 2007 KINGFISHER Swimsuit Special";
            width="657";
            height="364";
            break;
        case "ss2004Making":
            url="http://www.youtube.com/v/ZH3rCna0sps&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="Making of 2004 KINGFISHER Swimsuit Special";
            width="425";
            height="349";
            objName="utube";
            break;
        case "ss2003Making":
            url="http://www.youtube.com/v/ZAfUG_X4q_o&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="Making of 2003 KINGFISHER Swimsuit Special";
            width="425";
            height="349";
            objName="utube";
            break;
        case "modelHunt":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUNg3Q-vLrpIVzX782lXANUE=";
            tit="Model Hunt 2007";
            width="657";
            height="364";
            break;
        case "gtGoogly":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUDAmlxxKCNdWuKCADdvDc48=";
            tit="Good Times Googly";
            width="657";
            height="364";
            break;
        case "lords83":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUIf7wMQkfffcxcezWP2dPIk=";
            tit="Lords of  ’83";
            width="657";
            height="364";
            break;
        case "ipl":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUGRahth0-qsR2B-EUQ2hFjw=";
            tit="IPL videos";
            width="657";
            height="364";
            break;
        case "corp5":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUBGJXwctw-3kuM1iWRm7W60=";
            tit="Corporate 5s 2007";
            width="657";
            height="364";
            break;
        case "travel":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUIA9VcxzLF6U62Bm0jRdylw=";
            tit="TRAVEL";
            width="416";
            height="337";
            objName="utube";
            break;
        case "salsa":
            url="http://www.youtube.com/v/OXtq_ENEpiA&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="Salsa Congress 2007";
            width="425";
            height="349";
            objName="utube";
            break;
        case "pubRockFest2008":
            url="http://www.youtube.com/v/tdZFUR5y5Vw&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="PubRockFest 2008";
            width="425";
            height="349";
            objName="utube";
            break;
        case "keralaRocks2008":
            url="http://www.youtube.com/v/WeokPBuzPC8&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="Kerala Rocks 2008";
            width="425";
            height="349";
            objName="utube";
            break;
        case "nightOut":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUPAIMzG5u2y4KPHWm0jXm0I=";
            tit="Night Out";
            width="657";
            height="364";
            break;
        case "sepultura":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUI9mJBgC71j7cTvM16eW-kY=";
            tit="Sepultura @ KINGFISHER MetalFest 2007";
            width="657";
            height="364";
            break;
        case "octFest":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUEalkRkMTj60nDfS3_dgcdc=";
            tit="Great Indian OctoberFest 2007";
            width="657";
            height="364";
            break;
        case "pubRockFest2007":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUJmh7NEwfT1q1AOLTPfT9Q8=";
            tit="PubRockFest 2007";
            width="657";
            height="364";
            break;
        case "kfRise":
            url="http://www.youtube.com/v/IKMLSqys1dE&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&border=1";
            tit="KINGFISHER Rise";
            width="425";
            height="349";
            objName="utube";
            break;
        case "keralaRocks2007":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUPDeGaauqlcuhqfdZE5poIw=";
            tit="Kerala Rocks 2007";
            width="657";
            height="364";
            break;
        case "food":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUMuDT1OHY2N6D100tJ-uEaM=";
            tit="FOOD";
            width="657";
            height="364";
            break;
        case "bohemiaVideo":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUDYc_c7kEoxFuAPFup306YY=";
            tit="BOHEMIA";
            width="657";
            height="364";
            break;
        case "blue":
            //url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUIZVDGDf-MD1bsEQxVv5alM=&color1=0x3a3a3a&color2=0x999999";
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUMOf3tt__WY2o27bEWdujPI=";
            tit="BLUE";
            width="657";
            height="364";
            break;
        case "userVideos":
            url="http://www.youtube.com/cp/vjVQa1PpcFOo5K300-RUUJG4zSygnzdqGBwZPbzoYRo=";
            tit="USER VIDEOS";
            width="657";
            height="364";
            break;
    }
    
    //var strScript="<object width='"+width+"' height='"+height+"'><param name='movie' value='"+url+"'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='"+url+"' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='"+width+"' height='"+height+"'></embed></object>";
    if(objName=="utube")
        var strScript="<embed wmode='transparent' src='"+url+"' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='"+width+"' height='"+height+"'></embed>";
    else if(objName=="swf")
        var strScript="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='660' height='364' id='youtube' align='middle'><param name='allowScriptAccess' value='sameDomain' /><param name='allowFullScreen' value='false' /><param name='movie' value='youtube.swf?strval="+url+"' /><param name='quality' value='high' /><param name='wmode' value='transparent' /><param name='bgcolor' value='#ffffff' /><param wmode='transparent' />	<embed wmode='transparent' src='youtube.swf?strval="+url+"' quality='high' bgcolor='#ffffff' width='660' height='364' name='youtube' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
//    if(id=="blue")
//        var strScript="<embed src='"+url+"' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='"+width+"' height='"+height+"'></embed>";
    document.getElementById("watch_video").innerHTML=strScript;
    document.getElementById("title").innerHTML=tit;
}




function getTV()
{
    var winLoc=window.location.search.substring(1);
    if(winLoc!='')
    {
        var queryVal=winLoc.split('=');
        var divName=queryVal[1];
        
        if(divName=='ndtv')
        {
            var hidNdtvId=document.getElementById('hidNdtvId').value;//alert(hidNdtvId);
            var tvDet=new Array();
            tvDet=hidNdtvId.split('__');
            var ctrlName='imgNDTVMain'+tvDet[0];
            loadNdtv(tvDet[0], true ,'00',tvDet[1])
            
            document.getElementById('tblNdtv').style.display="block";
            document.getElementById("watch_video").innerHTML="";
            document.getElementById("title").innerHTML="NDTV Good Times";
        }
        else //if(divName=='ubVisit' || divName=='ndtvProfit' || divName=='ads')
        {
            //var width='657';
            //var height='364';
            loadVideos(divName,'','');
        }

    }
    else
        loadVideos('kfw','445','364');
}
function getPlayer(videoId)
{
    var strPlayer="";
    var video="";
    var title="";
    if(videoId==1)
    {
        video=img1;
        title=title1;
    }
    if(videoId==2)
    {
        video=img2;
        title=title2;
    }
    if(videoId==3)
    {
        video=img3;
        title=title3;
    }
    strPlayer="<embed src=\"http://www.ndtvgoodtimes.com/lifestyle/VideoPlayer/video_320x240.swf?domain=www.ndtv.com/convergence&id="+video+"&autoPlay=&isAd=na\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"345\" height=\"317\" />";
    document.getElementById("<%=lblPlayer.ClientID%>").innerHTML=strPlayer;
//    document.getElementById('title').innerHTML=title;
    document.getElementById('lblVideoTitle').innerHTML=title;

}


function getPlayerMain(video,ctrl,title)
{
    var strPlayer="";
    
    document.getElementById('lblVideoTitle').innerHTML=title;
    var hidSelected=document.getElementById('hidSelected').value;
    if(hidSelected!='0')
        document.getElementById(hidSelected).style.borderColor='#FFFFFF';
        
    ctrl.style.borderColor='#960001';
        document.getElementById('hidSelected').value=ctrl.id;

    strPlayer="<embed src=\"http://www.ndtvgoodtimes.com/lifestyle/VideoPlayer/video_320x240.swf?domain=www.ndtv.com/convergence&id="+video+"&autoPlay=&isAd=na\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"345\" height=\"317\" />";
    document.getElementById("<%=lblPlayer.ClientID%>").innerHTML=strPlayer;

}
function UpdateCount(VideoId)
{
    ver04_html_TV.UpdateCount(VideoId,UpdateCount_CallBack);    
}
function UpdateCount_CallBack(response)
{
}

function loadNdtv(gl_ids, isStart,ctrl,title)
{
    document.getElementById('lblVideoTitle').innerHTML=title;
    //alert('');
    if(document.getElementById('hidSelected')!=null)
    {
        var hidSelected=document.getElementById('hidSelected').value;
        if(hidSelected!='0')
            document.getElementById(hidSelected).style.borderColor='#FFFFFF';
    }
      
    if(ctrl!='00')
    {  
        ctrl.style.borderColor='#960001';
        document.getElementById('hidSelected').value=ctrl.id;
    }
    
    
    if(typeof(window['Vdopia']) == 'function') 
    {
//        UpdateCount(gl_ids);
//        var idURL = "ndtv://"+gl_ids.toString();
//        Vdopia({api_key: "b9acc5940d3298c714b93fb5798d5c2f",
//        autostart: isStart,
//        video_fileurl: idURL,
//        video_runtime: "110", video_title:"Shahrukh Khan Interview",
//        video_category:"AU|TR|SC|SP|CR|MU|HC|PA|NE|BU|HE|SH|LF|PO|FI|EN",ad_format:"preroll|postroll",
//        player_allowfullscreen: "true", player_width:"340",player_height:"317"},'videoID');
    } 
    else 
    {
       // UpdateCount(gl_ids);
       // var strPlayer="<embed src=\"http://www.ndtvgoodtimes.com/lifestyle/VideoPlayer/video_320x240.swf?domain=www.ndtv.com/convergence&id="+gl_ids+"&autoPlay=&isAd=na\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"345\" height=\"317\" />";
        var strPlayer="<iframe id='ifrmDetail' frameborder='0' src='http://goodtimes.ndtv.com/lifestyle/VideoPlayer/kingfisher.aspx?id="+gl_ids+"%26autostart=false' marginheight='0px' marginwidth='0px' scrolling='no' height='322px' width='344px' style='margin:0px; padding:0px' allowtransparency='false'></iframe>";
        document.getElementById("videoID").innerHTML=strPlayer;
    }
    
} 


function loadNdtv1(gl_ids1,isStart)
{

    var strPlayer="";
    var video="";
    var title="";
    if(gl_ids1==1)
    {
        video=img1;
        title=title1;
    }
    if(gl_ids1==2)
    {
        video=img2;
        title=title2;
    }
    if(gl_ids1==3)
    {
        video=img3;
        title=title3;
    }


    document.getElementById('lblVideoTitle').innerHTML=title;
    
    if(typeof(window['Vdopia']) == 'function') 
    {
        UpdateCount(video);
        var idURL = "ndtv://"+video.toString();
        Vdopia({api_key: "b9acc5940d3298c714b93fb5798d5c2f",
        autostart: isStart,
        video_fileurl: idURL,
        video_runtime: "110", video_title:"Shahrukh Khan Interview",
        video_category:"AU|TR|SC|SP|CR|MU|HC|PA|NE|BU|HE|SH|LF|PO|FI|EN",ad_format:"preroll|postroll",
        player_allowfullscreen: "true", player_width:"340",player_height:"317"},'videoID');
    } 
    else 
    {
        UpdateCount(video);
        var strPlayer="<embed src=\"http://www.ndtvgoodtimes.com/lifestyle/VideoPlayer/video_320x240.swf?domain=www.ndtv.com/convergence&id="+video+"&autoPlay=&isAd=na\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"345\" height=\"317\" />";
        document.getElementById("videoID").innerHTML=strPlayer;
    }
}
function showNdtv()
{
    document.getElementById('tblNdtv').style.display="block";
    document.getElementById("watch_video").innerHTML="";
    document.getElementById("title").innerHTML="NDTV Good Times";
    var hidNdtvId=document.getElementById('hidNdtvId').value;//alert(hidNdtvId);
    var tvDet=new Array();
    tvDet=hidNdtvId.split('__');
    var ctrlName='imgNDTVMain'+tvDet[0];
    loadNdtv(tvDet[0], true ,'00',tvDet[1])
}