var lastSelected=''; var buttonMainCount; var buttonSubCount; var buttonName = new Array(); var currDBObject = getCurrentDBObject(); setupload(); // See subJSButtonsXXX subforms for the code which loads all the roll-over buttons. //functions function setupload() { if ( args.link) { lastSelected=args.link } else { lastSelected='' } } function picswitch(pictnum,number) { if(document.images && pictnum != 0) { pictname=buttonName[pictnum]; document.images[pictname].src = pics[number].src; } } function getNormalPicNum(ButtonNum) { return (ButtonNum * 3)-3 ; } function getHoverPicNum(ButtonNum) { return (ButtonNum * 3)-2; } /** * The purpose of this function is similar to getNormalPicNum() and getHoverPicNum(), except that it returns the number * of the desired graphic when the mouse is clicked. * * @return Number index */ function getClickPicNum(ButtonNum) { return (ButtonNum * 3)-1; } function getCurrentDBObject() { currenturl=window.location.href; begin=currenturl.indexOf('.nsf/')+5; currenturl=currenturl.substring(begin); end=currenturl.indexOf('?'); return currenturl.substring(0,end); } function doMouseOut(CurrentButton) { ButtonNum=0 // if( !(lastSelected == CurrentButton ) ) // { ButtonNum=CurrentButton // } if(ButtonNum>0) { picswitch(ButtonNum, getNormalPicNum(ButtonNum)); } } function doMouseOver(CurrentButton) { ButtonNum=0 // if( !(lastSelected == CurrentButton ) ) // { ButtonNum=CurrentButton // } if(ButtonNum>0) { picswitch(ButtonNum, getHoverPicNum(ButtonNum)); } } /** * Switch graphics when the mouse is clicked on a region (graphic link) */ function doMouseClick(CurrentButton) { ButtonNum=CurrentButton; if(ButtonNum>0) { picswitch(ButtonNum, getClickPicNum(ButtonNum)); } // sleep for a few milliseconds } function doSearch() { var searchtext = document.forms[0].SText.value; if( searchtext != "" && searchtext !="<< Search >>") { var querystring = escape("([Subject] CONTAINS " + searchtext + " OR [$File] CONTAINS " + searchtext + " OR [Body] CONTAINS " + searchtext + ")") ; var url = pathNdb + "/SearchView?SearchView&SearchWV=True&SearchFuzzy=False&SearchOrder=4&Start=1&Count=100&Query=" + querystring; window.location=url } } /** * @param index The image index (not the array index) * @param base The image base for the array. If there are two images for every 'button', then base=2 * @return The array index for the normal state image */ function getNormalPicNum2(index, base) { return (index * base)-base ; } /** * @param index The image index (not the array index) * @param base The image base for the array. If there are two images for every 'button', then base=2 * @return The array index for the highlight state image */ function getHoverPicNum2(index, base) { return (index * base)-(base-1); } /** * @param imageName The js label of the image to change. * @param imageArrayName The name of the array that contains all the images. * @param imageIndex The index to the imageArrayName array. */ function picswitch2(imageName, imageArrayName, imageIndex) { if(document.images) { var arrayStr = imageArrayName + "[" + imageIndex + "].src"; document.images[imageName].src = eval(arrayStr); } } /** * @param imageName The js label of the image. * @param imageArrayName The name of the image array. * @param switchIndex The high-level index of the images to switch to (not the actual array index of the imageArray since * there may be several entries in the array for one image, ie, normal, highlight and click). */ function doMouseOver2(imageName, imageArrayName, switchIndex, switchBase) { if(imageName != null && switchIndex>0) { var hoverIndex = getHoverPicNum2(switchIndex, switchBase); picswitch2(imageName, imageArrayName, hoverIndex); } } /** * @param imageName The js label of the image. * @param imageArrayName The name of the image array. * @param switchIndex The high-level index of the images to switch to (not the actual array index of the imageArray since * there may be several entries in the array for one image, ie, normal, highlight and click). */ function doMouseOut2(imageName, imageArrayName, switchIndex, switchBase) { if(imageName!= null && switchIndex>0) { var normalIndex = getNormalPicNum2(switchIndex, switchBase); picswitch2(imageName, imageArrayName, normalIndex); } } /** * Similar to getDoc(), however, this method takes in a query as an argument, and returns the URL instead of loading it. * * @param docview The view where the document is indexed. * @param dockey The unique identifier of the document to display. * @param query The query to append to the URL. * @return The new URL. */ function getDocURL(docview, dockey, query) { if (query == false || query==""){ var url = pathNdb + '/' + docview + '/' + escape(dockey) + '?OpenDocument'; } else{ if (query.indexOf('&')==-1) {querys = '&' + query} else {query = query.substring(query.indexOf('&'))} var url = pathNdb + '/' + docview + '/' + escape(dockey) + '?OpenDocument' + query ; } return url; }