Changeset 19 for minimanager/js/general.js
- Timestamp:
- Aug 13, 2007, 9:05:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/js/general.js
r5 r19 1 function Menu(){ //thanks to :Project Seven Development2 if(navigator.appVersion.indexOf("MSIE")==-1){return;}3 var i,k,g,lg,r=/\s*hvr/,nn='',c,cs='hvr',bv='menubar';4 5 for(i=0;i<6;i++){6 g=document.getElementById(bv+nn);7 if(g){8 lg=g.getElementsByTagName("LI");9 if(lg){10 for(k=0;k<lg.length;k++){11 lg[k].onmouseover=function(){12 c=this.className;cl=(c)?c+' '+cs:cs;13 this.className=cl;14 };15 lg[k].onmouseout=function(){16 c=this.className;17 this.className=(c)?c.replace(r,''):'';18 };19 }20 }21 }nn=i+1;22 }23 }24 25 1 function do_submit (form_name,backup){ 26 2 if (form_name == 'form1') { … … 31 7 else if (form_name == 'form2') document.form2.submit(); 32 8 else document.form.submit(); 9 } 10 11 function showHide(id){ 12 var o, st; 13 if( document.getElementById ) // Standart way 14 o = document.getElementById(id); 15 else if(document.all) // for old MSIE 16 o = document.all[id]; 17 else if(document.layers) // for NN4 18 o = document.layers[id]; 19 st = o.style; 20 // if the style.display value is blank we try to figure it out here 21 if(st.display == '' && o.offsetWidth != undefined && o.offsetHeight != undefined) 22 st.display = (o.offsetWidth != 0 && o.offsetHeight != 0) ? 'block' : 'none'; 23 st.display = (st.display == '' || st.display == 'block') ? 'none' : 'block'; 33 24 } 34 25 … … 60 51 61 52 if(DOM || IE) this.obj.innerHTML = t; 62 if(DOM) this.height = this.obj.offsetHeight; 63 else if(IE) this.height = this.obj.style.pixelHeight; 53 if(DOM){ 54 this.width = this.obj.offsetWidth; 55 this.height = this.obj.offsetHeight; 56 } else if(IE){ 57 this.width = this.obj.style.pixelWidth; 58 this.height = this.obj.style.pixelHeight; 59 } 60 64 61 65 62 this.move(); … … 177 174 var mouseX = mouseY = 0; 178 175 document.onmousemove = getMouseXY; 176 177 function ANSWERBOX() { 178 this.text = ''; 179 this.btn_ok = 'OK'; 180 this.btn_cancel = 'Cancel'; 181 this.classname = 'answerbox'; 182 this.btn_icon = 'img/warn_red.gif'; 183 this.height = 0; 184 this.obj = null; 185 this.active = false; 186 187 this.create = function(action) { 188 if(!this.obj) this.init(); 189 190 var t = '<table class="' + this.classname + '"><tr><th colspan=2>'+((this.btn_icon)?'<img src="'+ this.btn_icon +'" width="48" height="48" alt="" align="absmiddle" />':'')+ this.text +'</th></tr>' 191 + '<tr align="center"><td><a class="button" style="width:120px;" href="' + action + '">' + this.btn_ok + '</a></td>' 192 + '<td><a class="button" style="width:120px;" href="#" onclick="answerbox.hide()">' + this.btn_cancel + '</a></td></tr></table>'; 193 194 if(DOM || IE) this.obj.innerHTML = t; 195 if(DOM){ 196 this.width = this.obj.offsetWidth; 197 this.height = this.obj.offsetHeight; 198 } else if(IE){ 199 this.width = this.obj.style.pixelWidth; 200 this.height = this.obj.style.pixelHeight; 201 } 202 203 this.move(); 204 this.show(); 205 } 206 207 this.init = function() { 208 if(DOM) this.obj = document.getElementById('AnswerBox'); 209 else if(IE) this.obj = document.all.AnswerBox; 210 } 211 212 this.move = function() { 213 var winX = getWinX() - (((GK && !SA) || OP) ? 17 : 0); 214 var winY = getWinY() - (((GK && !SA) || OP) ? 17 : 0); 215 216 this.obj.style.left = (winX/2 + getScrX() - this.width/2 - 5) + 'px'; 217 this.obj.style.top = (winY/2 + getScrY() - this.height/2 - 5) + 'px'; 218 } 219 220 this.show = function() { 221 this.obj.style.zIndex = 60; 222 this.active = true; 223 this.obj.style.visibility = 'visible'; 224 } 225 226 this.hide = function() { 227 this.obj.style.zIndex = -1; 228 this.active = false; 229 this.obj.style.visibility = 'hidden'; 230 } 231 232 } 233 234 function answerBox(text, action) { 235 if(text) { 236 answerbox.text = text; 237 answerbox.create(action); 238 } 239 } 240 241 document.write('<div id="AnswerBox" style="position:absolute; visibility:hidden"></div>'); 242 answerbox = new ANSWERBOX(); 243 answerbox.init();
Note:
See TracChangeset
for help on using the changeset viewer.