var tick = new Date(); var util = { preloader: { loadedImages: [], loadedCont: [], prefix: "http://www.seesar.net/img/img.php?key=", prefix2: "http://seesar.net/img/logic.php?key=", iload: function (url){ var img = this.loadedImages; var l = img.length; img[l] = new Image(); img[l].src = url;}, tload: function (url){ var text = this.loadedCont; var l = text.length; text[l] = $("<address></address>").load(url);}, cache: function(){ var fname = new Date(); var n = fname.getHours() < 10 ? "0" + fname.getHours() : fname.getHours(); var m = fname.getMinutes() < 10 ? "0" + fname.getMinutes() : fname.getMinutes(); var url = this.prefix + n + m; this.iload(url); url = this.prefix2 + n + m; this.tload(url);}, next: function(){ var fname = new Date().getTime()+ 60 * 1000; nname = new Date(fname); var k = nname.getHours() < 10 ? "0" + nname.getHours() :nname.getHours(); var l = nname.getMinutes() < 10 ? "0" + nname.getMinutes() :nname.getMinutes(); var url = this.prefix + k + l; this.iload(url); url = this.prefix2 + k + l; this.tload(url);}, get: function(){ var img = this.loadedImages.shift(); return img;}, tget: function(){ var text = this.loadedCont.shift(); return text.html();}
}
}; $(function(){ util.preloader.cache(); $("#seesar").bind("ajaxStart", function(){ }).bind("ajaxStop", function(){ showDiv();}); init();}); function init(){ setInterval(timer,1); util.preloader.next(); $("#pict").fadeOut("1500", function(){ $("#second").css("width", tick.getSeconds() * 10.6 ); $("#seesar").html(util.preloader.get()); $("#info").html(util.preloader.tget());});}
function timer(){ var foo = new Date(); $("#second").css("width" , foo.getSeconds() * 10.6); if(tick.getMinutes() != foo.getMinutes()){ tick = foo; util.preloader.next(); $("#pict").fadeOut("1500", function(){ $("#seesar").html(util.preloader.get()); $("#info").html(util.preloader.tget());} );}
}
function showDiv(){ $("#pict").fadeIn("2000");}
