function LastReviews()
{this.scrollInner=null;this.pixelsPerSecond=1500;this.destX=0;this.lastUpdate;this.idOffset=0;this.divWidth=150;}
LastReviews.prototype.getLeft=function()
{var v=parseInt(this.scrollInner.style.left);if(isNaN(v))
v=0;return v;}
LastReviews.prototype.setLeft=function(xOff)
{this.scrollInner.style.left=xOff+"px";}
LastReviews.prototype.moveBy=function(xOff)
{this.setLeft(this.getLeft()+xOff);}
LastReviews.prototype.DoScroll=function()
{var d=new Date();var ms=(d.getTime()-this.lastUpdate);var dx=this.pixelsPerSecond/1000*ms;if(isNaN(dx))
dx=0;if(this.getLeft()<this.destX)
{this.moveBy(+dx);if(this.getLeft()>this.destX)
this.setLeft(this.destX);}
if(this.getLeft()>this.destX)
{this.moveBy(-dx);if(this.getLeft()<this.destX)
this.setLeft(this.destX);}
if(this.getLeft()!=this.destX)
setTimeout("g_lastReviews.DoScroll()",5);this.lastUpdate=d.getTime();}
LastReviews.prototype.setOuterHTML=function setOuterHTML(element,value)
{if(typeof(element.outerHTML)!='undefined')
element.outerHTML=value;else
{var range=document.createRange();range.setStartBefore(element);element.parentNode.replaceChild(range.createContextualFragment(value),element);}}
LastReviews.prototype.AjaxCB=function(in_responseText,in_param,in_param2)
{g_lastReviews.scrollInner.style.width=(g_lastReviews.scrollInner.offsetWidth+g_lastReviews.divWidth)+"px";timeout=0;while(g_lastReviews.busy==true)
{timeout++;}
for(var i=0;i<g_lastReviews.scrollInner.childNodes.length;i++)
{var id=g_lastReviews.scrollInner.childNodes[i].id;if(id)
{if(id.substring(0,4)=="ajax")
{g_lastReviews.setOuterHTML(g_lastReviews.scrollInner.childNodes[i],in_responseText);break;}}}
g_lastReviews.idOffset--;if(g_lastReviews.idOffset==0)
document.getElementById("LR_ajax").style.visibility="hidden";}
LastReviews.prototype.StartScroll=function(xOff)
{if(this.scrollInner==null)
{this.scrollInner=document.getElementById("LR_scrollinner");}
this.lastUpdate=NaN;this.destX+=xOff;if(this.destX>0)
this.destX=0;if(this.destX>this.scrollInner.offsetWidth)
this.destX=this.scrollInner.offsetWidth;if(this.destX<-(this.scrollInner.offsetWidth-10*this.divWidth))
{var lastID;for(var i=0;i<this.scrollInner.childNodes.length;i++)
{var id=this.scrollInner.childNodes[i].id;if(id)
{if(id.substring(0,4)!="ajax")
lastID=id;}}
this.idOffset++;g_lastReviews.scrollInner.innerHTML+='<div class="LR_box" id="ajax'+lastID+'"><a><img width="32" height="32" border="0" src="/images/ajax-loader.gif" alt=""/><br/>Loading...</a></div>';g_ajax_obj.CallXMLHTTPObjectGETParam('http://www.techpowerup.com/index.php?lastr='+lastID.substr(1)+"&q="+(this.idOffset-1),g_lastReviews.AjaxCB,lastID.substr(1));document.getElementById("LR_ajax").style.visibility="visible";}
this.DoScroll();}
g_lastReviews=new LastReviews();
