/*The ultimate DHTML drop-down codeNick Nettletonwww.computerarts.co.uk || www.fluid7.co.uk--Modifications to support NS6 browser, and adjustments byGil Pedersen--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 f7_droplayer to set the names of the dropdowns, and just call f7_showdrop(n) and f7_hdidedrop from onmouseover, onmouseout and other events. Swap n for the number of the layer as in the array.--Enjoy!!!*/if (document.getElementById){	pre='document.getElementById("'; post='")'; style='.style'} else if (document.all){	pre='document.all.'; post=''; style='.style'} else if (document.layers){	pre='findElement("'; post='")'; style=''}function findElement(n, ly) {	var curDoc = ly ? ly.document : document; var elem = curDoc[n];	if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {		elem = findElement(n,curDoc.layers[i]); if (elem) return elem; }}	return elem;}function getLayer(l) {	return eval(pre + l + post)}function getLayerStyle(l) {	var a=getLayer(l)	if (a)		return a=eval('a' + style);	return null}function layerSetVis(l, s) {	a=getLayerStyle(l)	if (a) a.visibility = (s == 0) ? 'hidden' : 'visible'}function getClip(obj) {	var clip=new Object()	clip.left=-1;clip.top=-1;clip.width=-1;clip.height=-1	if (obj) {		if (document.layers) {			// netscape 4 style			clip.left=obj.left			clip.width=obj.clip.width			clip.top=obj.top			clip.height=obj.clip.height		}		else if (obj.style) {				if (obj.style.pixelLeft) {					clip.left = obj.style.pixelLeft					clip.top = obj.style.pixelTop				}				else {					var t=obj					clip.left=t.offsetLeft					clip.top=t.offsetTop					while(t.offsetParent) {						t=t.offsetParent						clip.left+=t.offsetLeft						clip.top+=t.offsetTop					}				}				clip.width=obj.offsetWidth				clip.height=obj.offsetHeight		}	}	return clip;}function fixPos(t,l) {	if (t) {		var clip=getClip(t);		if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1) {			clip.left+=parseInt(document.body.leftMargin) - 2			clip.top+=parseInt(document.body.topMargin) - 2		}		l.style.left = clip.left+'px'		l.style.top = (clip.top + clip.height - 1)+'px'	}}//names of dropdowns stored heref7_droplayer=new Array()f7_droplayer[1]="linkpage1"f7_droplayer[2]="linkpage2"f7_droplayer[3]="linkpage3"f7_droplayer[4]="linkpage4"f7_droplayer[5]="linkpage5"//simple browser checkf7_v4=(parseInt(navigator.appVersion)>=4 && parseInt(navigator.appVersion)<=5)?1:0f7_ns=(document.layers && f7_v4)?1:0//code for dropsfunction f7_showdrop(thelayer){	f7_keep=thelayer;	for(i=1;i<f7_droplayer.length;i++){  		if(thelayer!=i) layerSetVis(f7_droplayer[i], 0);	}	f7_showitnow=1	f7_showit(thelayer)	}function show_props(obj, obj_name) {          var result = ""          for (var i in obj)                    result += obj_name + "." + i + " = " + obj[i] + "<br>"          document.write(result);          return result}function f7_showit(thelayer){		var l=f7_droplayer[thelayer]			var t=getLayer('lists'+thelayer);			//if (t) show_props(document.body, 'document.body')		if (f7_ns) {			t=getLayer('lists'+thelayer);			if (t) {				//show_props(t, 'lists1')				var f7_left = t.pageX				var f7_top = t.pageY + t.clip.height				eval('document.'+l+'.left=f7_left')				eval('document.'+l+'.top=f7_top')				}			}		else {			fixPos(getLayer('lists'+thelayer), getLayer(l))		}		layerSetVis(l, 1);	}f7_hidecount=0;function f7_timedhide() {	f7_hidecount++	setTimeout('f7_hidetimer()',500)}function f7_hidetimer() {	f7_hidecount--	if (!f7_hidecount)		f7_hideall();}function f7_hidedrop(){	f7_keep=-1; f7_timedhide()	}f7_keep=-1function f7_hideall(){	for(var i=1;i<f7_droplayer.length;i++){  		f7_hideit=0; f7_checkmousepos(i)		if(f7_keep!=i && f7_hideit)			layerSetVis(f7_droplayer[i], 0);		}	}//deal with cursor over layerdocument.onmousemove = f7_getmouseposif (f7_ns) document.captureEvents(Event.MOUSEMOVE)function f7_getmousepos(e){	if(e){f7_mousex=e.pageX; f7_mousey=e.pageY;}	else if(event){f7_mousex=event.clientX; f7_mousey=event.clientY;}	}function f7_checkmousepos(i){	var clip = getClip(getLayer(f7_droplayer[i]));	f7_x_min=clip.left;	f7_x_max=clip.left+clip.width;	f7_y_min=clip.top;	f7_y_max=clip.top+clip.height;		if (f7_mousex>=f7_x_min && f7_mousex<=f7_x_max && f7_mousey>=f7_y_min && f7_mousey<=f7_y_max){		f7_hideit=0; f7_timedhide()		}	else { f7_hideit=1 }	return f7_hideit	}