// gmax tweaks in this file! BEWARE!
/*
addEvent(window, "load", MainFrameLoaded);
var mainL
function MainFrameLoaded() {

	parent.MainLoaded = true
	
	if (parent.MenuLoaded){
		//alert("MenuLoaded:"+parent.MenuLoaded)
		parent.menu.initialise();
	} else {
		//alert("MenuLoaded:"+parent.MenuLoaded)
		mainL = window.setTimeout("MainFrameLoaded()", 1000)
	}
}
function addEvent(elm, evType, fn, useCapture)
// addEvent and removeEvent
// cross-browser event handling for IE5+,  NS6 and Mozilla
// By Scott Andrew
{
  if (elm.addEventListener){
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent){
    var r = elm.attachEvent("on"+evType, fn);
    return r;
  } else {
    alert("Handler could not be removed");
  }
} 
*/
var logged_in=true
var backcol = new Array(12)
var hilitecol = new Array(12)
var tops = new Array(12)
var lefts = new Array(12)
var heights = new Array(12)
var widths = new Array(12)
var menuscreated=false
var theurl=""
var winDbg;
var debug = false;

var thebrowser="nn"
if (document.all) {
	thebrowser="ie"
}

if (parseInt(navigator.appVersion)>=5) {
	thebrowser="ie"
}
var navplatform = navigator.platform
if (navplatform=="MacPPC") {
	navplatform="Macintosh"
}
if (navplatform=="Mac68K") {
	navplatform="Macintosh"
}

function FindDebugWnd() {
	var wCtr = 0;
	var win = window;
	while ((win.contents==null)&&(win.parent!=null)&&(win.parent!=win)) {
		wCtr ++;
		if (wCtr>50) {
			wCtr = -1;
			break;
		}
		win=win.parent;
	}
	if (wCtr != -1) return win;
	else return null;
}

function Trace(tmsg) {
	if (debug!=true) return;
	if (winDbg==null||typeof(winDbg)=="undefined") {
		winDbg = FindDebugWnd();
	}
	winDbg.contents.TraceOut(tmsg);
}

/*
function mmo(elem,p1,p2,aurl) {
	if (thebrowser=="ie") {
		if (navigator.appName!="Netscape") {
			elem.style.backgroundColor=hilitecol[p1]
		} else {
			object = document.getElementById("text" + p1 + p2)
			object.style.backgroundColor=hilitecol[p1]
		}
	} else {
		object=eval('document.menu' + new String(p1) + '.document.menua' + p1 + p2)
		object.visibility="inherit"
		theurl=aurl
	}
}

function mmout(elem,p1,p2) {
	if (thebrowser=="ie") {
		if (navigator.appName!="Netscape") {
			elem.style.backgroundColor=backcol[p1]
		} else {
			object = document.getElementById("text" + p1 + p2)
			object.style.backgroundColor=backcol[p1]
		}
	} else {
		object=eval('document.menu' + new String(p1) + '.document.menua' + p1 + p2)
		object.visibility="hide"
		theurl=""
		setcap()
	}
}

function hideMenu(event) {
	if (thebrowser!="ie") {
		mousex=event.pageX
		mousey=event.pageY
		for (cc=1;cc<12;cc++) {
			object=eval('document.menu' + new String(cc))
			if (typeof(object)!="undefined") {
				if (object.visibility=="show") {
					l=object.left
					t=object.top
					r=l + object.clip.width
					b=t + object.clip.height
					if ((mousex<(l)||mousex>r||mousey<=(t+1)||mousey>b)&&mousex>-1) {
						if (object.visibility=='show') {
							object.visibility="hide"
						}
					}
				}
			}
		}
		showvid("visible")
	} else {
		mousex=event.pageX
		mousey=event.pageY
		for (cc=1;cc<12;cc++) {
			if (navigator.appName!="Netscape") {
				object=eval('document.menu' + new String(cc))
			} else {
				object = document.getElementById("menu" + cc)
			}
			if (typeof(object)!="undefined") {
				if (object.style.visibility=="visible") {
					l=parseInt(object.style.left)
					t=parseInt(object.style.top)
					r=l + parseInt(object.style.width)
					b=t + parseInt(object.style.height)+10
					if ((mousex<(l)||mousex>r||mousey<=(t+1)||mousey>b)&&mousex>-1) {
						if (object.style.visibility=='visible') {
							object.style.visibility="hidden"
						}
					}

				}
			}
		}
		showvid("visible")
	}
}

function sm(p1) {
	theurl=""	
	if (thebrowser!="ie") {
		object=eval('parent.main.document.menu' + p1)
		if (object.visibility=="show") {
			return
		}
		hideall()
		
		xoff = window.pageXOffset
		yoff = window.pageYOffset
		twh = window.innerHeight + 4
		object.top = tops[p1]+yoff
		object.left = lefts[p1]+xoff
		xoff = (parseInt(object.top) + parseInt(heights[p1])-yoff) - twh
		if (xoff>0) {
			object.top = parseInt(object.top)-xoff
		}
		if (object.top < 0) {
			object.top=0
		}		
		object.visibility="visible"
		showvid("hidden")
	} else {
		if (navigator.appName=="Netscape") {
			object = document.getElementById("menu" + p1)
			xoff = window.pageXOffset
			yoff = window.pageYOffset
			twh = window.innerHeight-10
			object.style.height = heights[p1]-10
			object.style.width = widths[p1]-14
		} else {
			object=eval('parent.main.menu' + p1)
			yoff = document.body.scrollTop
			xoff = document.body.scrollLeft
			twh = document.body.clientHeight
		}
		if (object.style.visibility=="visible") {
			return
		}
		hideall()
		object.style.top = tops[p1]+yoff
		object.style.left = lefts[p1]+xoff
		xoff = (parseInt(object.style.top) + parseInt(object.style.height)-yoff) - twh
		if (xoff>0) {
			object.style.top = parseInt(object.style.top)-xoff
		}
		if (object.style.top < 0) {
			object.style.top=0
		}
		object.style.zIndex=100
		object.style.visibility="visible"
		showvid("hidden")
	}
}

function hideall() { return true; }
function hideallbar() { return true; }


function hideall() {
	for (cc=1;cc<menucounter;cc++) {
		if (thebrowser=="ie") {
			if (navigator.appName!="Netscape") {
				theobject=eval('menu' + cc)
			} else {
				theobject = document.getElementById("menu" + cc)
			}
			theobject.style.visibility="hidden"
		} else {
			theobject=eval('document.menu' + cc)
			theobject.visibility="hide"
		}
	}
}


function hideallbar(barone) {
	for (cc=1;cc<menucounter;cc++) {
		if (cc!=new Number(barone)) {
			if (thebrowser=="ie") {
				if (navigator.appName!="Netscape") {
					theobject=eval('menu' + cc)
				} else {
					theobject = document.getElementById("menu" + cc)
				}
				theobject.style.visibility="hidden"
				showvid("visible")
			} else {
				theobject=eval('document.menu' + cc)
				theobject.visibility="hide"
			}
		}
	}
}


function fhm(p1) {
	object=eval('menu' + p1)
	object.style.visibility="hidden"
	theurl=""
}

function gosite(thesite, mennum) {
	if (thebrowser!="ie") {
		if (theurl!="") {
			location.href=theurl
		}
	} else {
		location.href=thesite
		if (navigator.appName!="Netscape") {
			theobject=eval("menu" + mennum)
		} else {
			theobject = document.getElementById("menu" + mennum)
		}
		theobject.style.visibility="hidden"
	}
}

function hm(p1) {
	if (navigator.appName=="Netscape") {
		return
	}
	object=eval('parent.main.menu' + p1)
	if (navigator.appName=="Netscape") {
		xoff = window.pageXOffset
		yoff = window.pageYOffset
	} else {
		yoff = document.body.scrollTop
		xoff = document.body.scrollLeft
	}
	l=parseInt(object.style.left) - xoff
	t=parseInt(object.style.top) - yoff
	r=l + parseInt(object.style.width)-1
	b=t + parseInt(object.style.height)-1
	if ((event.x<(l)||event.x>r||event.y<=(t+1)||event.y>b)&&event.x>0) {
		object.style.visibility="hidden"
		showvid("visible")
	}
}
*/
function showvid(onoff) {
	if (maincaption.indexOf("type='video/quicktime'")>0) {
		showit=true
		if (thebrowser=="ie") {
			if (navigator.appName=="Netscape") {
				vidobject = document.getElementById("vidmenu")
			} else {
				vidobject = eval("vidmenu")
			}
			if (onoff=="visible") {
				if (vidobject.style.visibility=="visible") {
					showit=false
				}
				for (cc=1;cc<menucounter;cc++) {
					menuobject = document.getElementById("menu" + cc)
					if (menuobject.style.visibility=="visible") {
						showit=false
					}
				}
			} else {
				if (vidobject.style.visibility=="hidden") {
					showit=false
				}
			}
			if (showit==true) {
				vidobject.style.visibility=onoff
			}
		} else {
			if (onoff=="visible") {
				if (document.vidmenu.visibility=="show") {
					showit=false
				}
				for (cc=1;cc<menucounter;cc++) {
					menuobject = eval("document.menu" + cc)
					if (menuobject.visibility=="show") {
						showit=false
					}
				}
			} else {
				if (document.vidmenu.visibility=="hide") {
					showit=false
				}
			}
			if (showit==true) {
				document.vidmenu.visibility=onoff
			}
		}
	}
}

/*
function phm(p1) {
	if (thebrowser=="ie") {
		if (navigator.appName=="Netscape") {
			object = document.getElementById("menu" + p1)
		} else {
			object=eval('menu' + p1)
		}
		object.style.visibility="hidden"
	} else {
		object=eval('parent.main.document.menu' + p1)
		object.visibility="hide"
	}
}

function createMenu(mnum,fontname,fontsize,bgcolor,forecolor,hilite,lleft,ttop,wwidth,hheight,ci,uci,cii,ucii,ciii,uciii,civ,uciv,cv,ucv,cvi,ucvi,cvii,ucvii,cviii,ucviii,cix,ucix,cx,ucx) {
	var maxmenuitems=12;
	menucounter=menucounter+1
	backcol[mnum]=bgcolor
	hilitecol[mnum]=hilite
	tops[mnum]=ttop
	lefts[mnum]=lleft
	
	if (thebrowser!="ie") {
		counter=1
		for (cc=1;cc<maxmenuitems+1;cc++) {
			numtocheck = maxmenuitems + 1 + ((cc-1)*2)
			if (typeof(createMenu.arguments[numtocheck])!="undefined") {
				counter=counter+1
			}
		}
		document.write('<LAYER bgcolor="#35ccff" visibility="hide" name="menu' + mnum + '" id="menu' + mnum + '" left=' + lleft + ' top=' + ttop + ' width=' + (wwidth+8) + ' height=' + ((counter * hheight) + 8) + '>')
		document.write('<LAYER bgcolor="' + bgcolor + '" visibility="inherit" left=2 top=2 width=' + (wwidth+4) + ' height=' + ((counter * hheight) + 4) + '></LAYER>')
	} else {
		document.write('<DIV onmouseout="hm(' + mnum + ')" name="menu' + mnum + '" id="menu' + mnum + '" style="FILTER:revealTrans();background-color:' + bgcolor + ';padding:3;border-color:#35ccff;border-width:2px;border-style:solid;left:' + lleft + ';top:' + ttop + ';width:' + (wwidth+8) + ';height:172;position:absolute;visibility:hidden;">')
	}
	counter=0
	for (cc=1;cc<maxmenuitems+1;cc++) {
		temp=""
		numtocheck = maxmenuitems - 2 + ((cc-1)*2)
		thesite = escape(createMenu.arguments[maxmenuitems - 1 + ((cc-1)*2)])

		if (typeof(createMenu.arguments[numtocheck])!="undefined") {
			temp=createMenu.arguments[numtocheck]
		}
		if (temp!="") {
			counter=counter+1
			if (thebrowser!="ie") {
				thestring="<P class=menusnav>" + temp + "</P>"
			} else {
				thestring='<TABLE width=' + wwidth + ' height=' + (hheight-1) + ' cellspacing=0 border=0 cellpadding=0><td valign=middle align=left><P class=menus>' + temp + '</TD></TABLE>'
			}
			if (thebrowser!="ie") {
				thesite="'" + thesite + "'"
				document.write('<LAYER bgcolor="' + bgcolor + '" name="menu' + mnum + cc + '" border=0 left=4 top=' + (((cc-1)*hheight) + 4) + ' width=' + wwidth + ' height=' + hheight + ' visibility="inherit"></LAYER>')
				document.write('<LAYER bgcolor="' + hilite + '" name="menua' + mnum + cc + '" border=0 left=4 top=' + (((cc-1)*hheight) + 4) + ' width=' + wwidth + ' height=' + hheight + ' visibility="hide"></LAYER>')
				document.write('<LAYER name="text' + mnum + cc + '" left=4 top=' + (((cc-1)*hheight) + 4) + ' width=' + wwidth + ' height:' + hheight + '>' + thestring + '</LAYER>')
				document.write('<LAYER name="block' + mnum + cc + '" onmousedown="' + thesite + '" onmouseover="mmo(this,' + mnum + ',' + cc + "," + thesite + ')" onmouseout="mmout(this,' + mnum + ',' + cc + ')" left=4 top=' + (((cc-1)*hheight) + 4) + ' width=' + wwidth + ' height=' + hheight + '></LAYER>')
			} else {
				thesite="gosite('" + thesite + "'," + cc + ")"
				document.write('<DIV name="text' + mnum + cc + '" id="text' + mnum + cc + '" onclick="' + thesite + '" onmouseover="mmo(this,' + mnum + ',' + cc + ')" onmouseout="mmout(this,' + mnum + ',' + cc + ')" style="background-color:' + bgcolor + ';cursor:hand;position:absolute;left:2;top:' + (((cc-1)*hheight)+3) + ';width:' + (wwidth-4) + ';height:' + (hheight-2) + ';">' + thestring + '</DIV>')
				if (cc>1) {
					document.write('<DIV style="border-style:solid;padding:0;border-width:0;border-top-color:#35ccff;border-top-style:solid;border-top-width:1;position:absolute;left:6;top:' + (((cc-1)*hheight)+2) + ';width:' + (wwidth-8) + ';height:1;"><IMG SRC="/images/invisible.gif" width=1 height=0></DIV>')
				}
				if (navigator.appName=="Netscape") {
					document.write('<DIV name="textol' + mnum + cc + '" id="text' + mnum + cc + '" onclick="' + thesite + '" onmouseover="mmo(this,' + mnum + ',' + cc + ')" onmouseout="mmout(this,' + mnum + ',' + cc + ')" style="cursor:hand;position:absolute;left:2;top:' + (((cc-1)*hheight)+2) + ';width:' + (wwidth-4) + ';height:' + hheight + ';"></DIV>')
				}
			}
		}
	}
	if (thebrowser!="ie") {
		document.write('</LAYER>')		
	} else {
		document.write('</DIV>')
		if (navigator.appName!="Netscape") {
			object=eval('menu' + mnum)
			object.style.height = (counter * hheight) + 8
		}
	}
	heights[mnum]=(counter * hheight) + 8
	widths[mnum]=wwidth + 8	
}

function setcap() {
	if (thebrowser!="ie") {
		document.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP | Event.LOAD)
		document.onload=MenuFrameLoaded
		document.onmousemove=hideMenu
		document.onmouseup=gosite
	} else {
		if (navigator.appName=="Netscape") {
			document.onmousemove=hideMenu
		}
	}
}

setcap()
*/

ver = parseFloat(navigator.appVersion);
if (ver <4) {
	location.replace("/index.html")
}
var haveqt=false
var showthumbs=true
var thumbcount=0
var nextpage=''
var prevpage=''
var ilevel=''
var efname=''
var mmelements=0
var relateditems=0
var maincaption=""
var fname=''
var nextpage=''
var prevpage=''
var thetitle =""
var thesection=""
var theheading=""
var cp=0
var tp=0
var mtype = 0
var chap = 0
var efname=''
var columnone = ''
var longfname=""
var elenum=-1
var d=document
var botadd="<CENTER><P class=captionblue>This movie/sound is in <A HREF='javascript:lnw(\"http://www.apple.com/quicktime/download\")'>Apple Quicktime</A> format. <A HREF='javascript:lnw(\"/support/quicktime.html\")'>Click here</A> to learn more about this format, or if you are having problems playing this movie or sound.</CENTER>"

/*
function addtoproject() {
	if (longfname=="") {
		d.project.projectdata.value=document.URL
	} else {
		d.project.projectdata.value=maincaption
		d.project.picture.value=longfname
	}

	sumlength=47
	if (maincaption.length<47) {
		sumlength=maincaption.length
	}

	if ((thebrowser=="ie")&&(navigator.appName!="Netscape")) {
		var brange = document.selection.createRange();
		if (brange.text!="") {
			d.project.projectdata.value=brange.text
		}
		if (brange.text!="") {
			if (brange.text.length<47) {
				sumlength=brange.text.length
			}
			d.project.summary.value=brange.text.substring(0,sumlength)
		} else {
			d.project.summary.value=maincaption.substring(0,sumlength)
		}
	} else {
		d.project.summary.value=maincaption.substring(0,sumlength)
	}
	d.project.currentpage.value=document.URL
	d.project.elementname.value=theheading
	onNm = GetCookie("pid")
	pNm = GetCookie("cpn")
	if (onNm==""||onNm==null) {
		onNm=""
	}
	if (pNm==""||pNm==null) {
		pNm=""
	}
	d.project.userid.value=onNm
	d.project.projectid.value=pNm
	d.project.submit()
}
*/

function lqt(qtname, caption, title) {
	ranwin = Math.round(Math.random()*100)+1
	qtm = window.open("/support/qtmovie.html?movie="+qtname+"?caption="+caption+botadd+"?title="+document.title+"?", "movie"+new String(ranwin), 'status=yes,resizable=yes,toolbar=no,scrollbars=yes,width=320,height=320');
}

function lnw(winname) {
	lnw = window.open(winname, "Quicktime");
}

function NewBrowserWnd(wndPath, wndWidth, wndHeight, wndFeatures) {
	if (typeof(wndFeatures)!="undefined") {
		NewWnd = window.open(wndPath, "NewBrsrWnd", "location=0, directories=0, toolbar=0, status=0, menubar=0, scrollbars=1, resizable=1,width="+wndWidth+", height="+wndHeight);
	} else {
		NewWnd = window.open(wndPath, "NewBrsrWnd", "location=1, directories=1, toolbar=1, status=1, menubar=1, scrollbars=1, resizable=1,width="+wndWidth+", height="+wndHeight);
	}
	if (NewWnd) {
    NewWnd.opener = this;
		if ((wndWidth > screen.width)||(wndHeight > screen.height)) {
			NewWnd.moveTo(0, 0);
		}	else {
			NewWnd.moveTo((screen.width-wndWidth)/2,(screen.height-wndHeight)/4);
		}
		NewWnd.focus();
  }
}

function newvidsize(vidsize) {
	if (vidsize==0) {
		SetCookie('vidsize',2)
	} else {
		SetCookie('vidsize',0)
	}
	location.reload()
	return
}
function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)	break;
	}
	return null;
}

function SetCookie(name, value) {
	expire=new Date("July 1, 2010");
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	path = "/";
	document.cookie = name + "=" + escape (value) +
										((expire == null) ? "" : ("; expires=" + expire.toGMTString())) +
										((path == null) ? "" : ("; path=" + path)) +
										((domain == null) ? "" : ("; domain=" + domain)) +
										((secure == true) ? "; secure" : "");
}

// Also see doArticle()
function writeData(thejs,heading,caption,picnum,smallx,smally,picfile,ftype,tsec) {
	caption=fur(caption,"¿","'")
	heading=fur(heading,"¿","\\'")
	addto=''
	if (picfile.indexOf(".avi")>-1) {
		ftype="res_vid"
		alttext=" Video "
	}
	if (picfile.indexOf(".wav")>-1) {
		ftype="res_aud"
		alttext=" Audio "
	}
	if (picfile.indexOf(".mid")>-1) {
		ftype="res_aud"
		alttext=" Audio "
	}
	if (ftype!='') {
		alttext=""
		if (ftype=="pic") {
			alttext=" Image "
			ftype="res_pic"
		}
		if (ftype=="cht") {
			alttext=" Chart "
			ftype="res_cht"
		}
		if (ftype=="spr") {
			alttext=" Table "
			ftype="res_spr"
		}
		if (ftype=="vid") {
			alttext=" Video "
			ftype="res_vid"
		}
		if (ftype=="aud") {
			alttext=" Audio "
			ftype="res_aud"
		}
		addto='<IMG alt="' + alttext + '" align=texttop SRC="/websterworld/localassets/images/' + ftype + '.gif" width=16 height=16> '
	}
	if (caption=='') {
		caption=heading
	}
	tc=""
	tc2=""
	if (ts==tsec&&ss!=thesection) {
		tc="<FONT COLOR=red>"
		tc2="</FONT>"
	}
	if (GetCookie('showthumbs')=="true") {
		if (ftype=="pic") {
			addto=""
			d.write("<P class=list>" + addto + "<A HREF=\"javascript:(loadbigversion2('" + picfile + "','no','" + heading+ "','" + thejs + "'))\">" + tc + caption + tc2 + "</A></I><table border=1 bordercolor=#ff8c00 bordercolorlight=#ffd700 bordercolordark=#ff8c00 cellspacing=0 cellpadding=0><td><A HREF=\"javascript:(loadbigversion2('" + picfile + "','no','" + heading+ "','" + thejs + "'))\"><IMG border=0 width="+smallx+" height="+smally+" SRC='pics/small/"+picfile+"'></a></td></table>")
		} else {
			d.write("<P class=list>" + addto + "<A HREF=\"javascript:(loadbigversion2('" + picfile + "','no','" + heading+ "','" + thejs + "'))\">" + tc + caption + tc2 + "</A></I>")
		}
	} else {
		d.write("<P class=list>" + addto + "<A HREF=\"javascript:(loadbigversion2('" + picfile + "','no','" + heading+ "','" + thejs + "'))\">" + tc + caption + tc2 + "</A></I>")
	}
}

// Also see writeData()
function doArticle(thejs,caption,tsec) {
	caption=fur(caption,"¿","'")
	thejs=fur(thejs,"¿","\\'")

	alttext='Article'
	ftype="res_txt"
	if (thejs.indexOf("<B>")>-1) {
		ftype="res_pic"
		alttext="Article with multimedia elements"
	}

	thejs=fur(thejs,"<B>","")
	thejs=fur(thejs,"</B>","")

	if (ftype!='') {
		addto='<IMG alt = "' + alttext + '" align=texttop SRC="/websterworld/localassets/images/' + ftype + '.gif" width=16 height=16> '
	}
	tc=""
	tc2=""
	if (ts==tsec&&ss!=thesection) {
		tc="<FONT COLOR='#FF0000'>"
		tc2="</FONT>"
	}
	d.write("<P class=list>" + addto + "<A HREF=\"javascript:(loadlink('" + caption + "'))\">" + tc + thejs + tc2+ "</A></I>")
}

function fr(rstring,rwith) {
	do {
		rstring=rstring.replace(rwith, "")
	}
	while (rstring.indexOf(rwith,1)>1)
		return rstring
}

function fur(rstring,rwith,rwith2) {
	do {
		rstring=rstring.replace(rwith, rwith2)
	}
	while (rstring.indexOf(rwith,1)>0)
		return rstring
}

function mme(filename,caption,multi,mcaption, smallx, smally,bigx,bigy) {
	this.filename=filename
	this.caption=caption
	this.multi=multi
	this.mcaption=mcaption
	this.smallx=smallx
	this.smally=smally
	this.bigx=bigx
	this.bigy=bigy
}

function ri(link,caption) {
	this.link=link
	this.caption=caption
}

function returnParameter(lsearch, param) {
	result = lsearch.indexOf("?" + param, 0)
	if (result>-1) {
		result2 = lsearch.indexOf("?", result + 1);	// params separated by '?'
		if (result2==-1) result2 = lsearch.indexOf("&", result + 1);	// params separated by '&'
		if (result2==-1) result2 = lsearch.length;
	} else {
		result = lsearch.indexOf("&" + param, 0);
		if (result>-1) {
			result2 = lsearch.indexOf("&", result + 1);
			//if (result2==-1) {result2 = lsearch.length - result;}
			if (result2==-1) {result2 = lsearch.length;}
		}
	}
	if (result>-1&&result2>-1) {
		return unescape(lsearch.substring(result+param.length+2,result2))
	} else {
		return ""
	}
}

function showElement(mfname) {
	soundpos = location.href.indexOf("/largersize.html")
	addtomfname = location.href.substring(0,soundpos+1)
	longfname = addtomfname+"pics/small/" + mfname
	for (i=0; i < mmelements.length; i++) {
		if (mmelements[i].filename==mfname||mmelements[i].multi==mfname&&mfname!="") {
			elenum=i
			if (mfname.indexOf(".jpg")>-1||mfname.indexOf(".gif")>-1) {
				maincaption = "<img src='/images/spacer.gif' width=1 height=3><BR><center><table border=1 bordercolor=#ff8c00 bordercolorlight=#ffd700 bordercolordark=#ff8c00 cellspacing=0 cellpadding=0><td><img src='"+addtomfname+"pics/"+fname+"' WIDTH=" + mmelements[i].bigx + " HEIGHT=" + mmelements[i].bigy + "'></td></table><p class=bigcap>" + mmelements[i].caption + "<center>"
			}
			if (mfname.indexOf(".avi")>-1||mfname.indexOf(".wav")>-1||mfname.indexOf(".mid")>-1) {
				oldfname=mfname
				if (mfname.indexOf('.avi')>0) {
					mfname="movies/"+mfname
				}
				if (mfname.indexOf('.wav')>0) {
					mfname="sounds/"+mfname
				}
				if (mfname.indexOf('.mid')>0) {
					mfname="sounds/"+mfname
				} else {
					mfname=mfname.slice(0,-3) + "asf"
				}
				soundpos = location.href.indexOf("/largersize.html")
				addtomfname = location.href.substring(0,soundpos+1)
				mfname = addtomfname+mfname
				if (oldfname.indexOf('.wav')>0||oldfname.indexOf('.mid')>0) {
					if (mfname.indexOf('.asf')>0) {
						mfname=mfname.slice(0,-3) + "mov"
					}
					maincaption=addpixels(4) + "<CENTER><OBJECT CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='240' height='30' CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab'><param name='type' value='video/quicktime'><param name='cache' value='true'><param name='src' value='" + mfname + "'><param name='autoplay' value='false'><embed src='" + mfname + "' cache='true' type='video/quicktime' width='240' height='30' autoplay='false' PLUGINSPAGE='http://www.apple.com/quicktime/download/'></EMBED></OBJECT><p class=bigcap>"+mmelements[i].caption + '</CENTER>' + botadd
				} else {
					mfname=mfname.slice(0,-3) + "asf"
					if (GetCookie('vidsize')=='2') {
						nstext="<A HREF='javascript:newvidsize(2)'>Play movie at original size</A>"
						var vidsize=2
						var vwid=322
						var vhit=258
					} else {
						nstext="<A HREF='javascript:newvidsize(0)'>Play movie at double size</A>"
						var vidsize=0
						var vwid=242
						var vhit=198
					}
					mfname=mfname.slice(0,-3) + "mov"
					thecap=fur(mmelements[i].caption,"¿","")
					tbotadd="<CENTER><P class=captionblue>"+nstext+"<BR>"+addpixels(10)+"<P class=captionblue>"+botadd//<A HREF='javascript:lqt(\"" + mfname + "\",\""+thecap+"\")'>Launch movie in separate window</A> (this will allow you to continue browsing and keep this movie loading in the background)<BR>"+addpixels(10)+botadd
					maincaption=addpixels(4) + "<CENTER><TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0><TD><OBJECT CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width='" + vwid + "' height='" + vhit + "' CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab'><param name='scale' value='tofit'><param name='src' value='" + mfname + "'><param name='autoplay' value='false'><embed src='" + mfname + "' scale='tofit' width='" + vwid + "' height='" + vhit + "' autoplay='false' PLUGINSPAGE='http://www.apple.com/quicktime/download/'></EMBED></OBJECT></TD></TABLE><p class=bigcap>"+mmelements[i].caption + '</CENTER>' + tbotadd
				}
				if (haveqt==false&&thebrowser!="ie") {
					maincaption=addpixels(4) + "<CENTER><TABLE width=320 height=240 BORDER=1 CELLSPACING=0 CELLPADDING=0><TD valign=middle align=center><A target='null' HREF='http://www.apple.com/quicktime/download'><IMG border=0 SRC='/images/getquicktime.gif' width=88 height=31 vspace=16></A><p class=captionblue>type='video/quicktime' This page requires Apple Quicktime version 4.1 or greater to run. Click on the above link to download the free Quicktime Player from Apple.<BR>"+addpixels(10)+"<p class=captionblue>QuickTime and the QuickTime Logo are trademarks of Apple Computer, Inc., registered in the U.S. and other countries. The Get QuickTime Badge is a trademark of Apple Computer Inc., used with permission.</TD></TABLE>"
				}
				if (thebrowser=="ie") {
					maincaption = "<DIV id='vidmenu' name='vidmenu' style='z-index:25;visibility:visible;'>" + maincaption + "</DIV>"
				} else {
					maincaption = "<ILAYER name='vidmenu' visibility='visible'>" + maincaption + "</ILAYER>"
				}
			}
		}
	}
}
