// -------------------------------------------------------------------------------------------------------------
//	Opens a copy-protected window to display text.	--  Brian Zegarski, 2004
//		Updated to support Firefox and removed to separate js file 2/7/2010.
// -------------------------------------------------------------------------------------------------------------




		
			
			var newWin = null
			var curVrs = null
			var tmpWin = null
			
			function closeTemp() {
				if (tmpWin) tmpWin.close()
			}
			function closeReader() {
				if (newWin) newWin.close()
			}
			function openReader( i ) {
				function rtclick(e){
					newWin.document.getElementById("txtNull").select()
					newWin.scroll(0, 0)
					return false
				}
				function openWin() {
					closeReader()
					newWin = window.open("", "", "width=500,height=440")
					if (newWin != null) {
						var ns6=document.getElementById&&!document.all
						var ie5=document.all
						var newTxt = "<html><head><title>"+gVrs[i][0]+"</title></head>"
						newTxt += "<body bgcolor='#bbc8cc'></body></html><form name='frmEo' >"
						newTxt += gVrs[i][1]+"<br><p></p>"+gVrs[i][3]+"<br><p></p>"
						newTxt += "<textarea name='txtShow' rows='20' cols='57' readonly='true' onSelect='txtNull.select()' onBlur='setSelectionRange(0,0)' onKeyPress='setSelectionRange(0,0)' >"+gVrs[i][2]+"</textarea><br><br>"
						newTxt += "<br><br><input type='text' id='txtNull' size=99 readonly='true' onFocus='scroll(0,0)' value='For permission to use this copyright protected work, please contact the author:  brian@zegarski.net'> "
						newWin.document.write(newTxt)
						if (ns6) newWin.document.addEventListener("mouseup", rtclick , true)
						else if (ie5) newWin.document.attachEvent("onmouseup", rtclick)
					}
				}
				if (i>gVrs.length-1) i = 0
				if ( newWin && (curVrs == i) ) {
					if ( !newWin.closed )
						newWin.focus()
					else
						openWin()
				} else openWin()
				curVrs=i
			}
			function popUp(link, winName) {
				if (! window.focus) return true //  If the fct doesn't exist, allow calling <a> to open the URL.
				var href
				if (typeof( link ) == 'string')
					href = link
				else
					href = link.href
				tmpWin = window.open(href, winName, 'width=400, height=300, scrollbars=yes, resizable=no')
				return false
			}
		
