function setDisplayPage(i, va) {
    strHref = window.self.location.href;
    strAnchor = "";
    intAnchor = strHref.indexOf("#");
    if (intAnchor > 0) {
        strAnchor = strHref.substring(intAnchor);
        strHref = strHref.substring(0, intAnchor);
    }
    if(strHref.indexOf("adisplay")>0) {
        strPattern="adisplay=[";
        strPattern+="0-9]+";
        pattern = new RegExp(strPattern);
        strHref=strHref.replace(pattern,"adisplay="+i);
    } else {
        if (strHref.indexOf("?") == -1) { strHref=strHref+"?"; } 
        if(strHref.lastIndexOf("&")==strHref.length-1) {
            strHref+="adisplay="+i;
        } else {
            intIdx = strHref.lastIndexOf("?");
            if (intIdx < 0 || intIdx == strHref.length-1) {
                strHref+="adisplay="+i; 
            } else { 
                strHref+="&adisplay="+i; 
            }
        } 
    }
    // Add view all parameter?
    if (va){
        strHref+="&va=1";
    }
    if (strAnchor) {
        strHref = strHref + "#" + strAnchor;
    }
    window.self.location.href=strHref;
}

