        var popupHandle = new Array();
        var iTotalPopup = 0;

	// Input	: sStatus	(status string to be displayed on window status)
	// Output	: sStatus will be displayed on window status
	// Purpose	: Best used with <A HREF>, for example:
	//		  <A HREF="http://www.eResources.com" onMouseOver="return setStatus('eResources Site')">
	//		  So that the actual URL can be hidden
	function setStatus(sStatus)
	{
		window.status = sStatus;
		return true;
	}
	
	function GetObj(pID)
    {
        var obj = document.getElementById(pID);
        return obj;
    }
	
	// Input	: emailStr (email string to evaluate)
	// Output	: true 	-> if email has correct format
	//		  false	-> if email has wrong format
	// Purpose	: to validate an email format
	function isValidEmail (emailStr) 
	{
		
		var emailPat=/^(.+)@(.+)$/
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		var validChars="\[^\\s" + specialChars + "\]"
		var quotedUser="(\"[^\"]*\")"
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) {
			alert("Email address seems incorrect (check @ and .'s)")
			return false;
		}
		var user=matchArray[1]
		var domain=matchArray[2]

		if (user.match(userPat)==null) {    
			alert("The username doesn't seem to be valid.")
			return false
		}

		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) {
      			for (var i=1;i<=4;i++) {
	    			if (IPArray[i]>255) {
	        			alert("Destination IP address is invalid!");
					return false;
	    			}
	  		}
	  		return true;
		}

		// Domain is symbolic name
		var domainArray=domain.match(domainPat)
		if (domainArray==null) {
			alert("The domain name doesn't seem to be valid.");
			return false;
		}

		var atomPat=new RegExp(atom,"g");
		var domArr=domain.match(atomPat);
		var len=domArr.length;
		if (domArr[domArr.length-1].length<2 || 
			domArr[domArr.length-1].length>3) {   
			alert("The address must end in a three-letter domain, or two letter country.");
			return false;
		}

		if (len<2) {
			var errStr="This address is missing a hostname!";
			alert(errStr);
			return false;
		}

		// If we've gotten this far, everything's valid!
		return true;
  	}
  	
  	// Input  : URL		-> URL to display
  	//	        pWidth	-> Width of popup Window
  	//	        pHeight	-> Height of popup Window
  	// Output : new popup window	  	
  	// Purpose: to pop up new window with pWidth width and pHeight height and display URL
  	function popup(URL, pWidth, pHeight)
  	{   
		var iHandle = window.open(URL,'_blank','width=' + pWidth + ',height=' + pHeight + ',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=auto,copyhistory=no,resizable=yes');		
		popupHandle[ iTotalPopup++ ] = iHandle;						
		return true;
  	}
  	
  	function popupHidden(URL, pWidth, pHeight)
  	{   
		//var iHandle = window.open(URL,'_blank','width=' + pWidth + ',height=' + pHeight + ',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=auto,copyhistory=no,resizable=yes');		
		//popupHandle[ iTotalPopup++ ] = iHandle;		
		
		//TheNewWin =window.open(URL,'TheNewpop','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1');		
		var TheNewWin =window.open(URL,'_blank','width=0,height=0,toolbar=no,top=5000,left=5000,location=1,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no');				
		TheNewWin.blur();		
		
		return true;
  	}
  	
  	function popup2(URL, pWidth, pHeight)
  	{
		var iHandle = window.open(URL,'_blank','width=' + pWidth + ',height=' + pHeight + ',toolbar=no, top=100,left=100,scrollbars=yes,status=no,menubar=no,resizable=yes');
		popupHandle[ iTotalPopup++ ] = iHandle;
		return true;
  	}
  	
  	function popupBar(URL, pWidth, pHeight)
  	{
		var iHandle = window.open(URL,'_blank','width=' + pWidth + ',height=' + pHeight + ',toolbar=yes, top=100,left=100,scrollbars=yes,status=no,menubar=no,resizable=yes');
		popupHandle[ iTotalPopup++ ] = iHandle;
		return true;
  	}
  	
  	function destroyPopup()
  	{
  	        for (var iCount=0; iCount < iTotalPopup; iCount++) {
  	               popupHandle[ iCount ].close();
  	        }
  	}
  	
  	
  	// ---------------------- DISABLE RIGHT CLICK
	function right(e) {
		if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false;
		else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
			alert("Due to security issue, right click function is disabled!");
			return false;
		}
		return true;
	}
	
	function disableRightClick()
	{
		document.onmousedown=right;
		document.onmouseup=right;
		if (document.layers) window.captureEvents(Event.MOUSEDOWN);
		if (document.layers) window.captureEvents(Event.MOUSEUP);
		window.onmousedown=right;
		window.onmouseup=right;
	}
	
	function trim(str) 
	{
	        str = this != window? this : str;
	        return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
	}
	
	function viewFormat(pDocRecNo, pType)
	{
		popupBar('/include/docFormat_list.asp?docRecNo='+pDocRecNo+'&docType='+pType, 820, 400);
	}
	
	function viewAudioFormat(pAudio)
	{
		popupBar('/include/docAudioFormat_list.asp?audioID='+pAudio+'&path='+self.location, 820, 400);
	}
	
	function viewVideoFormat(pVideo)
	{
		popupBar('/include/docVideoFormat_list.asp?videoID='+pVideo+'&path='+self.location, 820, 400);
	}
	
	function downloadDocs(pPubkey)
	{
		popupBar('/include/download_list.asp?pubkey='+pPubkey, 820, 400);
	}
    	
    function center()
	{
		var leftX = (screen.width - self.document.body.offsetWidth) / 2;
		var topY  = (screen.height - self.document.body.offsetHeight) / 2;
		moveTo(leftX, topY);
	}
    	
    function sendIt()
	{
		var sEmail = document.form1.txtTo.value;
		var sArray = sEmail.split(",")
		var bSend  = true;
	
		for (iCount=0; iCount<sArray.length; iCount++) {
			if (! isValidEmail(trim(sArray[iCount]))){
				document.form1.txtTo.focus();
				bSend = false;
			}
		}
		
		if (bSend ) {
			if (! isValidEmail(document.form1.txtFrom.value)) {
				document.form1.txtFrom.focus();
				bSend = false;
			}
		}	
		
		if (bSend) document.form1.submit();	
	}
	
	function replace(string,text,by) {
        // Replaces text with by in string
            var strLength = string.length, txtLength = text.length;
            if ((strLength == 0) || (txtLength == 0)) return string;
        
            var i = string.indexOf(text);
            if ((!i) && (text != string.substring(0,txtLength))) return string;
            if (i == -1) return string;
        
            var newstr = string.substring(0,i) + by;
        
            if (i+txtLength < strLength)
                newstr += replace(string.substring(i+txtLength,strLength),text,by);
        
            return newstr;
    }
    
    function validSearchInput(pText)
	{
	    var regexpr       = /[^A-Za-z0-9]/;
	    var sChar         = "";
		var bNotValidChar = false;
		var bSearch       = false;
		
		for(var iPos=0; iPos < pText.length; iPos++) {
	        sChar         = pText.charAt(iPos);
	        bNotValidChar = regexpr.test(sChar);
	        if (!bNotValidChar) bSearch = true;
	    }
		return bSearch;
	}
	
	//==================================================================================================================
	
	//window.onload = function() {
	//suckerfish(sfHover, "LI", "wrapprinav");
	//}

function printPage() {
	popupBar("/research/pubID.103,css.print/pub_detail.asp", 770, 500);
}
function emailPage() {
	popup2("/emailVersion/email_pub.asp?pubID=103", 490, 400);
}

// Thanks to suckerfish - http://www.htmldog.com/articles/suckerfish/shoal/
//mimics :focus pseudo-class for IE (ADDED BY MATT on 12/10/04)	
function suckerfish(type, tag, parentId) {
//alert(parentId);
	if (window.attachEvent) {
		window.attachEvent("onload", function() {
			var sfEls = (parentId==null)?document.getElementsByTagName(tag):document.getElementById(parentId).getElementsByTagName(tag);
			type(sfEls);
		});
	}
}

sfHover = function(sfEls) {
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" hover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" hover\\b"), "");
		}
	}
}

sfTarget = function(sfEls) {
	var aEls = document.getElementsByTagName("A");
	document.lastTarget = null;
	for (var i=0; i<sfEls.length; i++) {
		if (sfEls[i].id) {
			if (location.hash==("#" + sfEls[i].id)) {
				sfEls[i].className+=" sftarget";
				document.lastTarget=sfEls[i];
			}
			for (var j=0; j<aEls.length; j++) {
				if (aEls[j].hash==("#" + sfEls[i].id)) aEls[j].targetEl = sfEls[i];
				aEls[j].onclick = function() {
					if (document.lastTarget) document.lastTarget.className = document.lastTarget.className.replace(new RegExp(" sftarget\\b"), "");
					if (this.targetEl) this.targetEl.className+=" sftarget";
					document.lastTarget=this.targetEl;
					return true;
				}
			}
		}
	}
}

// Function to validate date input, Created on April 17, 2006, Added on July 06, 2006
var dtCh= "/";
var minYear=1900;
var maxYear=2500;

function isInteger(s){
	var i;
	for (i = 0; i < s.length; i++){   
		var c = s.charAt(i);
		if (((c < "0") || (c > "9"))) return false;
	}
	return true;
}

function stripCharsInBag(s, bag){
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++){   
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}

function daysInFebruary (year){
	return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
} 
return this
}

function isDate(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

//-------- DRAG LAYER / DIV -----------------//
		var Drag = {
		obj : null,
		init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper)
		{
		o.onmousedown = Drag.start;
		o.hmode = bSwapHorzRef ? false : true ;
		o.vmode = bSwapVertRef ? false : true ;
		o.root = oRoot && oRoot != null ? oRoot : o ;
		if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px";
		if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px";
		if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px";
		if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px";
		o.minX = typeof minX != 'undefined' ? minX : null;
		o.minY = typeof minY != 'undefined' ? minY : null;
		o.maxX = typeof maxX != 'undefined' ? maxX : null;
		o.maxY = typeof maxY != 'undefined' ? maxY : null;
		o.xMapper = fXMapper ? fXMapper : null;
		o.yMapper = fYMapper ? fYMapper : null;
		o.root.onDragStart = new Function();
		o.root.onDragEnd = new Function();
		o.root.onDrag = new Function();
		},
		start : function(e)
		{
		var o = Drag.obj = this;
		e = Drag.fixE(e);
		var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		o.root.onDragStart(x, y);
		o.lastMouseX = e.clientX;
		o.lastMouseY = e.clientY;
		if (o.hmode) {
		if (o.minX != null) o.minMouseX = e.clientX - x + o.minX;
		if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX;
		} else {
		if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x;
		if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x;
		}
		if (o.vmode) {
		if (o.minY != null) o.minMouseY = e.clientY - y + o.minY;
		if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY;
		} else {
		if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y;
		if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y;
		}
		document.onmousemove = Drag.drag;
		document.onmouseup = Drag.end;
		return false;
		},
		drag : function(e)
		{
		e = Drag.fixE(e);
		var o = Drag.obj;
		var ey = e.clientY;
		var ex = e.clientX;
		var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom);
		var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right );
		var nx, ny;
		if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX);
		if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX);
		if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY);
		if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY);
		nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
		ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));
		if (o.xMapper) nx = o.xMapper(y)
		else if (o.yMapper) ny = o.yMapper(x)
		Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
		Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
		Drag.obj.lastMouseX = ex;
		Drag.obj.lastMouseY = ey;
		Drag.obj.root.onDrag(nx, ny);
		return false;
		},
		end : function()
		{
		document.onmousemove = null;
		document.onmouseup = null;
		Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]),
		parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"]));
		Drag.obj = null;
		},
		fixE : function(e)
		{
		if (typeof e == 'undefined') e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX;
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY;
		return e;
		}
		};
		
		
		// Used on Game Page --> tabs
		function openTab(pObj)
		{					
			var butt1 = document.getElementById('butt1');
			var butt2 = document.getElementById('butt2');
			var butt3 = document.getElementById('butt3');
			var butt4 = document.getElementById('butt4');
			var butt1b = document.getElementById('butt1b');
			var butt2b = document.getElementById('butt2b');
			var butt3b = document.getElementById('butt3b');
			var butt4b = document.getElementById('butt4b');
			
			var Obj1 = document.getElementById('tab1');
			var Obj2 = document.getElementById('tab2');
			var Obj3 = document.getElementById('tab3');
			var Obj4 = document.getElementById('tab4');
			
			Obj1.style.display='none';
			Obj2.style.display='none';
			Obj3.style.display='none';
			Obj4.style.display='none';
								
			
			if (pObj == "butt1"){
				butt1.style.display='inline';
				butt2.style.display='none';
				butt3.style.display='none';
				butt4.style.display='none';
				
				butt1b.style.display='none';
				butt2b.style.display='inline';
				butt3b.style.display='inline';
				butt4b.style.display='inline';
				Obj1.style.display='block';
			}
			else if (pObj == "butt2"){
				butt1.style.display='none';
				butt2.style.display='inline';
				butt3.style.display='none';
				butt4.style.display='none';
				
				butt1b.style.display='inline';
				butt2b.style.display='none';
				butt3b.style.display='inline';
				butt4b.style.display='inline';
				Obj2.style.display='block';
			}
			else if (pObj == "butt3"){
				butt1.style.display='none';
				butt2.style.display='none';
				butt3.style.display='inline';
				butt4.style.display='none';
				
				butt1b.style.display='inline';
				butt2b.style.display='inline';
				butt3b.style.display='none';
				butt4b.style.display='inline';
				Obj3.style.display='block';
			}
			else if (pObj == "butt4"){
				butt1.style.display='none';
				butt2.style.display='none';
				butt3.style.display='none';
				butt4.style.display='inline';
				
				butt1b.style.display='inline';
				butt2b.style.display='inline';
				butt3b.style.display='inline';
				butt4b.style.display='none';
				Obj4.style.display='block';
			}
		}