function jsonit(myurl,xstartoffset,direction) { myurl = myurl + "&startoffset=" + xstartoffset + "&direction=" + direction; if (direction == 'forward') { startoffset = xstartoffset + 6; } else { if (startoffset <=0) { startoffset = 0; } else { startoffset = xstartoffset - 6; } } var req = null; if (document.getElementById) { } else { return false; } if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } req.onreadystatechange = function() { if(req.readyState == 4) { if(req.status == 200) { eval("var response = ("+req.responseText+")"); if (response.status != 'eof') { theitems(response.items); var tb_pathToImage = "images/loadingAnimation.gif"; tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; } else { jsonit(myurl,0,'forward'); } } else { alert(+ req.status + " " + req.statusText); } } } req.open("GET", myurl, true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(null); tb_init('a.thickbox, area.thickbox, input.thickbox'); } function theitems(items) { var masterdiv = document.getElementById('master'); if ( masterdiv.hasChildNodes() ) { while ( masterdiv.childNodes.length >= 1 ) { masterdiv.removeChild( masterdiv.firstChild ); } } if (items.description.length>0) { for(j=0;j