var eSD=1;var eCyc=1;var eMw=1;var cyclerArray=[0];var tID;var dur=680;var cSz;var curCyc=0;var cImgW=960;var nCyc=0;var slowCyclerAt=2;var cLongS=2;var longcS=30;var cS=6;var cTTs=6;var MeltwaterNewsURL="/applicationsupport/2010design/homepages/prospective/meltwater_request.asp";var maxtoShow=3;var allStories;var curPo=0;var NumStories;var mSD=3000;var evC;$(document).ready(function(){evC=$('#area4 table.eventlist tr').length;if(evC<1){$('#area4 table.eventlist').append("<tr><td colspan=\"3\">There are no upcoming events.<br /><br /></td></tr>")}cSz=$('#cycler a').size();if(cSz>1){$('#area3').append('<div id="cyclertools"><div id="cyclertoolsRwd"><span>back</span></div><div id="cyclertoolsFwd"><span>forward</span></div></div>');$('#area3').append('<div id="ctPP"><div id="cyclertoolsPause" class="cyclerToolsPlayPause"><span>pause</span></div><div id="cyclertoolsPlay" class="cyclerToolsPlayPause"><span>play</span></div></div>');$('#cycler a').each(function(a){cyclerArray[a]=$(this).detach()});$('#cycler').append(cyclerArray[0]);var d=0;setupinteractions()}var e="search the website";$('#qt').val(e);if($('#qt').val()==e){$('#qt').css("color","#c0c0c0")};$('#qt').focus(function(){if(eSD==1){$('#resultslistitems:visible').fadeOut()}if($(this).val()==e){$(this).val("");$(this).css("color","#000")}});$('#searchform').submit(function(a){if($('#qt').val()==e){$('#qt').val("")}if(eSD==1){a.preventDefault();loadSearchResults()}});if(eMw==1){$.ajax({url:MeltwaterNewsURL,success:function(a){MeltwaterNewsStoriesJSON=eval("("+a+")");allStories=MeltwaterNewsStoriesJSON.stories;NumStories=allStories.length;var b=0;if(NumStories>0){$('#meltwater_title').show();$('#meltwater_news').show();$('#meltwater_title').html("LJMU in the news");numToShow=(MeltwaterNewsStoriesJSON.stories.length>=maxtoShow)?maxtoShow:NumStories;for(i=0;i<numToShow;i++){var c="<li style=\"margin-bottom:0.5em;list-style-type:none;\">"+(i+1);c+=" <a target=\"ljmuinthenews\" class='dfl' href='"+allStories[i].link+"'>"+allStories[i].title+"<\/a>";c+="<br /><span style=\"font-style:italic;font-size:12px;color:#a0a0a0\">"+allStories[i].source+"<\/span><\/li>";$('#meltwater_news').append(c);curPo=i+1}if(NumStories>maxtoShow){setInterval(cycleMltwtrNews,mSD)}}}})}else{$('#meltwater_news').hide()}function setupinteractions(){$('#cyclertools').addClass('cyclertoolsOff');$('.cyclerClick').mouseleave(function(){$(this).removeClass('cyclerClickOver')});$('.cyclerClick').mouseenter(function(){$(this).addClass('cyclerClickOver')});$('#cyclertoolsRwd').mouseenter(function(){$(this).addClass('over')});$('#cyclertoolsRwd').mouseleave(function(){$(this).removeClass('over')});$('#cyclertoolsFwd').mouseenter(function(){$(this).addClass('over')});$('#cyclertoolsFwd').mouseleave(function(){$(this).removeClass('over')});$('#cyclertoolsPlay').hide();$('#cyclertoolsPause').mouseenter(function(){$(this).addClass('cyclertoolsPauseOver')});$('#cyclertoolsPause').mouseleave(function(){$(this).removeClass('cyclertoolsPauseOver')});$('#cyclertoolsPlay').mouseenter(function(){$(this).addClass('cyclertoolsPlayOver')});$('#cyclertoolsPlay').mouseleave(function(){$(this).removeClass('cyclertoolsPlayOver')});cyclerbind();waitThenTabFwd()}});function waitThenTabFwd(){if(eCyc==1){tID=setTimeout("cyclerForwardwind()",cTTs*1000);if(nCyc>=slowCyclerAt){if(cTTs<longcS){cTTs=(cTTs+cLongS)}else{cTTs=longcS}}else{cTTs=cS}}}function cyclerForwardwind(){clearTimeout(tID);cyclerunbind();if(cyclerArray.length-1>curCyc){$('#cycler').append(cyclerArray[curCyc+1]);curCyc++}else{nCyc++;$('#cycler').append(cyclerArray[0]);curCyc=0}$('#cycler').css("width","2940px");$('#cycler').animate({left:-960},dur,'swing',function(){$('#cycler a').first().remove();$('#cycler').css("left","0px");cyclerbind()});waitThenTabFwd()}function clickRWD(){nCyc=0;cTTs=cS;hidePlayShowPause();cyclerRewind()}function clickFWD(){nCyc=0;cTTs=cS;hidePlayShowPause();cyclerForwardwind()}function clickPauseCycler(){nCyc=0;cTTs=cS;$('#cyclertoolsPlay').show();$('#cyclertoolsPause').hide();clearTimeout(tID)}function hidePlayShowPause(){$('#cyclertoolsPause').show();$('#cyclertoolsPlay').hide()}function clickPlayCycler(){nCyc=0;cTTs=cS;hidePlayShowPause();cyclerForwardwind()}function cyclerRewind(){clearTimeout(tID);cyclerunbind();if(curCyc==0){$('#cycler').prepend(cyclerArray[cyclerArray.length-1]);curCyc=cyclerArray.length-1}else{$('#cycler').prepend(cyclerArray[curCyc-1]);curCyc--}$('#cycler').css("width","2940px");$('#cycler').css("left","-960px");$('#cycler').animate({left:0},dur,'swing',function(){$('#cycler a').eq(1).remove();$('#cycler').css("left","0px");cyclerbind()});waitThenTabFwd()}function cyclerunbind(){$('#cyclertoolsFwd').unbind("click",clickFWD);$('#cyclertoolsRwd').unbind("click",clickRWD);$('#cyclertoolsPause').unbind("click",clickPauseCycler);$('#cyclertoolsPlay').unbind("click",clickPlayCycler)}function cyclerbind(){$('#cyclertoolsFwd').bind("click",clickFWD);$('#cyclertoolsRwd').bind("click",clickRWD);$('#cyclertoolsPause').bind("click",clickPauseCycler);$('#cyclertoolsPlay').bind("click",clickPlayCycler)}function cycleMltwtrNews(){$('#meltwater_news li:first').slideUp('slow',function(){$('#meltwater_news li:first').remove()});var a="<li style=\"margin-bottom:0.5em;list-style-type:none;\"><\/li>";$('#meltwater_news').append(a);var b=(curPo+1)+" <a target=\"ljmuinthenews\" class='dfl' href='"+allStories[curPo].link+"'>"+allStories[curPo].title+"<\/a>";b+="<br /><span style=\"font-style:italic;font-size:12px;color:#a0a0a0\">"+allStories[curPo].source+"<\/span>";$('#meltwater_news li:last').append(b);curPo++;if(curPo==NumStories){curPo=0}}
