(function() { var Ad = function(iId,sHtml,fCode,dStart,dEnd,iWeight) { this.iId = iId; this.sHtml = sHtml; this.fCode = fCode; this.dStart = dStart; this.dEnd = dEnd; this.iWeight = iWeight; } var ads = new Array(1); var adsLen = 0; ads[adsLen++] = new Ad(181,"\r\n\r\n\r\n",null, null, null, 1); var indexArr = new Array(); var now = new Date(); for(var i=0,j=0,len=ads.length;iads[i].dStart) && (!ads[i].dEnd || now 0){ var rand = parseInt(Math.random() * indexArr.length); var show = ads[indexArr[rand]]; if(show.sHtml) { document.write(show.sHtml); } else { show.fCode(); } $.get("/ad_display.jspx?id="+show.iId); } })();