<script> <br>function ChangeParam(name, value) { <br>var url = window.location.href; <br>var newUrl = ""; <br>var reg = new RegExp("(^|)" name "=([^&]*)(|$) "); <br>var tmp = name "=" value; <br>if (url.match(reg) != null) { <br>newUrl = url.replace(eval(reg), tmp); <br>} <br>else { <br>if (url.match("[?]")) { <br>newUrl = url "&" tmp; <br>} <br>else { <br>newUrl = url "?" tmp; <br>} <br>} <br>//If the category is changed, start from page 1<br>if (name != "PageIndex") { <br>reg = new RegExp( "(^|)PageIndex=([^&]*)(|$)"); <br>tmp = "PageIndex=1"; <br>if (newUrl.match(reg) != null) { <br>newUrl = newUrl.replace(eval(reg), tmp); <br>} <br>} <br>location.href = newUrl; <br>} <br>function QueryMonthTicket() <br>{ <br> if($("selectM")!=null && $("selectY")!=null) <br>{ <br>var month=$("selectY").value $("selectM").value; <br>ChangeParam("Month",month); <br>} <br>} <br><br>function GoPage() <br>{ <br>var page=$("txtPage").value.trim( ); <br>if(page.length===0){ <br>alert("Please enter the page number"); <br>return false; <br>}; <br>var strNum = '1234567890'; <br>var isNum = true; <br>for(var i=0;i<page.length;i =1){ <BR>var c = page.charAt(i); <BR>if(strNum.indexOf (c) < 0){ <BR>isNum = false; <BR>break; <BR>}; <BR>}; <BR>if(isNum){ <BR>if(parseInt(page)>parseInt (initTotalPage)){ <br>alert("The number of pages you entered exceeds the total number of pages, please re-enter! "); <br>return false; <br>}; <br>ChangeParam("PageIndex",page); <br>}else alert('The information you entered is wrong, please re-enter!'); <br>} <br><br>function GoEnter(evt){ <br>evt=evt||window.event; <br>if(evt && evt.keyCode == 13) return GoPage(); <br>}; <br></script>