| 1 | //Contents for menu 1 |
|---|
| 2 | var menu1=new Array() |
|---|
| 3 | menu1[0]='<a href="surveys.cfm">Surveys</a>' |
|---|
| 4 | menu1[1]='<a href="questions.cfm">Questions</a>' |
|---|
| 5 | menu1[2]='<a href="questiontypes.cfm">Question Types</a>' |
|---|
| 6 | |
|---|
| 7 | //Contents for menu 2 |
|---|
| 8 | var menu2=new Array() |
|---|
| 9 | menu2[0]='<a href="password.cfm">Set Password</a>' |
|---|
| 10 | menu2[1]='<a href="users.cfm">Users</a>' |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | //Contents for menu 3 |
|---|
| 14 | var menu3=new Array() |
|---|
| 15 | menu3[0]='<a href="stats.cfm">Reporting</a>' |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | //Contents for menu 4 |
|---|
| 19 | var menu4=new Array() |
|---|
| 20 | menu4[0]='<a href="index.cfm">Admin Home</a>' |
|---|
| 21 | menu4[1]='<a href="../">Soundings Home</a>' |
|---|
| 22 | menu4[2]='<a href="index.cfm?logout=1">Logout</a>' |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | var menuwidth='185px' //default menu width |
|---|
| 26 | var menubgcolor='#407ED8' //menu bgcolor |
|---|
| 27 | var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds) |
|---|
| 28 | var hidemenu_onclick="yes" //hide menu when user clicks within menu? |
|---|
| 29 | |
|---|
| 30 | /////No further editting needed |
|---|
| 31 | |
|---|
| 32 | var ie4=document.all |
|---|
| 33 | var ns6=document.getElementById&&!document.all |
|---|
| 34 | |
|---|
| 35 | if (ie4||ns6) |
|---|
| 36 | document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>') |
|---|
| 37 | |
|---|
| 38 | function getposOffset(what, offsettype){ |
|---|
| 39 | var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; |
|---|
| 40 | var parentEl=what.offsetParent; |
|---|
| 41 | while (parentEl!=null){ |
|---|
| 42 | totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; |
|---|
| 43 | parentEl=parentEl.offsetParent; |
|---|
| 44 | } |
|---|
| 45 | return totaloffset; |
|---|
| 46 | } |
|---|
| 47 | |
|---|
| 48 | |
|---|
| 49 | function showhide(obj, e, visible, hidden, menuwidth){ |
|---|
| 50 | if (ie4||ns6) |
|---|
| 51 | dropmenuobj.style.left=dropmenuobj.style.top=-500 |
|---|
| 52 | if (menuwidth!=""){ |
|---|
| 53 | dropmenuobj.widthobj=dropmenuobj.style |
|---|
| 54 | dropmenuobj.widthobj.width=menuwidth |
|---|
| 55 | } |
|---|
| 56 | if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") |
|---|
| 57 | obj.visibility=visible |
|---|
| 58 | else if (e.type=="click") |
|---|
| 59 | obj.visibility=hidden |
|---|
| 60 | } |
|---|
| 61 | |
|---|
| 62 | function iecompattest(){ |
|---|
| 63 | return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | function clearbrowseredge(obj, whichedge){ |
|---|
| 67 | var edgeoffset=0 |
|---|
| 68 | if (whichedge=="rightedge"){ |
|---|
| 69 | var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15 |
|---|
| 70 | dropmenuobj.contentmeasure=dropmenuobj.offsetWidth |
|---|
| 71 | if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) |
|---|
| 72 | edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth |
|---|
| 73 | } |
|---|
| 74 | else{ |
|---|
| 75 | var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset |
|---|
| 76 | var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 |
|---|
| 77 | dropmenuobj.contentmeasure=dropmenuobj.offsetHeight |
|---|
| 78 | if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up? |
|---|
| 79 | edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight |
|---|
| 80 | if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either? |
|---|
| 81 | edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge |
|---|
| 82 | } |
|---|
| 83 | } |
|---|
| 84 | return edgeoffset |
|---|
| 85 | } |
|---|
| 86 | |
|---|
| 87 | function populatemenu(what){ |
|---|
| 88 | if (ie4||ns6) |
|---|
| 89 | dropmenuobj.innerHTML=what.join("") |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | function dropdownmenu(obj, e, menucontents, menuwidth){ |
|---|
| 94 | if (window.event) event.cancelBubble=true |
|---|
| 95 | else if (e.stopPropagation) e.stopPropagation() |
|---|
| 96 | clearhidemenu() |
|---|
| 97 | dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv |
|---|
| 98 | populatemenu(menucontents) |
|---|
| 99 | |
|---|
| 100 | if (ie4||ns6){ |
|---|
| 101 | showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth) |
|---|
| 102 | dropmenuobj.x=getposOffset(obj, "left") |
|---|
| 103 | dropmenuobj.y=getposOffset(obj, "top") |
|---|
| 104 | dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px" |
|---|
| 105 | dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px" |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | return clickreturnvalue() |
|---|
| 109 | } |
|---|
| 110 | |
|---|
| 111 | function clickreturnvalue(){ |
|---|
| 112 | if (ie4||ns6) return false |
|---|
| 113 | else return true |
|---|
| 114 | } |
|---|
| 115 | |
|---|
| 116 | function contains_ns6(a, b) { |
|---|
| 117 | while (b.parentNode) |
|---|
| 118 | if ((b = b.parentNode) == a) |
|---|
| 119 | return true; |
|---|
| 120 | return false; |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | function dynamichide(e){ |
|---|
| 124 | if (ie4&&!dropmenuobj.contains(e.toElement)) |
|---|
| 125 | delayhidemenu() |
|---|
| 126 | else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) |
|---|
| 127 | delayhidemenu() |
|---|
| 128 | } |
|---|
| 129 | |
|---|
| 130 | function hidemenu(e){ |
|---|
| 131 | if (typeof dropmenuobj!="undefined"){ |
|---|
| 132 | if (ie4||ns6) |
|---|
| 133 | dropmenuobj.style.visibility="hidden" |
|---|
| 134 | } |
|---|
| 135 | } |
|---|
| 136 | |
|---|
| 137 | function delayhidemenu(){ |
|---|
| 138 | if (ie4||ns6) |
|---|
| 139 | delayhide=setTimeout("hidemenu()",disappeardelay) |
|---|
| 140 | } |
|---|
| 141 | |
|---|
| 142 | function clearhidemenu(){ |
|---|
| 143 | if (typeof delayhide!="undefined") |
|---|
| 144 | clearTimeout(delayhide) |
|---|
| 145 | } |
|---|
| 146 | |
|---|
| 147 | if (hidemenu_onclick=="yes") |
|---|
| 148 | document.onclick=hidemenu |
|---|
| 149 | |
|---|
| 150 | function MM_preloadImages() { //v3.0 |
|---|
| 151 | var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); |
|---|
| 152 | var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) |
|---|
| 153 | if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} |
|---|
| 154 | } |
|---|
| 155 | |
|---|
| 156 | function MM_swapImgRestore() { //v3.0 |
|---|
| 157 | var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; |
|---|
| 158 | } |
|---|
| 159 | |
|---|
| 160 | function MM_findObj(n, d) { //v4.01 |
|---|
| 161 | var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { |
|---|
| 162 | d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} |
|---|
| 163 | if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; |
|---|
| 164 | for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); |
|---|
| 165 | if(!x && d.getElementById) x=d.getElementById(n); return x; |
|---|
| 166 | } |
|---|
| 167 | |
|---|
| 168 | function MM_swapImage() { //v3.0 |
|---|
| 169 | var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) |
|---|
| 170 | if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} |
|---|
| 171 | } |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | function MM_swapImgRestore() { //v3.0 |
|---|
| 175 | var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; |
|---|
| 176 | } |
|---|
| 177 | function MM_preloadImages() { //v3.0 |
|---|
| 178 | var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); |
|---|
| 179 | var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) |
|---|
| 180 | if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} |
|---|
| 181 | } |
|---|
| 182 | |
|---|
| 183 | function MM_findObj(n, d) { //v4.01 |
|---|
| 184 | var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { |
|---|
| 185 | d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} |
|---|
| 186 | if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; |
|---|
| 187 | for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); |
|---|
| 188 | if(!x && d.getElementById) x=d.getElementById(n); return x; |
|---|
| 189 | } |
|---|
| 190 | |
|---|
| 191 | function MM_swapImage() { //v3.0 |
|---|
| 192 | var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) |
|---|
| 193 | if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} |
|---|
| 194 | } |
|---|