/*******************************************************************************
Script code for the entire site
*******************************************************************************/
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

//----------------------------------------------------------------

function ScrollAnncement(){


/***********************************************
* IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//specify path to your external page:
var iframesrc="../announcements.htm"

//You may change most attributes of iframe tag below, such as width and height:
document.write('<iframe id="datamain" src="'+iframesrc+'" width="185px" height="180px" padding="3px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')

}

//----------------------------------------------------------------
function PlayMusic(){

var ver = navigator.appName;
					
	if (ver == "Microsoft Internet Explorer") {
		document.write('<bgsound src="../44815303.mpga" repeat=false AUTOSTART=true hidden=true>');
	} else {
		document.write('<embed src="../44815303.mpga" AUTOSTART=true hidden=true loop=false></EMBED>');
	}
}

//----------------------------------------------------------------
function PopUp(url) {
	var thewindow=window.open(url, "", "height=450,width=600,resizable=yes,scrollbars=yes")
 	thewindow.moveTo(screen.width/2-200,screen.height/2-90)
	thewindow.focus()
}
//----------------------------------------------------------------
function PopUp_wider(url) {
	var thewindow=window.open(url, "", "height=500,width=600,resizable=yes,scrollbars=yes")
 	thewindow.moveTo(screen.width/2-200,screen.height/2-90)
	thewindow.focus()
}
//----------------------------------------------------------------
function OpenCalendar(url) {
var thewindow=window.open(url, "", "height=600,width=700,menubar=no,scrollbars=yes,titlebar=no,resizable=yes,status=yes,location=no,toolbar=no")
 	thewindow.moveTo(screen.width/2-200,screen.height/2-90)
	thewindow.focus()
}

//----------------------------------------------------------------
function GoTo(url) {
window.opener.location=url
window.close();
}

//----------------------------------------------------------------
function Download() {


var agree=confirm ('You must submit a registration form.\n Do you wish to download a copy?');

if (agree){

//Download file

window.opener.location="../registration.rtf";
window.close();}

}
//----------------------------------------------------------------

function GoBack(){

window.opener.location="workshop_info.html"
window.close();

}

//----------------------------------------------------------------

function Ask(){

var agree=confirm ('Do you wish to see the Ad \nfor our Music Workshop/Concert?');

if (agree){

//Download file

window.location="music_workshop.html";
}
else window.close();
}
//----------------------------------------------------------------
//-- This is the function that's retrieves and writes file date.
function WriteDate(){

var smonths = new Array(13);
smonths[1] = "January";
smonths[2] = "February";
smonths[3] = "March";
smonths[4] = "April";
smonths[5] = "May";
smonths[6] = "June";
smonths[7] = "July";
smonths[8] = "August";
smonths[9] = "September";
smonths[10] = "October";
smonths[11] = "November";
smonths[12] = "December";

var dateObj = new Date(document.lastModified)
var syear = dateObj.getYear()
var smonth = smonths[dateObj.getMonth() + 1]
var date = dateObj.getDate()

 document.writeln(smonth+')');
//document.writeln('<font size=2 color=white>This page updated on ' + smonth + ' ' + date+' , ' + syear+ '</font>');
}
//----------------------------------------------------------------
function LastestDate(){

var smonths = new Array(13);
smonths[1] = "January";
smonths[2] = "February";
smonths[3] = "March";
smonths[4] = "April";
smonths[5] = "May";
smonths[6] = "June";
smonths[7] = "July";
smonths[8] = "August";
smonths[9] = "September";
smonths[10] = "October";
smonths[11] = "November";
smonths[12] = "December";

var dateObj = new Date()
var syear = dateObj.getYear()
var smonth = smonths[dateObj.getMonth() + 1]
var date = dateObj.getDate()

document.writeln(smonth + ' ' + date+', ' + syear);

}

//------------------------------------------------------------------------------
function CopyRightDate(){

/* Writes copyright information */

var smonths = new Array(13);
smonths[1] = "January";
smonths[2] = "February";
smonths[3] = "March";
smonths[4] = "April";
smonths[5] = "May";
smonths[6] = "June";
smonths[7] = "July";
smonths[8] = "August";
smonths[9] = "September";
smonths[10] = "October";
smonths[11] = "November";
smonths[12] = "December";

var dateObj = new Date()
var ver = navigator.appName;
					
	if (ver == "Microsoft Internet Explorer") {
		var syear = dateObj.getFullYear();
	}
	
	else{
		var syear = dateObj.getFullYear();
	}

document.writeln(syear + ' Mount Calvary Baptist Church.');
}

//------------------------------------------------------------------------------
function CalendarMonthYear(){

var smonths = new Array(13);
smonths[1] = "January";
smonths[2] = "February";
smonths[3] = "March";
smonths[4] = "April";
smonths[5] = "May";
smonths[6] = "June";
smonths[7] = "July";
smonths[8] = "August";
smonths[9] = "September";
smonths[10] = "October";
smonths[11] = "November";
smonths[12] = "December";

var dateObj = new Date()
var syear = dateObj.getYear()
var smonth = smonths[dateObj.getMonth() + 1]
var date = dateObj.getDate()

document.writeln(smonth+ ' ' + syear);
}
//---------------------------------------------------------------------------------
function RegistrationDate(){

var smonths = new Array(13);
smonths[1] = "January";
smonths[2] = "February";
smonths[3] = "March";
smonths[4] = "April";
smonths[5] = "May";
smonths[6] = "June";
smonths[7] = "July";
smonths[8] = "August";
smonths[9] = "September";
smonths[10] = "October";
smonths[11] = "November";
smonths[12] = "December";

var dateObj = new Date()
var syear = dateObj.getYear()
var smonth = smonths[dateObj.getMonth() + 1]
var date = dateObj.getDate()

 document.vbs_reg.REGISTRATION_DATE.value=date + '-' + smonth + '-'+ syear;
}

//---------------------------------------------------------------------------------

function SetFocus(){

document.sms.area.focus();

//if (document.vbs_reg.REGISTRATION_DATE.value == "")
//	{RegistrationDate();}
}

//---------------------------------------------------------------------------------

function Validate(){

	if (isEmpty("FIRST_NAME")){
		alert("PLEASE PROVIDE A FIRST NAME");
		setFrmFocus("FIRST_NAME");
		return false;
	}
	
	if (isEmpty("LAST_NAME")){
		alert("PLEASE PROVIDE A LAST NAME");
		setFrmFocus("LAST_NAME");
		return false;
	}
	

	if (isEmpty("PHONE") || !ValidPhoneNumber("PHONE")){
		alert("PLEASE PROVIDE A VALID PHONE NUMBER");
		setFrmFocus("PHONE");
		return false;
	}

	if (isEmpty("EMAIL_ADDRESS") || !IsValidEmail("EMAIL_ADDRESS")){
		alert("PLEASE PROVIDE A VALID EMAIL ADDRESS");
		setFrmFocus("EMAIL_ADDRESS");
		return false;
	}

	if (isEmpty("NUMBER_OF_BOOKS")){
		var answer=confirm("DO YOU DESIRE TO PURCHASE A VBS BOOK AND/OR VBS APPAREL?");
		if (answer){	//YES				
			setFrmFocus("NUMBER_OF_BOOKS");
			return false;
		}
	}

	document.vbs_reg.btnSubmit.disabled=true;
	return true;
			
}
//---------------------------------------------------------------------------------
function setFrmFocus(aField) {
document.forms[0][aField].focus();
}

//---------------------------------------------------------------------------------
function IsValidEmail(aTextField){

var strValue = document.forms[0][aTextField].value;
var objRegExp  = /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;
	
  //check for valid email
  return objRegExp.test(strValue);
}
//---------------------------------------------------------------------------------

function isEmpty(aTextField) {
if ((document.forms[0][aTextField].value.length==0) ||
 (document.forms[0][aTextField].value==null)) {
return true;
}
else { return false; }
}
//---------------------------------------------------------------------------------

function ValidPhoneNumber(aTextField){	

var strValue = document.forms[0][aTextField].value;
var objRegExp  = /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/;
 
  //check for valid us phone with or without space between 
  //area code
  return objRegExp.test(strValue); 
}
//---------------------------------------------------------------------------------

function IsValidNumber(input){

var objRegExp  = /^\d/;
 
  //check for valid us phone with or without space between 
  //area code
  return objRegExp.test(input);
}
//---------------------------------------------------------------------------------
function Calculate (input,price, output){

	if (document.forms[0][input].value.length > 0)		//check to ensure calculates include actual values and not empty strings
	{
		if (IsValidNumber(document.forms[0][input].value)!= false)	//check to ensure number is entered in field
		{
		document.forms[0][input].className='validField'
			var quantity = eval("document.vbs_reg." + input + ".value;");
			var total;

	
			eval("total = quantity * price;");
			eval("document.vbs_reg." + output + ".value=Currency(total)");
		}
		else{
			alert("Please enter a valid number in field.");
			document.forms[0][input].focus();
			document.forms[0][input].className='currentField';
			
		}
	}

}

//---------------------------------------------------------------------------------
function Currency(anynum) {
        //returns number as string in $xxx,xxx.xx format.
        anynum = "" + eval(anynum);  //evaluate (in case an expression sent)
        intnum = parseInt(anynum);  //isolate integer portion
        intnum = Math.abs(intnum);
        intstr = ""+intnum;
        //add comma in thousands place.
        if (intnum >= 1000) {
                intlen = intstr.length;
                temp1=parseInt(""+(intnum/1000));
                temp2=intstr.substring(intlen-3,intlen);
                intstr = temp1+","+temp2;

        }
        if (intnum >= 1000000) {
                intlen = intstr.length;
                temp1=parseInt(""+(intnum/1000000));
                temp2=intstr.substring(intlen-7,intlen);
                intstr = temp1+","+temp2;

        }

        decnum = Math.abs(parseFloat(anynum)-parseInt(anynum)); //isolate decimal portion
        decnum = decnum * 100; // multiply decimal portion by 100.
        decstr = "" + Math.abs(Math.round(decnum));
        if (decstr.length>2) {decstr=decstr.substring(0,2);}
        while (decstr.length < 2) {decstr="0"+decstr;}
        retval = intstr + "." + decstr ;
        if (anynum < 0) {
                retval="("+retval+")";
        }
        return "$"+retval
}

//---------------------------------------------------------------------------------

function GrandTotal(sub_total_field){


//This function computes the grand total

var total;
var sub_total = eval("document.vbs_reg." + sub_total_field + ".value;");
var temp_grand_total = eval("document.vbs_reg.GRAND_TOTAL.value;");

//parse string; remove dollar sing($)
sub_total = eval("sub_total.substring(1, sub_total.length);");
temp_grand_total = eval("temp_grand_total.substring(1, temp_grand_total.length);");

//Calculate total
total = Number(sub_total) + Number(temp_grand_total);
eval("document.vbs_reg.GRAND_TOTAL.value=Currency(total);");
}


//---------------------------------------------------------------------------------

function Maximize_Window(){

top.window.moveTo(0,0);

if (document.all) {
	top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
	if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
		top.window.outerHeight = screen.availHeight;
		top.window.outerWidth = screen.availWidth;
	}
}
}

//----------------------------------------------------------------------------------------------

function ShowContent(text){


	if (text=='christ_ed'){
		document.all.testing.innerHTML = "<font class='times'>Christian Education Conference 2007</font> " +
				"<BR>Theme: <font class='scripture'>Experiencing God - A Legacy fo Life Change</font></BR>" +
				"<P><table border=0 cellpadding=3 cellspacing=0><tr><td valign=top>Focus:</td> <td>How we can seek God's direction for our lives and gain more in our experiences with Him</td></tr>" +
				"<tr><td valign=top>Dates:</td><td><font class=stress> February 2<sup>nd</sup> (Worship Service @ 7:00 PM)</font> <BR> <font class=stress>February 3<sup>nd</sup> (Classes from 9:00 AM to 12:30 PM)</font></BR></td></tr>" +
				"<tr><td valign=top>Price:</td><td> <font class=stress>FREE</font></td></tr></table></P>" +
				"<P>Interested individuals are asked to complete a <a href='christian_education/conf_registration.doc'>registration form</a>.</P>";



	}//end of if

} //end of function


//----------------------------------------------------------------------------------------------

function MinContent(text){

/* Writes ministry information ministry page */

	if (text== 'amin'){
		document.getElementById("descr").innerHTML = "Assists the Pastor in developing and maintaining the spiritual life of all members of the church. Members include: <br/>" +	
			"<div id=\'minis\'> " +
			"<UL>" +
			"<LI>Reverend Donald Briggs</LI>" +
			"<LI>Minister Angela Brown</LI>" +
			"<LI>Reverend Jerome Gipson</LI>" +
			"<LI>Reverend Daniell Griffin</LI>" +
			"<LI>Reverend Dr. Lucille Jackson</LI>" +
			"<LI>Minister Brenda Jenkins</LI>" +
			"<LI>Minister Demeka McCleave</LI>" +
			"<LI>Minister Rosa McReynolds </LI>" +	
			"<LI>Minister Nathan Stokes</LI>" +
			"<LI>Minister Rose Stokes</LI>" +
			"<LI>Minister Florence Wilkins</LI>" +
			"<LI>Minister Ellen Williams</LI>" +							
			"</UL></div>";
	}//end of if

	if (text == 'ced'){
		document.getElementById("descr").innerHTML =('Has the responsibility to assist the Body of Christ to know and understand the Word of God. <br/><br/>Director: <br/><font class=times>Minister Daniell Griffin</font>')
	} //end of if
	
	if (text == 'mcm'){
		document.getElementById("descr").innerHTML =('Seeks to provide biblical based principles, Christian instruction, and Christian fellowship opportunities where the covenant union between a man and a woman (marriage) ' +
		         'can be nurtured and supported. <br/><br/>Director: <br/><font class=times>Deaconess Janice Lundy</font>')
	} //end of if
	
	if (text == 'sun'){
		document.getElementById("descr").innerHTML =('Spreads cheer and promotes God\'s love by providing altar flowers and floral needs and cards to members of the church as the need arises. <br/><br/>Director: <br/><font class=times>Mildred Cox</font>')
	} //end of if

	if (text=='ss'){
		document.getElementById("descr").innerHTML =("Teaches the Word of God from <b>9:30 AM until 10:45 AM</b> every Sunday morning, through open Bible study that engages people of all ages in evangelism, " +
				"discipleship, ministry, fellowship and worship.<br/><br/> Superintendent: <br/><font class=times>Pearl McFadden</font><br/><br/>" +
				"Asst. Superintendent: <br><font class=times>Deacon Janice Lundy</font></br>");
	}//end of if
	
	if (text=='tech'){
		document.getElementById("descr").innerHTML =("Provides church web site administration and computer related support.");
	}//end of if

	
	if (text=='deacon'){
		document.getElementById("descr").innerHTML =("Assists the pastor in the direction of the total program of the Mount Calvary Baptist Church and " +
						"with the pastor, considers all applications and all request for letters of transfer and church membership.</BR> " +
						"<BR>Also, assists with the observance and preparation of the ordinances of the church.<BR/> " +
						"<br/><br/> Chairman: <br><font class=\'times\'>Deacon Larry Lundy</font></br>" );
	}//end of if

	if (text=='deaconess'){
		document.getElementById("descr").innerHTML =("Assists the Pastor in developing the spiritual life of the women and girls of the Mount Calvary Baptist Church." +
						"<br/><br/> Chairperson: <br><font class=times>Deaconess Sallie Hill</font></br>" );
	}//end of if

	if (text=='trust'){
		document.getElementById("descr").innerHTML =("Protects, manages, and cares for the Mount Calvary Baptist Church." +
						"<br/><br/> Chairperson: <br><font class=times>Trustee Eldora Womack</font></br>" );
	}//end of if

	if (text=='admin'){
		document.getElementById("descr").innerHTML =("Oversees the administrative duties of the Mount Calvary Baptist Church." +
						"<br/><br/> Office Manager: <br><font class=times>Robin Whitmire</font><br/> <br/>Church Secretary: <br/><font class=times>Kimberly Griffin</font><br/> <br/>" +
						"Church Clerk: <br/><font class=times>Trustee Delores Banks</font><br/> <br/> Pastor\'s Secretary: <br/><font class=times>Sharon Pitts</font>" );
	}//end of if

	if (text=='evangel'){
		document.getElementById("descr").innerHTML =("Helps spread the Good News about our Savior, Jesus Christ." +
						"<br/><br/> Director: <br/><font class=times>Christal Fulton</font>" );
	}//end of if

	if (text=='mission'){
		document.getElementById("descr").innerHTML =("Helps teach the Gospel and helps the less fortunate." +
						"<br/><br/> President: <br/><font class=times>Minister Rosa McReynolds</font>" );
	}//end of if

	if (text=='counm'){
		document.getElementById("descr").innerHTML =("Provides christian-based counseling to individuals who seek counseling.");
	}//end of if

	if (text=='finance'){
		document.getElementById("descr").innerHTML =("Oversees the financial well-being of the Mount Calvary Baptist Church. " +
						"<br/><br/> Chairperson: <br/><font class=times>Robin Whitmire</font>" );
	}//end of if

	if (text=='music'){
		document.getElementById("descr").innerHTML =("Mount Calvary Baptist Church is blessed with many talented people who minister to us through song and music." +
						"<br/><br/> Director: <font class=times>Pam Boyd</font><br/>" +
						"<UL> " +
						"<LI><font class=stress>Voices of Calvary</font> - ministers on the 1<sup>st</sup> Sunday. <P/></li> " +
						"<li><font class=stress>Senior Choir</font> - ministers on the 2<sup>nd</sup> Sunday. <P/></li> " +
						"<li><font class=stress>Youth Ensemble</font> - ministers on the 3<sup>rd</sup> Sunday. <P/></li> " +
						"<li><font class=stress>Male Chorus </font>- ministers on the 4<sup>th</sup> Sunday. <P/></li> " +
						"<li><font class=stress>Anointed Praise</font> (Ages 18-35) - ministers on the 5<sup>th</sup> Sunday.<P/></li>" +
						"<li><font class=stress>Mass Choir</font> - ministers at special services.</li></UL>"
						);
	}//end of if


	if (text=='review'){
		document.getElementById("descr").innerHTML =("Reviews activities and functions of the Mount Calvary Baptist Church. " +
						"<br/><br/> Click <a href='christian_education/activity_appplication_generic.doc'>here</a> to obtain activity form." );
	}//end of if
	

	if (text=='outreach'){
		document.getElementById("descr").innerHTML =("Responsible for ministering to others outside of the Mount Calvary Baptist Church."  +
				"<br/>&nbsp;<br/> Chairman: <br><font class=times>Deacon Alton Jackson</font>");
	}//end of if

	if (text=='men'){
		document.getElementById("descr").innerHTML =("Helps serve the spiritual and social needs of the men of the Mount Calvary Baptist Church. " +
		"<br/><br/> President: <br/><font class=times>Minister Jerome Gipson</font> <br/> <br/>" );
	}//end of if

	if (text=='media'){
		document.getElementById("descr").innerHTML =("Responsible for operating all audio/video equipment at the Mount Calvary Baptist Church. " +
		"<br/><br/> Director: <br/><font class=times>Trustee Wade Cleveland</font>" );
	}//end of if

	if (text=='usher'){
		document.getElementById("descr").innerHTML =("Acts as doorkeepers, serving the body of Christ during all church services. " +
		"<br/><br/> " +
				 "Senior Usher President <br/><font class=times>Denise Baine</font><BR/> <br/>" +
				 "Junior Usher President: <BR/><font class=times>Shamar Price</font>");
	}//end of if

	if (text=='dance'){
		document.getElementById("descr").innerHTML =("Gives praise and honor to God through dance. " +
		"<br/><br/> Director: <br/><font class=times>Lisa Gibson</font>" );
	}//end of if

	if (text=='youth'){
		document.getElementById("descr").innerHTML =("Serves the spiritual, social, and educational needs of the children and teenagers of the Mount Calvary Baptist Church. " +
		"<br/><br/> Director: <br/><font class=times>Marsha Gipson</font>");
	}//end of if

	if (text=='pace'){
		document.getElementById("descr").innerHTML =("<font class=stress>P</font> is for Pray <BR/><font class=stress>A</font> is for Available<br/> <font class=stress>C</font> is for Making Contact <BR/><font class=stress>E</font> is for being an Example<BR/> " +
					"<BR/>Responsible for maintaining contact with " +
					"Mount Calvary members on a monthy basis. This ministry also serves as the first point of contact if there is anything that is going " +
					"on that needs to be addressed, including family problems, personal problems, church problems. The members of this ministry are there to " +
					"assist the members of Mount Calvary in any way, shape, or form." +
					"<br/><br/> Director: <br/><font class=times>Minister Jerome Gipson</font>" );
	}//end of if

	if (text=='woe'){
		document.getElementById("descr").innerHTML =("Helps serve the spiritual and social needs of the women of the Mount Calvary Baptist Church." +
		"<br/><br/>" +
				 "Director: <BR/><font class=times>Reverend Dr. Lucille Jackson</font><BR/> <br/>" );
	}//end of if

	if (text=='panni'){
		document.getElementById("descr").innerHTML =("Responsible for the planning and implementation of the pastor's anniversary. " +
		"<br/><br/> Chairperson <br/><font class=times>Deaconess Sallie Hill</font>" );
	}//end of if

	if (text=='canni'){
		document.getElementById("descr").innerHTML =("Responsible for the planning and implementation of the church's anniversary. " +
		"<br/><br/> Chairperson: <br/><font class=times>Denise Robinson</font>" );
	}//end of if

	if (text=='family'){
		document.getElementById("descr").innerHTML =("Sponsors programs and classes for families of the Mount Calvary Baptist Church." +
		"<br/><br/> Chairperson: <br/><font class=times>Deaconess Betty Kelly</font>" );
	}//end of if

	
	if (text=='food'){
		document.getElementById("descr").innerHTML =("Responsible for the culinary needs of the church during special church services and functions. " +
		"<br/><br/> Chairperson: <br/><font class=times>Deaconess Dorothy Williams</font>" );
	}//end of if

	if (text=='armor'){
		document.getElementById("descr").innerHTML =("Ensures the pastor has the necessary supplies and amenities needed to perform his duties." +
		"<br/><br/> President: <br/><font class=times>Viola Legree</font>" );
	}//end of if
	
	if (text=='drama'){
		document.getElementById("descr").innerHTML =("Performs bibilical skits." +
		"<br/><br/> Chairperson: <br/><font class=times>Minister Brenda Jenkins</font>" );
	}//end of if

} //end of function

//-------------------------------------------------------------------------------------------------------------

function GetCss(){

/* Get browser type and display corresponding stylesheet */

var browser_type=navigator.appName

var headID = document.getElementsByTagName("head")[0];
var cssNode = document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';

if (browser_type == "Microsoft Internet Explorer"){
cssNode.href = 'css/all.css';
}

if (browser_type =="Netscape") {
cssNode.href = 'css/all_foxfire.css';
}

cssNode.media = 'screen';
headID.appendChild(cssNode);

//setTimeout("StatusBarMsg()",0000); //set timer before 2nd script executes


}

//-------------------------------------------------------------------------------------------------------------
function textCounter(maxlimit) {

/* Counts the number of characters entered by user on contact us form */

var browser_type=navigator.appName;	//determine browser

	if (browser_type == "Microsoft Internet Explorer")
	{

		if (document.all.msg.value.length > maxlimit) // if too long...trim it!
		{	
			document.all.msg.value = document.all.msg.value.substring(0, maxlimit);
		}
	
		// otherwise, update 'characters left' counter
		else {
			document.all.remLen.value = maxlimit - document.all.msg.value.length;
		}
	}
	
	if (browser_type =="Netscape") 
	{
		if (document.getElementById("msg").value.length > maxlimit) // if too long...trim it!
				{	
					document.getElementById("msg").value = document.getElementById("msg").value.substring(0, maxlimit);
				}
			
				// otherwise, update 'characters left' counter
				else {
					document.getElementById("remLen").value = maxlimit - document.getElementById("msg").value.length;
				}
	}

} //end of function

//-------------------------------------------------------------------------------------------------------------
function ShowMsg(type){

/* Show message based on which request user selected */

var browser_type=navigator.appName;	//determine browser
//alert(type);				//used for debugging

    if (type == "prayer")
    {
        
	    if (browser_type == "Microsoft Internet Explorer"){
	       	document.all.message.innerHTML  = "At Mount Calvary, we make it a priority to take the needs of others before the Lord in prayer." +
		                                          "If you have a concern for which you would like us to interceed, please fill out the form below.  " +
		                                          "When you have completed the information, please click the <em>Send</em> button to have your prayer request sent to us. ";
	    }
		
	    if (browser_type =="Netscape") {
		document.getElementById('message').innerHTML = "At Mount Calvary, we make it a priority to take the needs of others before the Lord in prayer." +
		                                          "If you have a concern for which you would like us to interceed, please fill out the form below.  " +
		                                          "When you have completed the information, please click the <em>Send</em> button to have your prayer request sent to us. ";
	    }

    } //end of type = prayer
   
    if (type == "salvation")
    {
       if (browser_type == "Microsoft Internet Explorer"){
       		document.all.message.innerHTML  = "If you would like information on eternal life with our Lord and Savior, please fill out the form below.  " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your request sent to us. ";
	    }
	
	    if (browser_type =="Netscape") {
		document.getElementById('message').innerHTML = "If you would like information on eternal life with our Lord and Savior, please fill out the form below.  " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your request sent to us. ";
	    }
	
    } //end of type = salvation
    
    if (type == "secretary")
    {
       if (browser_type == "Microsoft Internet Explorer"){
       		document.all.message.innerHTML  = "If you would like to contact the church secretary, please fill out the form below.  " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your request sent to us. ";
	    }
	
	    if (browser_type =="Netscape") {
		document.getElementById('message').innerHTML = "If you would like to contact the church secretary, please fill out the form below.  " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your request sent to us. ";
	    }
	
    } //end of type = secretary
    
    if (type == "pastor")
    {
       if (browser_type == "Microsoft Internet Explorer"){
       		document.all.message.innerHTML  = "If you would like to contact our pastor, please fill out the form below.  " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your request sent to us. ";
	    }
	
	    if (browser_type =="Netscape") {
		document.getElementById('message').innerHTML = "If you would like to contact our pastor, please fill out the form below.  " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your request sent to us. ";
	    }
	
    } //end of type = pastor
    
    if (type == "feedback")
    {
         if (browser_type == "Microsoft Internet Explorer"){
         	document.all.message.innerHTML  = "We would like to get your feedback/comments about our site. " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your feedback/comments sent to us. ";                      
          }
          if (browser_type =="Netscape") {
	  		document.getElementById('message').innerHTML = "We would like to get your feedback/comments about our site. " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your feedback/comments sent to us. ";
	  }
    }//end of type = feedback
    
    if (type == "site_issue")
    {
        if (browser_type == "Microsoft Internet Explorer"){
        		document.all.message.innerHTML  = "We would like to know about any problem(s) you experience while visiting our site. " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your feedback sent to us. ";
	    }
	    if (browser_type =="Netscape") {
		  		document.getElementById('message').innerHTML = "We would like to know about any problem(s) you experience while visiting our site. " +
                                          "When you have completed the information, please click the <em>Send</em> button to have your feedback sent to us. ";
	    }
    } //end of type = site_issue
}

//-------------------------------------------------------------------------------------------------------------

var map;
var gdir;
var geocoder = null;
var addressMarker;

function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
gdir = new GDirections(map, document.getElementById("directions"));
GEvent.addListener(gdir, "load", onGDirectionsLoad);
GEvent.addListener(gdir, "error", handleErrors);
document.getElementById("fromAddress").value="Enter Your Location";

setDirections("Alexandria", "2221 Emmett Drive, VA 22306", "en_US", 0);
}
}

function setDirections(fromAddress, toAddress, locale, show_print) {
	gdir.load("from: " + fromAddress + " to: " + toAddress,
		{ "locale": locale }); 
	if (show_print == 1) {
		document.getElementById("myprint").innerHTML = "(<a href=# onClick=\'window.print()\'>Print Directions</a>)";
	}
}

function handleErrors(){
if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);

else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);

// else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS) <--- Doc bug... this is either not defined, or Doc is wrong
// alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);

else if (gdir.getStatus().code == G_GEO_BAD_KEY)
alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);

else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);

else alert("An unknown error occurred.");

}

function onGDirectionsLoad(){
// Use this function to access information about the latest load()
// results.

// e.g.
// document.getElementById("getStatus").innerHTML = gdir.getStatus().code;
// and yada yada yada...

}

//-------------------------------------------------------------------------------------------------------------
-->
