﻿
var weDo = new Array();

weDo[0] = "Do you know how the UK will get its superfast broadband network?";

weDo[1] = "Do you know how TV will benefit from the behaviourial advertising revolution?";

weDo[2] = "Do you know how the UK Independent TV sector is going to drive future growth?";

weDo[3] = "Do you know how Generation Y will be consuming their media in 5 years’ time?"; 

weDo[4] = "Do you know how important portable media devices will be to overall media time and spend by 2017?";

weDo[5] = "Do you know how tablets and e-readers will impact the global book market?";

weDo[6] = "Do you know how important social media networks might become to content distribution and access?";

weDo[7] = "Do you know how news will be delivered and consumed in 10 years’ time?";

weDo[8] = "Do you know how OTT will impact current pay TV business models?";

weDo[9] = "Do you know how the creative and digital media sectors can make the most of globalisation?";

weDo[10] = "Do you know how copyright laws and institutions need to be adapted to the web 2.0 age?";

var weDid = new Array();
var weDidYear = new Array();

<!-- -->

weDid[0] = "Do you know how the UK will get its superfast broadband network? ";
weDidYear[0] = 2002;

weDid[1] = "Do you know how TV will benefit from the behaviourial advertising revolution?";
weDidYear[1] = 2005;

weDid[2] = "Do you know how the UK Independent TV sector is going to drive future growth?";
weDidYear[2] = 1997;

weDid[3] = "Do you know how Generation Y will be consuming their media in 5 years’ time? ";
weDidYear[3] = 2003;

weDid[4] = "Do you know how important portable media devices will be to overall media time and spend by 2017? ";
weDidYear[4] = 1999;

weDid[5] = "Do you know how tablets and e-readers will impact the global book market?";
weDidYear[5] = 1995;

weDid[6] = "Do you know how important social media networks might become to content distribution and access? ";
weDidYear[6] = 2001;

weDid[7] = "Do you know how news will be delivered and consumed in 10 years’ time?";
weDidYear[7] = 2002;

weDid[8] = "Do you know how OTT will impact current pay TV business models?";
weDidYear[8] = 2001;

weDid[9] = "Do you know how the creative and digital media sectors can make the most of globalisation? ";
weDidYear[9] = 2003;

weDid[10] = "Do you know how copyright laws and institutions need to be adapted to the web 2.0 age?";
weDidYear[10] = 2008;
 
//weDid[11] = "Did you know that programmes such as Top Gear and Dr Who would be among the most requested programmes on the BBC’s iPlayer";
//weDidYear[11] = 2007;
 
//weDid[12] = "Did you know that free to air broadcasters would launch an initiative to get internet delivered on demand content direct to the TV (YouView)";
//weDidYear[12] = 2006;
 
//weDid[13] = "Did you know that ISPs would want to use tracked internet usage behaviour to take on Google in offering intention based advertising";
//weDidYear[13] =  2006;

//weDid[14] = "Did you know Personal Video Recorders (PVRs) would prove so popular, so quickly";
//weDidYear[14] =  2006;

//weDid[15] = "Did you know pay TV operators would prove so resilient to the downturn";
//weDidYear[15] =  2008;

<!-- -->


var weDidPos = -1; //Starting value
var st;

function getNewWeDid() 
{
    weDidPos;
    
    newVal = Math.floor(Math.random()*weDid.length)
    
	//alert(weDidPos + ":"+ newVal);
    if(weDidPos == newVal)
    {
        getNewWeDid();
    }
    else
    {
        weDidPos = newVal;
    }
}

function doWeDid()
{
    
        getNewWeDid();
        fadeOutYear();
      st = weDid[weDidPos].split("");
      $("#we-did").css("opacity","0");
       $("#we-did").html("");
      getWeDidPos();  
      $("#we-did").css("opacity","1");
   doDelayedArray(0);
}


function doDelayedArray(i)
{
    if(i < st.length)
    {
        $("#we-did").text($("#we-did").text() + st[i]);
        i++;
       var t= setTimeout("doDelayedArray("+i+")", 35);
    }
    else
    {  
        $("#we-did").html($("#we-did").html() + "<br /><br/><span class=\"yellow\"><a href=\"/statements.php\">We know how … We know now</a></span>");
       
       st.length = 0;       
       $("#we-did-year").html("("+weDidYear[weDidPos]+") ");                   
       var v = setTimeout("fadeInYear(); ", 1000);
       var z = setTimeout("fadeOut(); ", 5500);
       var u = setTimeout("doWeDid(); ", 7000);
    }    
}


function getWeDidPos()
{
    if(weDidPos == screen.length)
    {
        weDidPos = 0;
		
    }
 //   else
   // {
     //   weDidPos++;
    //}
}


function fadeInYear()
{
    $("#we-did-year").animate({opacity:1},1000);
}


function fadeOut()
{
    $("#we-did-year").animate({opacity:0},1000);
    $("#we-did").animate({opacity:0},1000);
    
}

function fadeOutYear()
{
    $("#we-did-year").css("opacity","0");
}


/*DROP LINK FUNCTIONALITY*/

function hideShow(idName, whichPage)
{
    idCode = "#"+idName;
    
    if(!whichPage)
    {
        whichPage = "";
    }

    if ($(idCode).is(":hidden")) {    
    $(idCode).slideDown(1000);
       $(idCode+" p").animate({opacity:1},1000);
       $(idCode+"-read").animate({opacity:0},1000);
        $(idCode+"-h2").attr("class", whichPage + "drop-link-down");      
    }
    else
    {    
    
        $(idCode).slideUp(1000);
        $(idCode+" p").animate({opacity:0},1000);
        $(idCode+"-read").animate({opacity:1},1000);
        $(idCode+"-h2").attr("class", whichPage + "drop-link");
        
    }

}


/*DROP LINK FUNCTIONALITY*/


var newwindow;
function popUp(url)
{
	newwindow=window.open(url,'name','height=500,width=600, scrollbars=yes');
	if (window.focus) {newwindow.focus()}
	return false;
}




$(document).ready(function(){
doWeDid();
});
