	//<!-- Hide script from older browsers
	//Window functions are at the bottom of this file.
	var sJobs = 'ejobs-2012';
	var sUser = 'editors-2012';
	var sDomain = 'BioScienceWriters';
	var sExt = 'com';
	var goWin = null;
	
	setTimeout ("escapeFrames()", 3000);
	
	/********************************************************************************/
	//WB; Return a string used to open a new window that is centered on the secreen.
	function centerWindow(riWidth, riHeight, rbStatus, rbScrollbars, rbResizable) {
		
		//window.open(sASP, "", centerWindow(740, 380, true, true, true));
		var iHeight = 0;
		var iLeft = 0;
		var iTop = 0;
		var iWidth = 0;
		var sPosition = '';
		var sResize = '';
		var sScroll = '';
		var sStatus = '';
		var sSize = '';
		var iHAvail = screen.availHeight;
		var iWAvail = screen.availWidth;
		
		if (riWidth == 0) iWidth = iWAvail;
		else iWidth = riWidth;
		
		if (riHeight == 0) iHeight = iHAvail - 52; //For some reason it is off by the title bar size.
		else iHeight = riHeight;
		
		if (document.all) {
			iLeft = (document.body.offsetWidth / 2) - (iWidth / 2) + self.screenLeft;
			iTop = (document.body.offsetHeight / 2) - (iHeight / 2) + self.screenTop;
		}
		else if (document.layers) {
			iLeft = (self.outerWidth / 2) - (iWidth / 2) + self.screenX;
			iTop = (self.outerHeight / 2) - (iHeight / 2) + self.screenY;
		}
		else {
			iLeft = (iWAvail / 2) - (iWidth / 2);
			iTop = (iHAvail / 2) - (iHeight / 2);
		}
		if (riWidth == 0) iLeft = 0;
		if (riHeight == 0) iTop = 0;
		
		sSize = 'width=' + iWidth + ',height=' + iHeight;
		sPosition = ',left=' + iLeft + ',top=' + iTop + ',screenX=' + iLeft + ',screenY=' + iTop
		
		if (rbStatus) sStatus = ',status';
		if (rbScrollbars) sScroll = ',scrollbars';
		if (rbResizable) sResize = ',resizable';
		
		return sSize + sPosition + sStatus + sScroll + sResize;
	}
	/********************************************************************************/
	function checkHour(riHour) 
	{
		return (riHour >= 24) ? riHour - 24 : riHour;
	}
	/********************************************************************************/
	function getOffsetTime(riGMTHour, riOffset) 
	{ 
		var iGMTHour = riGMTHour;
		return checkHour(((iGMTHour + (24 + riOffset)) > 24) ? ((iGMTHour + (24 + riOffset)) - 24) : (iGMTHour + (24 + riOffset)));
	}
	/********************************************************************************/
	function isZero(riValue) 
	{
		return ((riValue <= 9) ? ("0" + riValue) : riValue);
	}
	/********************************************************************************/
    function setTimeOld() 
    { 
        var oClock = document.forms[0];
        
        //No need to continue if this form doesn't exist.
        if (oClock) {
            var dtNow = new Date();
            var iBSWTime = 0;
			var iBSWOffset = 6;   //NOTE: Change 6 to 5 to get DST.
            var iZoneOffset = (dtNow.getTimezoneOffset() / 60);
            var iOffset = iZoneOffset - getDaylightSavings(iZoneOffset);
            var iGMTHour = (dtNow.getHours() + iOffset);
            var sMinutes = ":" + isZero(dtNow.getMinutes());
            
            //Local time for this computer
            if (oClock.localtime) oClock.localtime.value = isZero(dtNow.getHours()) + sMinutes;
            
            //Time at BioScience Writers
            iBSWTime = getOffsetTime(iGMTHour, -(iBSWOffset - getDaylightSavings(iBSWOffset)));
            if (oClock.bswtime) oClock.bswtime.value = isZero(iBSWTime) + sMinutes;
            
            setTimeout("setTime()", 1000);
        }
    }
	/********************************************************************************/
    function setTime() 
    { 
        var oClock = document.forms[0];
        
        //No need to continue if this form doesn't exist.
        if (oClock) {
            var dtNow = new Date();
            var iBSWTime = 0;
			var iBSWOffset = 6;
			var iZoneOffset = (dtNow.getTimezoneOffset() / 60);
            var iGMTHour = dtNow.getUTCHours();
            var sMinutes = ":" + isZero(dtNow.getMinutes());
            
            //Local time for this computer
            if (oClock.localtime) oClock.localtime.value = isZero(dtNow.getHours()) + sMinutes;
            
            //Time at BioScience Writers
            iBSWTime = getOffsetTime(iGMTHour, -(iBSWOffset - getDaylightSavings(iBSWOffset)));
            if (oClock.bswtime) oClock.bswtime.value = isZero(iBSWTime) + sMinutes;
            
            setTimeout("setTime()", 1000);
        }
    }
	/********************************************************************************/
	//WB; Determine if daylight savings time is in effect.
	function getDaylightSavings(riZoneOffset)
	{
		var oDate = new Date();
		var iYear = oDate.getYear();
		var iDayMar = getDayFromMonth(iYear, 2, 0, 2);
		var iDayNov = getDayFromMonth(iYear, 10, 0, 1);
		var iReturn = 0;
		
        //Determine if Daylight Savings Time even applies to this time zone.
        if (riZoneOffset > 3 && riZoneOffset < 10) {
			
			//Starting in 2007, daylight time begins in the United States on the second Sunday in March and ends on the first Sunday in November. 
			var oMarch = new Date(iYear, 2, iDayMar);       //Was: ,3,01); April, zero based month.  
			var oNovember = new Date(iYear, 10, iDayNov);   //Was: ,9,31); October
			
			if (oDate > oMarch && oDate < oNovember) iReturn = 1;
         }
		return iReturn;
	}
	/********************************************************************************/
	function getDaysInMonth(riMonth, riYear)
	{
		return 32 - new Date(riYear, riMonth, 32).getDate();
	}
	/********************************************************************************/
	function getDayFromMonth(riYear, riMonth, riDayOfWeek, riOccurance)
	{
		var oDate = new Date();
		var iCount = 0;
		var iDays = getDaysInMonth(riYear, riMonth);
		var iReturn = 0;
		
		for(var iCtr = 0; iCtr < iDays; iCtr++) {
			
			oDate = new Date(riYear, riMonth, iCtr);
			if (oDate.getDay() == riDayOfWeek) iCount++;
			
			if (iCount >= riOccurance) {
				iReturn = iCtr;
				break;
			}
		}
		return iReturn
	}
	/********************************************************************************/
	//WB; If this page is put in a frame, walk back up the chain to escape.
	function escapeFrames()
	{
		if (window.parent.frames.length > 0)
			window.parent.location = document.location;
	}
	/********************************************************************************/
	function noop() 
	{ 
	} 
	/********************************************************************************/
	function randomNumber(ri1, ri2) 
	{ 
	  if (null == ri1) ri1 = 2;
	  if (null == ri2) ri2 = 9;
	  if (ri2 > ri1) return (Math.round(Math.random() * (ri2-ri1)) + ri1); 
	  else return (Math.round(Math.random() * (ri1 - ri2)) + ri2); 
	} 
	/********************************************************************************/
	//WB; Display an email address in a web page on load so that bots can't read it.
	function sendTo(rsName, rsDomain, rsExtension, rsSubject, rsBody)
	{
		//Javascript:sendTo('name', 'domain', 'ext', 'subject', 'body');
		var sExt;
		var sSend;
		var sSendTo;
		
		if (rsExtension == '') sExt = 'com';
		else sExt = rsExtension;
		if ('' == rsName) sSendTo = 'mail' + 'to' + ':';
		else sSendTo = 'mail' + 'to' + ':' + rsName + '@' + rsDomain + '.' + sExt;
		
		if (null == rsSubject) rsSubject = '';
		if (null == rsBody) rsBody = '';
		
		if ('' != rsSubject && '' != rsBody) {
			sSend = sSendTo + '?subject=' + escape(rsSubject) + '&amp;body=' + escape(rsBody);
		}
		else if ('' != rsSubject) {
			sSend = sSendTo + '?subject=' + escape(rsSubject);
		}
		else if ('' != rsBody) {
			sSend = sSendTo + '?body=' + escape(rsBody);
		}
		else {
			sSend = sSendTo;
		}
		
		window.location = sSend;
		//return true;  DO NOT RETURN TRUE!
	}
	/********************************************************************************/
	//WINDOW FUNCTIONS
	/********************************************************************************/
	//WB; Show the daily editoing tips popup screen.
	function ShowDailyTips(rsPath)
	{
		var oWin = window.open(rsPath + "TipOfTheDay.asp", "", centerWindow(430, 302, false, false, false));
	}
	/********************************************************************************/
	//WB; Show a date selection calendar.
	function openCalendarWndow(rsCaption, rsField, rDate)
	{
		var oWin = window.open("", "calendar", centerWindow(200, 260, false, false, false));
		oWin.location.href = "../pagesasp/Calendar.asp?caption=" + escape(rsCaption) + "&field=" + rsField + "&date=" + rDate;
		oWin = null;
	}
	/********************************************************************************/
	//WB; Show a centered over the current window.
	function openChildWndow(rsURL, rsCaption, rlWidth, rlHeight)
	{
		var sParams = centerWindow(rlWidth, rlHeight, false, false, false, true) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
		var oWin = window.open(rsURL, rsCaption, sParams);
	}
	/********************************************************************************/
	//Open a new html report with a toolbar in the center of the screen area.
    function openPopUpHelp(rsType)
    {
		var sParams;
		var sURL;
		
		switch (rsType) {
			case 'AUTH_CODE':
				sParams = centerWindow(400, 350) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
				sURL = '../help/AuthCodes.asp';
				break;
			case 'PROMO_CODE':
				sParams = centerWindow(400, 350) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
				sURL = '../help/PromoCodes.asp';
				break;
			case 'TRANS_ID':
				sParams = centerWindow(400, 350) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
				sURL = '../help/TransID.asp';
				break;
		}
		//Always reuse the help window.
		var oWin = window.open(sURL, 'Help', sParams);
		if (oWin) {
			if (!oWin.closed) oWin.focus();
		}
    }
	/********************************************************************************/
	//Open a new window with a toolbar in the center of the screen area.
    function openPopUpWindow(rsURL, rsWindowName, rlWidth, rlHeight, rbToolBar, rbReuseWindow, rbScrollbar)
    {
		var lWidth = (null == rlWidth)? 800 : rlWidth;
		var lHeight = (null == rlHeight)? 600 : rlHeight;
		var sParams;
		if (null == rbReuseWindow) rbReuseWindow = false;
		if (null == rbScrollbar) rbScrollbar = false;
		
		if (rbToolBar) {
			if (rbScrollbar) {
		        sParams = centerWindow(lWidth, lHeight) + ',toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=no';
			}
		    else sParams = centerWindow(lWidth, lHeight) + ',toolbar=yes,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
		}
		else {
			if (rbScrollbar) {
				sParams = centerWindow(lWidth, lHeight) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no';
			}
			else sParams = centerWindow(lWidth, lHeight) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no';
		}
		if (!rbReuseWindow) {
			rsWindowName += randomNumber().toString();
		}
		//NOTE: The Window Name cannot have spaces.
		goWin = window.open(rsURL, rsWindowName, sParams);
		if (goWin) {
			if (!goWin.closed) goWin.focus();
		}
    }
	/********************************************************************************/
	//Open a new html report with a toolbar in the center of the screen area.
    function openPopUpReport(rsURL, rsWindowName, rlWidth, rlHeight, rbToolBar)
    {
		var lWidth = (null == rlWidth)? 800 : rlWidth;
		var lHeight = (null == rlHeight)? 600 : rlHeight;
		var sParams;
		
		if (rbToolBar) {
		        sParams = centerWindow(lWidth, lHeight) + ',toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=no';
		}
		else sParams = centerWindow(lWidth, lHeight) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no';
		
		//Never reuse a report window.
		rsWindowName += randomNumber().toString();
		//NOTE: The Window Name cannot have spaces.
		var oWin = window.open(rsURL, rsWindowName, sParams);
		if (oWin) {
			if (!oWin.closed) oWin.focus();
		}
    }
	/********************************************************************************/
	//WB; Show a pdf report window.
	function openPopUpReportPDF(rsURL, rbToolBar)
	{
		var lWidth = 800;
		var lHeight = 600;
		var sParams;
		var sWindowName;
		
		if (rbToolBar) {
		        sParams = centerWindow(lWidth, lHeight) + ',toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
		}
		else sParams = centerWindow(lWidth, lHeight) + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
		
		//Never reuse a report window.
		sWindowName += randomNumber().toString();
		//NOTE: The Window Name cannot have spaces.
		var oWin = window.open(rsURL, sWindowName, sParams);
		if (oWin) {
			if (!oWin.closed) oWin.focus();
		}
	}
	// end hiding contents -->

