/* The ultimate DHTML drop-down code Nick Nettleton www.computerarts.co.uk || www.fluid7.co.uk -- This must be the single most requested bit of code in the history of Computer Arts, so we've decided to make it user-friendly and adaptable for everyone. Stacks more goodies to come too - head to one of the above sites for regular infoa nd updates. Works with v4 and v5 browsers - both IE and NS. Update for NS6 coming. Also, be aware there's no way to automatically centre layers in the window - a JS for this coming soon. In the meantime, stick with left-aligned. Keep an eye out for update for NS6. -- You can adapt, use and distribute this code under GNU public licence, as long as: (1) You leave all the comment and credit lines in, including these ones (2) You don't sell it for profit -- If you want to tweak the code yourself, use the f1_droplayer to set the names of the dropdowns, and just call f1_showdrop(n) and f1_hdidedrop from onmouseover, onmouseout and other events. Swap n for the number of the layer as in the array. -- Enjoy!!! */ //names of dropdowns stored here f1_droplayer=new Array() f1_droplayer[0]="dropf1" //simple browser check f1_v4=(parseInt(navigator.appVersion)>=4 && parseInt(navigator.appVersion)<=5)?1:0 f1_ie=(document.all && f1_v4)?1:0 f1_ns=(document.layers && f1_v4)?1:0 //code for drops function f1_fix() { } function f1_showdrop(thelayer){ f1_keep=thelayer; f1_hideall(); f1_showitnow=1 f1_showit(thelayer) } function f1_showit(thelayer){ if(f1_ie){ eval(f1_droplayer[thelayer]+'.style.visibility="visible"') } if(f1_ns){ eval('document.'+f1_droplayer[thelayer]+'.visibility="show"');} } function f1_hidedrop(){ f1_keep=-1; setTimeout('f1_hideall()',500) } f1_keep=-1 function f1_hideall(){ for(i=0;i=f1_x_min && f1_mousex<=f1_x_max && f1_mousey>=f1_y_min && f1_mousey<=f1_y_max){ f1_hideit=0; setTimeout('f1_hideall()',500) } else { f1_hideit=1 } return f1_hideit }