/* Returns the URL path ending with the database name, i.e. removes all view, form etc. references. */ function getWebPath() { //get the URL without any parameters... originalWebPath = window.location.pathname; //if the original path refers to the pages or previewpages view, remove the view reference //and anything after it. If it doesn't (i.e. the current URL refers to a form or a view, not a page), //just remove the last entry in the path... if ( originalWebPath.indexOf( "/previewPages" ) != -1 ) { webPath = originalWebPath.substr( 0, originalWebPath.indexOf( "/previewPages" ) ); } else if ( originalWebPath.indexOf( "/pages" ) != -1 ) { webPath = originalWebPath.substr( 0, originalWebPath.indexOf( "/pages" ) ); } else if ( originalWebPath.indexOf( "/Pages" ) != -1 ) { webPath = originalWebPath.substr( 0, originalWebPath.indexOf( "/Pages" ) ); } else if ( originalWebPath.indexOf( "/PAGES" ) != -1 ) { webPath = originalWebPath.substr( 0, originalWebPath.indexOf( "/PAGES" ) ); } else { webPath = originalWebPath.substr( 0, originalWebPath.lastIndexOf( "/" ) ); } //alert( "DEBUG: " + webPath ); return webPath; } /* When the user clicks enter in the quick search field, submits the search */ function searchOnEnter(e) { //alert (e.target); if (e.target == document.forms[0].search) { //var keyChar = String.fromCharCode( e.which ); //alert(keyChar); //alert(e.which); if ( e.which == 13) { commonSearch(); return false; } } else if (e.target == document.forms[1].search2) { //var keyChar = String.fromCharCode( e.which ); //alert(keyChar); //alert(e.which); if ( e.which == 13) { extendedSearch(); return false; } } } function searchOnEnterIE() { //alert( 'Search on enter IE hakkas pihta..' ); //alert( new String( window.event.keyCode ) ); var ev = window.event; if ( ev.keyCode == 13 ) { //alert( "Enter oli..." ); commonSearch(); return false; } return true; } /* Returns the style of the current area to highlight it */ function highlightCurrentArea( areaName ) { //alert( "Valdkonna highlightimine algas..." ); //alert( "Etteantud valdkond on " + areaName ); //if the current area name is similar to the given //area name, return the highlighting style name. //Otherwize return the non-highlighting style name.. if ( document.forms[0].CurrentAreaName ) { if ( document.forms[0].CurrentAreaName.value == areaName ) { return "whitemenu"; } else { return "menu"; } } else { return "menu"; } } function MM_openBrWindow(theURL,winName,features) { //v2.0 window.open(theURL,winName,features); } /* Opens a page specified in the given dropdown's selected option. */ function go(there) { if (there.selectedIndex >= 0) { newUrl = there.options[there.selectedIndex].value; if (newUrl.length>0) { window.location.href = newUrl; } } } //Performs the extended search... function extendedSearch() { //alert( 'Extended search läks...' ); //get the extended search form and all the parameters that are specified in that form... var frm = document.forms[1]; queryWords = frm.search2.value; //if the query is empty, no point to continue. Give a laguage-specific //error message... if (queryWords == "") { alert( document.forms[0].term1.value ); return; } //get the search page code... searchPage = document.forms[0].SearchResultsPage.value; searchQuery = queryWords.replace( / /g, " AND " ); //compose the search URL... searchURL = searchPage + "?OpenDocument&Query=" + escape(searchQuery) + "&Start=1&Count=10&SearchMax=1000&Format=long"; //alert( "Search URL = " + searchURL ); //and open the search URL... window.location.href = searchURL; //return false; } /* Get the number of selected radiobutton in poll. */ function getSelectedOption() { //get the radiobuttons objects... var gallupOptions = document.forms[1].poll; //check if at least one is checked... for ( var i = 0; i < gallupOptions.length; i++ ) { if ( gallupOptions[i].checked ) { return i + 1; } } return null; } // ------------------------------------------------------------ DWMX Swap Image onMouseOver function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i