// JavaScript Document

$(document).ready(function(){
	var counter = 0;
	var facts=new Array();
	facts[0]="Less than 1 in 4 people think services should be cut to pay off national debt";
	facts[1]="Over a million older people currently depend on publicly-funded social care";
	facts[2]="73% of people are opposed to public services being run by private companies";
	facts[3]="Over a million people are treated by the NHS every 36 hours";
	facts[4]="More people would support tax increases than cuts to key services";
	facts[5]="The average household relies on benefits and services worth more than &pound;10,000 every year";
	facts[6]="79% of people think public servants' pay should keep up with the cost of living ";
	facts[7]="More people use public libraries than go to football matches or the cinema";
	
	var sources=new Array();
	sources[0]="(Ipsos MORI, Sep 2009)";
	sources[1]="(Department of Health, 2009)";
	sources[2]="(Ipsos MORI, June 2009)";
	sources[3]="(Department of Health, 2009)";
	sources[4]="(Ipsos MORI, September 2009)";
	sources[5]="(Office for National Statistics, 2009)";
	sources[6]="(YouGov, June 2008)";
	sources[7]="(DCMS, 2009)";
	

	window.setInterval(function(){
								if (counter<facts.length-1){
									counter++;
								} else{
									counter = 0;
								}
								$("#fact").fadeOut('fast', function(){
																						$(this).html(facts[counter]);
																						$(this).fadeIn('fast');
																										 });
								//$(".tga_speakup_purple_text").html(facts[counter]);
								$("#source").fadeOut('fast', function(){
																						$(this).html(sources[counter]);
																						$(this).fadeIn('fast');
																										 });
									
						},6000);
});
