var tcT;var tcS=0;var tcL=0;var tcN=0;var tcR=0;var tcI;var tcF;$(window).bind('load',function(){$('#tc-wrapper').append('<ul id="tc-list"></ul>');tcN=tcArr.length;tcL=Math.floor(Math.random()*tcN);loadImages()});function loadImages(){$('ul#tc-list').append('<li class="hidden"><a class="tc-more-'+tcArr[tcL][1]+'" style="top:'+tcArr[tcL][3]+'px;" href="'+tcMorePath+tcArr[tcL][2]+'">Läs hela intervjun »</a><a href="#" class="tc-next" onclick="switchClient();return false;">Nästa »</a></li>');if(tcR==0){$('ul#tc-list > li:first').addClass('active')}var current=$('ul#tc-list > li:last');current.image(tcImgPath+tcArr[tcL][0],function(){current.removeClass('hidden');current.fadeIn('slow');$('#tc-wrapper img.spinner').fadeOut('fast');tcL++;if(tcL==tcN){tcL=0}tcR++;if(tcR<tcN){loadImages()}else{tcT=setTimeout("switchClient()",tcInterval)}})}function switchClient(){if(tcS==0){tcS=1;clearTimeout(tcT);var active=$('ul#tc-list > li.active');if(active.next().is('.hidden')){$('#tc-wrapper img.spinner').fadeIn('slow');tcS=0;tcT=setTimeout('switchClient()',500)}else{if(active.length==0){active=$('ul#tc-list > li:last')}var next=active.next().length?active.next():$('ul#tc-list > li:first');active.addClass('last-active');next.hide().addClass('active').fadeIn('slow',function(){active.removeClass('active last-active');active.hide();tcS=0});tcT=setTimeout('switchClient()',tcInterval)}}}$.fn.image=function(tcI,tcF){return this.each(function(){var tcO=new Image();tcO.onload=tcF;tcO.src=tcI;this.appendChild(tcO)})}
