/* UOS Version: 2.2 - May 4, 2009 */ /***********************************************************************/ /* Popups /***********************************************************************/ function popup(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width='+ w + ', height=' + h + ',left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=yes,resizable=yes,toolbar=no,menubar=no'); if (window.focus) {newwindow.focus()} return false; } function popupHelp(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width=600,height=516,left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=yes,resizable=yes,toolbar=no,menubar=no'); if (window.focus) {newwindow.focus()} return false; } function popupFlash(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width=836,height=516,left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=no,resizable=yes,toolbar=no,menubar=no,statusbar=no,status=no'); if (window.focus) {newwindow.focus()} return false; } function popupPrint(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width=710,height=516,left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=yes,resizable=yes,toolbar=no,menubar=no'); if (window.focus) {newwindow.focus()} return false; } function popupThirdparty(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width=815,height=400,left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes'); if (window.focus) {newwindow.focus()} return false; } function popupNewbrowser(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width=815,height=400,left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes,status=yes'); if (window.focus) {newwindow.focus()} return false; } function popupNonhtml(url) { LeftWindowPosition = ((document.all)?window.screenLeft:window.screenX)+50; TopWindowPosition = ((document.all)?window.screenTop:window.screenY)+5; newwindow=window.open(url,'','width=836,height=516,left=' + LeftWindowPosition + ',top=' + TopWindowPosition + ',scrollbars=no,resizable=yes,toolbar=no,menubar=no,statusbar=no,status=no,status=yes'); if (window.focus) {newwindow.focus()} return false; } /***********************************************************************/ /* Striped Tables /***********************************************************************/ var stripe = function() { var tables = document.getElementsByTagName("table"); for(var x=0;x!=tables.length;x++){ var table = tables[x]; if (! table) { return; } var tbodies = table.getElementsByTagName("tbody"); for (var h = 0; h < tbodies.length; h++) { if (tbodies[h].className == "contentframework-stripedtable"){ var odd = false; var trs = tbodies[h].getElementsByTagName("tr"); for (var i = 0; i < trs.length; i++) { trs[i].onmouseover=function(){ this.className += " contentframework-hoveredrow"; return false } trs[i].onmouseout=function(){ this.className = this.className.replace("contentframework-hoveredrow", ""); return false } if(odd) trs[i].className += " contentframework-altrow"; odd = !odd; } } } } } /***********************************************************************/ /* Get Element by Class /***********************************************************************/ function getElementsByClass(searchClass,node,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } } return classElements; } /***********************************************************************/ /* Expand/Collapse Content (Expands/Collapses a class, i.e. multiple elements) /***********************************************************************/ function toggleIcon(obj, a_id) { var opener = document.getElementById(a_id); var content = getElementsByClass(obj); iconState = opener.firstChild.alt; iconState = iconState.replace("Collapse",""); iconState = iconState.replace("Expand",""); for ( i=0;i"+obj+"##"+a_id) var content = document.getElementById(obj); //var opener = document.getElementById(a_id); //alert("content-->"+content+"##"+opener); //var iconState = opener.lastChild.alt; var iconState ="Expand-Help"; alert("iconState-->"+iconState); iconState = iconState.replace("Collapse",""); iconState = iconState.replace("Expand",""); if (content.style.display != "none" ) { content.style.display = 'none'; opener.lastChild.alt = 'Expand' + iconState; opener.focus(); } else { content.style.display = ''; opener.lastChild.alt = 'Collapse' + iconState; } } /***********************************************************************/ /* Expand/Collapse Inline Help Content - French /***********************************************************************/ function toggleHelpInlineFrench(obj, a_id) { var content = document.getElementById(obj); var opener = document.getElementById(a_id); iconState = opener.lastChild.alt; iconState = iconState.replace("R\u00E9duire",""); iconState = iconState.replace("D\u00E9velopper",""); if (content.style.display != "none" ) { content.style.display = 'none'; opener.lastChild.alt = 'D\u00E9velopper' + iconState; opener.focus(); } else { content.style.display = ''; opener.lastChild.alt = 'R\u00E9duire' + iconState; } } /***********************************************************************/ /* Expand/Collapse Absolute Help Content /***********************************************************************/ function xstooltip_findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function xstooltip_findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } function toggleHelpAbsolute(obj, a_id) { var content = document.getElementById(obj); var opener = document.getElementById(a_id); iconState = opener.lastChild.alt; iconState = iconState.replace("Collapse",""); iconState = iconState.replace("Expand",""); if (content.style.display != "none" ) { content.style.display = 'none'; opener.lastChild.alt = 'Expand' + iconState; opener.focus(); } else { content.style.display = ''; opener.lastChild.alt = 'Collapse' + iconState; } if ((content.style.top == '' || content.style.top == 0) && (content.style.left == '' || content.style.left == 0)) { // need to fixate default size (MSIE problem) content.style.width = content.offsetWidth + 'px'; content.style.height = content.offsetHeight + 'px'; // if tooltip is too wide, shift left to be within parent posX = 0; posY = 17; if (posX + content.offsetWidth > opener.offsetWidth) posX = opener.offsetWidth - content.offsetWidth; if (posX < 0 ) posX = 0; x = xstooltip_findPosX(opener) + posX; y = xstooltip_findPosY(opener) + posY; content.style.top = y + 'px'; content.style.left = x + 'px'; content.style.position = 'absolute'; content.style.zIndex = 2; } } /***********************************************************************/ /* Expand/Collapse Absolute Help Content - French /***********************************************************************/ function toggleHelpAbsoluteFrench(obj, a_id) { var content = document.getElementById(obj); var opener = document.getElementById(a_id); iconState = opener.lastChild.alt; iconState = iconState.replace("R\u00E9duire",""); iconState = iconState.replace("D\u00E9velopper",""); if (content.style.display != "none" ) { content.style.display = 'none'; opener.lastChild.alt = 'D\u00E9velopper' + iconState; opener.focus(); } else { content.style.display = ''; opener.lastChild.alt = 'R\u00E9duire' + iconState; } if ((content.style.top == '' || content.style.top == 0) && (content.style.left == '' || content.style.left == 0)) { // need to fixate default size (MSIE problem) content.style.width = content.offsetWidth + 'px'; content.style.height = content.offsetHeight + 'px'; // if tooltip is too wide, shift left to be within parent posX = 0; posY = 17; if (posX + content.offsetWidth > opener.offsetWidth) posX = opener.offsetWidth - content.offsetWidth; if (posX < 0 ) posX = 0; x = xstooltip_findPosX(opener.lastChild) + posX; y = xstooltip_findPosY(opener.lastChild) + posY; content.style.top = y + 'px'; content.style.left = x + 'px'; content.style.position = 'absolute'; content.style.zIndex = 2; } } /***********************************************************************/ /* Hide objects with "jshide" class (element is not seen by Screen Readers) /***********************************************************************/ function hidejshideObject() { var jshidevar = getElementsByClass("jshide"); for ( i=0;i0)? this.currentTabIndex-1 : this.hottabspositions.length-1 } if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function this.cancelautorun() //stop auto cycling of tabs (if running) this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]]) }, setpersist:function(bool){ //PUBLIC function to toggle persistence feature this.enabletabpersistence=bool }, setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link") this.selectedClassTarget=objstr || "link" }, getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref }, urlparamselect:function(tabinterfaceid){ var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index }, expandtab:function(tabref){ var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand //Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : "" this.expandsubcontent(subcontentid) this.expandrevcontent(associatedrevids) for (var i=0; i500 && this.hottabspositions.length>1){ this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod) } } //END int() function } //END Prototype assignment /***********************************************************************/ /* Accessible script for select forms without a submit button /***********************************************************************/ //(c)2006 Thomas Frank, Studentlitteratur niceSelect=function(){ var f=document.forms; for (var i=0;i