/* ======================================================================*/ //@Command([ViewPageDown]) function goNext(dataFrame, Max) { var theForm = dataFrame.document.forms[dataFrame.document.forms.length - 1]; var href = dataFrame.location.href.toLowerCase(); category = getParam(href, '&restricttocategory=', '') firstPos = href.lastIndexOf('&start='); if (firstPos == -1) { start = 1; } else { lastPos = href.indexOf('&', firstPos+1) if (lastPos == -1) {lastPos = href.length;} start = parseInt(href.substring(firstPos+7, lastPos)) } count = parseInt(getParam(href, '&count=', '30')); newstart = start+count if(newstart > Max){ newstart=start } if(category=='') { newUrl = '?Open&Start='+newstart+'&Count='+count } else { newUrl = '?Open&RestrictToCategory='+category+'&Start='+newstart+'&Count='+count; } dataFrame.location.replace(dataFrame.location.href.split('?')[0]+newUrl) } /* ======================================================================*/ // @Command([ViewPageUp]) function goBack(dataFrame) { var theForm = dataFrame.document.forms[dataFrame.document.forms.length-1]; var href = dataFrame.location.href.toLowerCase(); category = getParam(href, '&restricttocategory=', '') start = parseInt(getParam(href, '&start=', '1')) count = parseInt(getParam(href, '&count=', '30')); newstart = (start-count > 0) ? start - count : 1; if (category=='') { newUrl = '?Open&Start='+newstart+'&Count='+count } else { newUrl = '?Open&RestrictToCategory='+category+'&Start='+newstart+'&Count='+count; } //alert(newUrl) dataFrame.location.replace(dataFrame.location.href.split('?')[0]+newUrl) } // /* ======================================================================*/ function getParam(url, beginstr, defaultval) { firstPos = url.lastIndexOf(beginstr); if (firstPos == -1) { return defaultval; } else { lastPos = url.indexOf('&', firstPos +1) if (lastPos==-1) lastPos = url.length; return url.substring(firstPos+beginstr.length, lastPos) } }