$(document).ready(function(){var last_added;$.postJSON("/slideshow/index/",{id:"stats",f_name:"clast_added"},function(data){last_added=data.layouts});var fetch=function(p){$("select#pages").attr("name","stats");$("#data #layout .top img").attr("src","images/null.gif");$("#data").removeClass().addClass("data");$.postJSON("/slideshow/index/",{id:"stats",f_name:p.attr("id")},function(data){$("#step1 dl .st_content:eq(0) span").html(data.c_name);$("#step1 dl .st_content:eq(1) span").html(data.c_lnum);$("#step1 dl .st_content:eq(2) span").html(data.c_pnum);$("#step1 dl .st_bottom span:eq(1)").html(data.c_pnum);var pages="";for(i=1;i<=data.c_pnum;i++){pages+='<option id="'+p.attr("id")+'">'+i+"</option>"}$("#step1 dl .st_bottom select").html(pages);$.each(data.layouts,function(entryIndex,entry){var msg=(jQuery.inArray(entry.c,last_added)<0)?"":"new!";$("#data .square:eq("+entryIndex+")").removeClass("hide");$("#data .square:eq("+entryIndex+") .bottom .bl").html(msg);$("#data .square:eq("+entryIndex+") .code").html(entry.c);$("#data .square:eq("+entryIndex+") .top a").attr("rel","/popup/index/?ext="+entry.t+"&num="+entry.c);$("#data .square:eq("+entryIndex+") .top a").attr("name",entry.c);$("#data .square:eq("+entryIndex+") .top a img").attr("src","images/thumbs/"+entry.c.toString().slice(0,-2)+"00/"+entry.c+"-m.jpg");if((entryIndex+1)==data.layouts.length){setTimeout(function(){$("#loader").hide()},2000);$("#data .square:gt("+entryIndex+")").addClass("hide")}})});$this.siblings(".selected").removeClass("selected").addClass("visited");$this.removeClass("visited").addClass("selected")};$("#col3 .cl3_center li").click(function(){$this=$(this);$("#loader").show(10,setTimeout(function(){fetch($this)},3000))})});