﻿
var weDo = new Array();

weDo[0] = "Do you know how much the FA Premier League rights will be worth in 2015?";

weDo[1] = "Do you know how large the on demand TV market will be in 2012?";

weDo[2] = "Do you know what the most profitable part of the UK commercial radio industry will be in 2012?";

weDo[3] = "Do you know what the next source of growth will be for the independent TV production sector?"; 

weDo[4] = "Do you know what Generation Y will want from its media in 5 years time?";

weDo[5] = "Do you know which media and entertainment sectors are least vulnerable to the downturn?";

weDo[6] = "Do you know what ITV plc is really worth?";

weDo[7] = "Do you know how TV will benefit from the behavioral advertising revolution?";

weDo[8] = "Do you know which media and entertainment sectors are about to follow music and local newspapers into the digital unknown?";

weDo[9] = "Do you know how the UK will get its superfast national broadband network?";



var weDid = new Array();
var weDidYear = new Array();

<!-- -->

weDid[0] = "Did you know Freeview would turn out to be the UK’s most successful digital platform";
weDidYear[0] = 2002;

weDid[1] = "Did you know a second national commercial DAB multiplex could be unnecessary and destabilising to the radio sector";
weDidYear[1] = 2005;

weDid[2] = "Did you think the FA Premier League would be earning over £900m a year in media rights fees by 2008";
weDidYear[2] = 1997;

weDid[3] = "Did you know the launch of digital spin off channels would enable the major UK network groups to stabilise their overall share of viewing by 2007";
weDidYear[3] = 2003;

weDid[4] = "Did you know internet betting exchanges would emerge as a successful challenger to traditional bookmakers";
weDidYear[4] = 1999;

weDid[5] = "Did you know UK commercial TV would introduce a million pound prize quiz show";
weDidYear[5] = 1995;

weDid[6] = "Did you think BSkyB would enter the UK broadband market";
weDidYear[6] = 2001;

weDid[7] = "Did you know search based advertising models would become one of the UK’s largest advertising sectors and so quickly";
weDidYear[7] = 2002;

weDid[8] = "Did you think independent TV production in the UK would be one of the highest growth media sectors of the last 8 years";
weDidYear[8] = 2000; 

weDid[9] = "Did you think TV formats would become one of the most dynamic global media markets";
weDidYear[9] = 2001;

weDid[10] = "Did you think ITV plc’s  choice to accept the regulation of its ad prices (the CRR formula) as a condition of its merger would prove so disastrous for the company";
weDidYear[10] = 2003;

weDid[11] = "Did you think the Kangaroo joint venture between ITV, Channel 4 and BBC Worldwide would be referred to the Competition Commission";
weDidYear[11] = 2008;
 
weDid[12] = "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[12] = 2007;
 
weDid[13] = "Did you know that free to air broadcasters would launch an initiative to get internet delivered on demand content direct to the TV (Project Canvas)";
weDidYear[13] = 2006;
 
weDid[14] = "Did you know that ISPs would want to use tracked internet usage behaviour to take on Google in offering intention based advertising";
weDidYear[14] =  2006;

weDid[15] = "Did you know Personal Video Recorders (PVRs) would prove so popular, so quickly";
weDidYear[15] =  2006;

weDid[16] = "Did you know pay TV operators would prove so resilient to the downturn";
weDidYear[16] =  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() + "<span style='font-family:arial;'>?</span>");
       
       st.length = 0;       
       $("#we-did-year").html("<strong>We did</strong> ("+weDidYear[weDidPos]+") <br/><a href=\"/predictions.php\">See more&gt;&gt;</a>");                   
       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();
});