function Scroll() { var buf=null; var bufqty=null; }; Scroll.prototype={ init:function(){ alert('init'); }, insert:function(t,ob) { var _t = this; if(_t.bufqty == 0 || _t.bufqty == null) { _t.load(); return false; } else { var c = this.cEl("DIV"); c.innerHTML = _t.buf[0][(_t.bufqty--)-1]; c.className = 't'; ob.appendChild(c); ob.insertBefore(c,ob.firstChild); return true; } }, scroll:function(t,ob) { switch(t) { case 'D': { fc = ob.firstChild; //fc = ob.lastChild; if(fc.tagName != 'DIV') fc = fc.nextSibling; m=-120; c = function() { fc.style.marginTop = m+"px"; if(m++ < 0) { setTimeout(c,20); } else { fc.className = "te"; fc.style.marginTop = null; ob.removeChild(ob.lastChild); } } c(); } break; } }, gEl:function(n) { return document.getElementById(n); }, cEl:function(n) { return document.createElement(n); }, load:function() { var _t = this; post = ""; file = "sls.php"; if(facebook_slajd_target) file = "slsfb.php" //post = "target=_blank"; system_i.push_last(new Array(path+file,post, function(v){ var o = eval(v); o = o[0]; _t.bufqty = o.qty; _t.buf = o.d; })); } }; var iScroll = new Scroll(); function Scroll_m2() { this.sleepscroll; this.scrollobj; }; // Scroll_m2.prototype = { setTarget:function(obj) { this.scrollobj = obj; }, getTarget:function(obj) { return this.scrollobj; }, scroll:function(t) { switch(t) { case 'L': { var t = this, pause=0, div=312; var psx=0.0; var rr = parseFloat(div/20); var l = 1, ml = 5; var mov_child=0; var c = function() { pause = 0; var o = t.getTarget(); var ps = parseFloat(o.style.marginLeft.replace("px","")); var ml = (ps-rr); if(ml < -(l)*div) { pause = 1; ml = -(l)*div; } o.style.marginLeft = ml+"px"; if(mov_child == 1) { var fc = o.firstChild; while(true) { if(fc.tagName == "DIV") break; else fc = fc.nextSibling; } o.appendChild(fc); mov_child = 0; } if((ml-div) <= (parseInt(o.style.width.replace("px",""))*-1) ) { l-- mov_child = 1; setTimeout(c,40); //return true; } else if(pause == 0) setTimeout(c,40); else { l++; setTimeout(c,t.sleepscroll); } } c(); } break; } }, gEl:function(n) { return document.getElementById(n); } }; var iScroll_m2 = new Scroll_m2(); function start_scroll(iScroll) { (function ($){ var s=$.gEl("scroll"); if(s != null){ var i = function() { if($.insert("D",s)) { $.scroll("D",s); } setTimeout(i,9000); }; i(); } })(iScroll); } start_scroll(iScroll); function start_scroll2(iScroll_m2) { (function ($){ $.setTarget($.gEl("partnerslide")); $.sleepscroll = 10000; var s=function(){ $.scroll("L"); } setTimeout(s,$.sleepscroll); })(iScroll_m2); } //start_scroll2(iScroll_m2);