/* jsmenu.js
for Beginning Experience of Winnipeg
Author: Jim Furtado
Date: Febuary 5, 2006 */

/* hide errors script  */
function blockError(){return true;}
window.onerror = blockError;

<!--
/* right click script   */
function click() { if (event.button==2)
    {
      alert('Thanks for visiting, Come Back again!\n\nThe Beginning Experience of Winnipeg\n\n\tCopyright 2006')
    }
}
    document.onmousedown=click
  //----->


<!--
 function doClear(theText)
{
     if (theText.value == theText.defaultValue)
 {
         theText.value = ""
     }
 }
 //-->

/* Stock Ticker in the Navbar Script  */
<!-- Hide script from old browsers Stock ticker in the Navbar
Speed = 200;  // milliseconds between scrolls
CharNum = 1;  // number of chars scrolled per time period

function doTicker() {  
text = "  Welcome to Beginning Experience Web Site..........Our Vision of Beginning Experience is that people who have experienced divorce, separation, or the death of a spouse or parent will work through their grief, be healed, transformed and free again to love themselves, others, and God ....for a lifetime of change....  ";  
Scroll();
}
function Scroll() {  
window.setTimeout('Scroll()',Speed);  
window.status = text;  
text = text.substring(CharNum) + text.substring(0,CharNum);
}
doTicker();
//-->

/* Popup Script  */
<!-- Hide script from old browsers New Windows Popups

	//MM_FlashCanPlay is a global variable for this page
	var MM_FlashCanPlay = flashDetect();
	var macClient = macDetect(MM_FlashCanPlay);
	
	function doPassVar(){
		//this function is for preloading of flash movie
		if (macClient != true){
	   		window.document.promoMovieItem.SetVariable("preLoadReady", "play");
		}
	}

/*	function openPopup(url) {
 		 popupWin = window.open(url, 'hoaxWindow', 'width=460,height=600,left=20,top=20,toolbar=no, menu=no, scrollbar=no,');
	}

*/

//-->

	function openPopup(url) {
 		 popupWin = window.open(url, 'hoaxWindow', 'width=460,left=0,top=0,toolbar=no, menu=no, scrollbar=no');
	}



/* calendar script  */
function BE_Calendar_setFebDays()
{
  if ( this.month == 1 ) 
  {
    if ( this.year % 4 == 0 )
    {
      if ( this.year % 100 == 0)
      {
        if ( this.year % 400 == 0) 
          this.m_rgDays[1] = 29;
      }
      else
        this.m_rgDays[1] = 29;
    }
  }
}

function BE_Calendar_Display()
{
	document.writeln("<h3><center><a title=\"Last Month\'s Events\" href='previous-month.php'><<<=</a> <a title=\"This Month\'s Events\" href='calendar123pw.php'> Events Calendar - " + this.title + "</a> <a title=\"Next Month\'s Events\" href='next-month.php'> =>>></a></center></h3>");
	document.writeln("<table class='ex' border=\"0\" cellpadding=\"3\" cellspacing=\"1\" bordercolor=\"#993399\" bordercolordark=\"#993399\" bordercolorlight=\"#993399\">");
	document.writeln("<tr>");
	document.writeln("<td background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Sunday</strong></font></td>");
	document.writeln("<td background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Monday</strong></font></td>");
	document.writeln("<td background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Tuesday</strong></font></td>");
	document.writeln("<td  background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Wednesday</strong></font></td>");
	document.writeln("<td background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Thursday</strong></font></td>");
	document.writeln("<td background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Friday</strong></font></td>");
	document.writeln("<td background=\"images/top2a.gif\" align=\"center\" width=\"10%\" bgcolor=\"#000\"><font color=\"#FFFFFF\" face=\"" + this.font + "\" size=\"" + this.headSize + "\"><strong>Saturday</strong></font></td>");
	document.writeln("</tr>");
	
	// now create each row
	for (j = 0; j < 6; j++)
	{
		x = 0;
		document.writeln("<tr>");
		for( i = 0; i < 7; i++)
		{
			if ( this.m_myDate.getDay() > (i + x) || 
					 this.m_myDate.getMonth() != this.month - 1 )
				document.writeln("<td width=\"10%\" bgcolor=\"#" + this.m_strDead + "\">&nbsp;</td>");
			else
			{
				if (this.m_myDate.getDate() < this.m_now.getDate() && 
				    this.m_myDate.getMonth() <= this.m_now.getMonth() )
	
					document.writeln("<td valign=\"top\" width=\"10%\" bgcolor=\"#" + this.m_strPast + "\"><b>" + 
						"<font face=\"" + this.font + "\" size=\"" + this.fontSize + "\">" + 
						this.m_myDate.getDate() + "</b><br>" + 
						this.getText( this.m_myDate.getDate()) + 
						"</font></td>");
	
				else if (this.m_myDate.getDate() == this.m_now.getDate() &&
				         this.m_myDate.getMonth() == this.m_now.getMonth() )
	
					document.writeln("<td valign=\"top\" width=\"10%\" bgcolor=\"#" + this.m_strNow + "\"><b>" + 
						"<font face=\"" + this.font + "\" size=\"" + this.fontSize + "\">" + 
						this.m_myDate.getDate() + "</b><br>" + 
						this.getText( this.m_myDate.getDate()) + 
						"</font></td>");
	
				else
	
					document.writeln("<td valign=\"top\" width=\"10%\" bgcolor=\"#" + this.m_strFutr + "\"><b>" + 
						"<font face=\"" + this.font + "\" size=\"" + this.fontSize + "\">" + 
						this.m_myDate.getDate() + "</b><br>" + 
						this.getText( this.m_myDate.getDate()) + 
						"</font></td>");
	
				this.m_myDate.setDate( this.m_myDate.getDate() + 1 ); 
      }				

    }
    document.writeln("</tr>");
    x += 7;
  }
  document.writeln("</table>");

}

function BE_Calendar_setItem( nDay, strText )
{
  x = this.m_rgDay.length;
  this.m_rgDay[x + 1] = nDay;
	this.m_rgTxt[x + 1] = strText;
}

function BE_Calendar_getText( n )
{
  var x = 0;
	while( x < this.m_rgDay.length ) 
	{
		if ( n == this.m_rgDay[x] ) 
			return this.m_rgTxt[x] ;

		x++;
	}
  return "";
}

function BE_Calendar( m, y )
{
	// properties
	this.m_rgDay = new Array();
	this.m_rgTxt = new Array();

	// Static stuff

	// Colors
	this.m_strDead = "c0c0c0";
  this.m_strPast = "99cc99";
  this.m_strFutr = "00cc99";
  this.m_strNow  = "669999";

	this.m_rgDays = new Array( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); 
	this.m_rgMths = new Array( "January", "February", "March", "April", "May", "June", "July", "August",  "September", "October", "November", "December" );

	this.font = "Helvetica, Verdana, Arial,";
  this.fontSize  = "1";
  this.headSize  = "1";

  this.month = m;
  this.year  = y;
	this.m_now = new Date(); 
	this.m_myDate  = new Date(y, m - 1, 1);

	this.monthName = this.m_rgMths[ this.m_myDate.getMonth() ];
  this.title = this.monthName + " " + this.year;

	// Methods
	this.setFebDays = BE_Calendar_setFebDays;
	this.display = BE_Calendar_Display;
	this.setItem = BE_Calendar_setItem;
	this.getText = BE_Calendar_getText;

  this.setFebDays();
}

/* login script  */

<!--- Hide from old browsers
 function Getstats() {
  window.status=('Attempting to Login to user area.')
  
  var AccId;
  var iName;
  AccId = document.iAccInput.iAccID.value
  iName = document.iAccInput.iName.value
		 
     if (AccId == "" || iName == "")
	{ 
         alert('\nERROR\n\n\nYou must enter ALL Details,\nto View your statistics.\n');
         window.status=('Missing data or Invalid.  Check spelling and Ensure Names are in Correct Case.')
	} 
    else
	{
         
	 var location=("calendar" + iName + AccId + ".php");
         this.location.href = location;
window.status=('   Verifying:  ' + iName + '-' + AccId + '  Please wait........');
	}
	}
// end hiding -->

<!--- Hide from old browsers
     function Verifyacc2() {
       window.status=('Please enter your Username and Account ID...');
        var oName = prompt("Enter your User Name: \n(Case Sensitive)\n", "")
         window.status=('   UserName = ' + oName);  
        var oAccID = prompt("Enter your account ID: \n(Case Sensitive)\n", "")
          window.status=('   Account ID = ' + oAccID); 
           if (oAccID == "" || oName == "" || oAccID == "null" || oName == "null") 
                {
                 alert('\nERROR\n\nYou must enter ALL Details,\nto view your calendar.');
                 window.status=('Missing data or Invalid.  Check spelling and Ensure Names are in Correct Case.'); 
		}
	   else	{
                 window.status=('   Verifying:  ' + oName + '-' + oAccID + ' Please wait........');
		 var location=("pw" + oName + oAccID + ".php");
                 this.location.href = location;
		}
                           }

// end hiding -->
