// JavaScript Document 041911 6:30pm

var i, inxt, p, theImages = new Array(), whichImage, rimage, nxtImage = new Image(), ldngImages=0, d=document, obj, scrh, scrw, gwin = null, path;

/* in-line frame (iframe) to replace pop-up window */
function ifrvc (content) {
	d.getElementById('popup').style.width = "597px";
	var vcen = window.frames[0].document.getElementById("vcen");
	var para = window.frames[0].document.getElementById("para");
	var maparea = d.getElementById(content).innerHTML;
	vcen.style.marginTop = '25px';
	para.innerHTML = maparea;
	window.frames[0].d.getElementById('ncb').style.display = "inline-block";
	window.frames[0].d.getElementById('ncb').innerHTML='<br /><input value=\"Close\" type=\"submit\" onclick=\"javascript:closeifr();\" />';
	d.getElementById('popupdiv').style.display = "block";
	d.getElementById('popup').style.height = window.frames[0].document.getElementById('photodiv').scrollHeight + 20 + 'px';
	if (window.frames[0].document.getElementById("photodiv").scrollHeight >= 590) {
		if (content.indexOf("MF") >= 1) {
			maparea = "<div style=\"position:relative;z-index:0;height:35px;\"><div style=\"position:absolute;top:10px;left:25px;color:#FFFFFF;font-size:13px;\">(click a name below to view profile)</div><input value=\"Close\" type=\"submit\" onclick=\"javascript:closeifr();\" /><br/></div>" + maparea;}
		else {
			maparea = "<div style=\"position:relative;z-index:0;height:35px;\"><input value=\"Close\" type=\"submit\" onclick=\"javascript:closeifr();\" /><br/></div>" + maparea;};
		para.innerHTML = maparea;
		vcen.style.marginTop = '5px';
		d.getElementById('popup').style.height = '590px';
	}
	window.frames[0].scroll(0,0);
}

function closeifr() {
	var pd = parent.window.d.getElementById('popupdiv');
	pd.innerHTML = '<iframe id=\"popup\" name=\"popframe\" src=\"virtuespopup.html\" frameborder=\"0\"></iframe>';
	pd.style.display = "none";
}

/* process Newsletter sign-up form required fields*/

function newscheck() {
	var errmsg = "";
	var fnamval = document.form1.fname.value;
	var lnamval = document.form1.lname.value;
	fnamval = fnamval.replace(/ /g,'');
	lnamval = lnamval.replace(/ /g,'');
	if ((fnamval == "") || (lnamval == "") || (fnamval == null) || (lnamval == null)) {
		errmsg = "Please enter your First and Last Name !";
	}
	var x = document.form1.email.value;
	var atpos=x.indexOf("@");
	var dotpos=x.lastIndexOf(".");
	if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
 	{
		errmsg = errmsg + " Please enter a valid e-mail address !";
	}
	if (errmsg != "") {
		d.getElementById("ferror").innerHTML = errmsg;
		return false;
	}
	d.getElementById("ssubmit").innerHTML = "<span>Signing up...</span>";
	return true;
}

/* show and hide to add hover color change to everypage LogoMenu links, and map hover areas images */

function showarea(area)
{
	d.getElementById(area).style.visibility='visible';
}

function hidearea(area)
{
	d.getElementById(area).style.visibility='hidden';
}

function popwin(wdt,hgt,pad,content,wintype) {
	
	if (wintype == 'doc') {
		wdt = 840;
		hgt = 575;
	}
	
	if (wintype == 'txt') {
		wdt = document.getElementById(content).scrollWidth;if (wdt > 525) {wdt = 525;};
		hgt = document.getElementById(content).scrollHeight;if (hgt > 575) {hgt = 575;};
	}
	
	var params = wdt + "XZX" + hgt + "XZX" + pad + "XZX" + content + "XZX" + wintype; /* XZX is delimiter for calling parameters to be passed to vpop in window NAME */
	if (gwin && wintype!='mfi') {gwin.close();} /* close a pop-up if one is open (see note for case ext below) */
	wdt = wdt + (2*pad);
	var result = null;
	var ref = null;
	/* add height room for button(s) */
		switch (wintype) {
			case 'gal': result = 25; break;
			case 'img': result = 25; break;
			case 'txt': result = 25; break;
			case 'mfi': result = 25; break;
			case 'map': result = 25; break;
			case 'doc': result = 25; break;
			default: result = 0;
		}
	hgt = hgt + (2*pad) + result;
	scrh = ((window.screen.height - hgt)/2);
	scrw = (((window.screen.width - wdt)/2) - 16);
	
		switch (wintype) {
			case 'pdf': gwin = window.open('Pdf/' + content + '.pdf',content,'width=' + wdt + 'px,height=' + hgt + 'px' + ',left=' + scrw + ',top=' + scrh + ',resizable=yes,scrollbars=yes'); gwin.focus();break;
			case 'ext': /* NB: IE will not return a window reference/handle (gwin) to external site (e.g. virtuesshop) - so cannot focus or close these windows - they will be left open until closed by the IE user. Also note that external links windows from a pop-up has no handle, so will be left open by all browsers.
For full window controls, specify:  gwin = window.open(ref,content,'width=' + wdt + 'px,height=' + hgt + 'px' + ',left=' + scrw + ',top=' + scrh + ',directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes');}  */
			
if (content == "buycards") {
ref = encodeURI("https://virtuesshop.com/index.php?option=com_virtuemart&page=shop.product_details&flypage=flypage.tpl&product_id=45&Itemid=53"); }
if (content == "buypog") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=117&category_id=1&option=com_virtuemart&Itemid=61"); }
if (content == "buyevg") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=96&category_id=17&option=com_virtuemart&Itemid=98"); }
if (content == "buyilb") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=104&category_id=3&keyword=booklet&option=com_virtuemart&Itemid=64"); }
if (content == "buyFVG") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=26&category_id=2&option=com_virtuemart&Itemid=63"); }
if (content == "lookL") {
ref = encodeURI("http://www.nationalpost.com/Angels+workplace+virtue+enhances+productivity/3390154/story.html"); }
if (content == "buy5strat") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=123&category_id=8&option=com_virtuemart&Itemid=67"); }
if (content == "buyVAC") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=86&category_id=10&option=com_virtuemart&Itemid=55"); }
if (content == "buySM") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=41&category_id=1&option=com_virtuemart&Itemid=61"); }
if (content == "buyEVC") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=97&category_id=17&option=com_virtuemart&Itemid=98"); }
if (content == "buyBroc") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=75&category_id=8&option=com_virtuemart&Itemid=67"); }
if (content == "buyFP") {
ref = encodeURI("https://virtuesshop.com/index.php?page=shop.product_details&flypage=flypage.tpl&product_id=118&category_id=8&option=com_virtuemart&Itemid=67"); }
if (content == "buyFC") {
ref = encodeURI("https://virtuesshop.com/index.php?option=com_virtuemart&Itemid=90"); }
if (content == "searchvp") {
var stext = d.getElementById("srchtxt").value;
if (stext == "") {return;}
ref = encodeURI("http://www.google.com/search?q=" + stext + "&sitesearch=virtuesproject.com/&as_qdr=y1"); }

gwin = window.open(ref,content,'width=' + wdt + 'px,height=' + hgt + 'px' + ',left=' + scrw + ',top=' + scrh + ',location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes');

			return; break;

			default: gwin = window.open('virtuespopup.html',params,'width=' + wdt + 'px,height=' + hgt + 'px' + ',left=' + scrw + ',top=' + scrh + ',resizable=yes,scrollbars=yes');gwin.focus();
		} /*end wintype*/
} /*end popwin*/

/* light and dark to add hover color change to pop-up window links
 for innerHTML links hover text color change, add: onmouseover=\"javascript:light(this);\" onmouseout=\"javascript:dark(this);\" */
function light(obj) {
	obj.style.color = '#0FF'; }

function dark(obj) {
	obj.style.color = '#000000'; }

/* Parse width, height, padding, content, type from window NAME to select and configure virtuespopup.html contents */

function vpop() {
	
	var vparms = window.name;
	/*window.name = "VirtuesFeature";  NB - this would be a bit more secure, but it will eliminate the user from refreshing the pop-up */
	var vparmsAR = new Array();
	vparmsAR = vparms.split("XZX");  /* vparmsAR[0]=width, vparmsAR[1]=height, vparmsAR[2]=padding, vparmsAR[3]=content, vparmsAR[4]=type */
	var vwdt = vparmsAR[0];
	var vhgt = vparmsAR[1];
	var vpad = vparmsAR[2];
	var vcont = vparmsAR[3];
	var vtyp = vparmsAR[4];

		switch (vtyp) { /* could bring all getElementByID up here */
			case 'gal': 
				d.getElementById('para').innerHTML='<img id=\"galpic\" src=\"\" />';
				d.getElementById('ncb').style.display = "inline-block";
				d.getElementById('ncb').innerHTML='<br /><input value=\"Next\" type=\"submit\" onclick=\"nextphoto();\" /><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" />';
				d.getElementById('ncb').style.bottom = "0px";
				var addtop = '25';
				d.getElementById('photodiv').style.marginTop = addtop + 'px';
				d.getElementById('para').style.height = "667px";
				photogallery(vcont);
				return; break;
			
			case 'img':
				d.getElementById('para').innerHTML='<img id=\"galpic\" src=\"\" />';
				d.getElementById('ncb').style.display = "inline-block";
				d.getElementById('ncb').innerHTML='<br /><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" />';
				var addtop = '25';
				d.getElementById('photodiv').style.marginTop = addtop + 'px';
				virpick(vcont);
				return; break;
			
			case 'mfi':
				d.getElementById('para').innerHTML='<img id=\"galpic\" src=\"\" />';
				d.getElementById('ncb').style.display = "inline-block";
				d.getElementById('ncb').innerHTML='<br /><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" />';
				var addtop = '25';
				d.getElementById('photodiv').style.marginTop = addtop + 'px';
				mfishow(vcont); 
				return; break;
			
			case 'map':
				var para = d.getElementById("para");
				var content = window.opener.d.getElementById(vcont).innerHTML;
				para.innerHTML = content;
				d.getElementById('ncb').style.display = "inline-block";
				d.getElementById('ncb').innerHTML='<br /><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" />';
				var addtop = '25';
				d.getElementById('photodiv').style.marginTop = addtop + 'px';
				return; break;
			
			case 'aud':
				d.getElementById('para').innerHTML='<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"' + vwdt + '\" height=\"' + vhgt + '\" id=\"FlashID\" title=\"Hear the Virtues Project in Action\"><param name=\"movie\" value=\"Audio/Vaudio.swf\" /><param name="flashVars" value=\"audioname=' + vcont + '.flv\"><param name=\"quality\" value=\"high\" /><param name=\"swfversion\" value=\"6.0.65.0\" /><param name=\"expressinstall\" value=\"Video/expressInstall.swf\" /><param name=\"wmode\" value=\"transparent\" /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>--><object type=\"application/x-shockwave-flash\" data=\"Audio/Vaudio.swf\" width=\"' + vwdt + '\" height=\"' + vhgt + '\"><param name="flashVars" value=\"audioname=' + vcont + '.flv\"><!--<![endif]--><param name=\"quality\" value=\"high\" /><param name=\"swfversion\" value=\"6.0.65.0\" /><param name=\"expressinstall\" value=\"Video/expressInstall.swf\" /><param name=\"wmode\" value=\"transparent\" /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a></p></div><!--[if !IE]>--></object><!--<![endif]--></object>';
			 return; break;
			
			case 'vid':
				d.getElementById('para').innerHTML='<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"' + vwdt + '\" height=\"' + vhgt + '\" id=\"FlashID\" title=\"See the Virtues Project in Action\"><param name=\"movie\" value=\"Video/Vvideo.swf\" /><param name="flashVars" value=\"moviein=' + vcont + '.flv\"><param name=\"quality\" value=\"high\" /><param name=\"swfversion\" value=\"6.0.65.0\" /><param name=\"expressinstall\" value=\"Video/expressInstall.swf\" /><param name=\"wmode\" value=\"transparent\" /><!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --><!--[if !IE]>--><object type=\"application/x-shockwave-flash\" data=\"Video/Vvideo.swf\" width=\"' + vwdt + '\" height=\"' + vhgt + '\"><param name="flashVars" value=\"moviein=' + vcont + '.flv\"><!--<![endif]--><param name=\"quality\" value=\"high\" /><param name=\"swfversion\" value=\"6.0.65.0\" /><param name=\"expressinstall\" value=\"Video/expressInstall.swf\" /><param name=\"wmode\" value=\"transparent\" /><!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. --><div><h4>Content on this page requires a newer version of Adobe Flash Player.</h4><p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" /></a></p></div><!--[if !IE]>--></object><!--<![endif]--></object>';
			return; break;
			 
			case 'txt':
				if (vcont == "involve" || vcont == "testimonials" || vcont == "involveVPRN")
				{
				var para = d.getElementById("para");
				para.innerHTML=window.opener.document.getElementById(vcont).innerHTML;
				para.style.width = vwdt + 'px';
				d.getElementById('ncb').style.display = "inline-block";
				d.getElementById('ncb').innerHTML='<br /><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" />';
				var alink = new Array();
				alink = d.getElementsByTagName("a");
				for(i=0; i < alink.length ; i++) {alink[i].style.color = "#000000";};
				var addtop = '25';
				d.getElementById('photodiv').style.marginTop = addtop + 'px';
				}
			
			return; break;
		
			case 'fix':
				if (vcont == "ContactUs")
				{
				window.location = 'contact.html';
				}

			return; break;
		
			case 'doc':
				var gdoc = "";
				var para = d.getElementById("para");
				var sects =  'oneG|twoG|threeG|fourG|fiveG|sixG|sevenG|eightG|nineG|tenG';
				theImages = sects.split("|");
				for (i=0;i<=9;i++)
				{
				var docpar = window.opener.d.getElementById(theImages[i]).innerHTML;
				gdoc = gdoc + '<div id="' + theImages[i] + '" style=\"background-color:#FFFFFF;color:#000000;padding:10px;text-align:left;font-size:15px;width:800px;margin-left:auto;margin-right:auto;\">' + docpar+ '</div>';
					if (i<9) {
					gdoc = gdoc + '<div style="height:25px;width:100%;"><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" /></div>';
					}
				}
				para.innerHTML=gdoc;
				d.getElementById('ncb').style.display = "inline-block";
				d.getElementById('ncb').innerHTML='<br /><input value=\"Close\" type=\"submit\" onclick=\"self.close();\" />';
				var alink = new Array();
				alink = d.getElementsByTagName("a");
				for(i=0; i < alink.length; i++) {alink[i].style.color = "#000000";};
				var addtop = '25';
				d.getElementById('photodiv').style.marginTop = addtop + 'px';
				window.scrollTo(0,document.getElementById(vcont).offsetTop);

				return; break;
		
			case 'ytv':
				if (vcont == "kenya")
				{
				d.getElementById("para").innerHTML='<object width=\"480\" height=\"385\"><param name=\"movie\" value=\"http://www.youtube.com/v/R4Roxd_BM4g?fs=1&amp;hl=en_US\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/R4Roxd_BM4g?fs=1&amp;hl=en_US\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"480\" height=\"385\"></embed></object>';
				}

				if (vcont == "strat")
				{
				d.getElementById("para").innerHTML='<object width=\"640\" height=\"385\"><param name=\"movie\" value=\"http://www.youtube.com/v/XC1I-g0vAN0?fs=1&amp;hl=en_US&amp;rel=0\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/XC1I-g0vAN0?fs=1&amp;hl=en_US&amp;rel=0\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"640\" height=\"385\"></embed></object>';
				}
			return; break;
				
			default: return;

		} /*end switch*/
		
} /*end vpop()*/

function virpick(vcont) {
theImages.length = 0;
rimage = d.getElementById('galpic');
path = 'Image/Vpicks/';
/* all faiths picks images are the same filenames*/
var picks = 'Accountability.jpg|Assertiveness.jpg|Caring.jpg|Cleanliness.jpg|Compassion.jpg|Confidence.jpg|Consideration.jpg|Cooperation.jpg|Courage.jpg|Courtesy.jpg|Creativity.jpg|Detachment.jpg|Determination.jpg|Discernment.jpg|Enthusiasm.jpg|Excellence.jpg|Faith.jpg|Faithfulness.jpg|Flexibility.jpg|Forgiveness.jpg|Friendliness.jpg|Generosity.jpg|Gentleness.jpg|Gratitude.jpg|Helpfulness.jpg|Honesty.jpg|Honor.jpg|Humility.jpg|Idealism.jpg|Joyfulness.jpg|Justice.jpg|Kindness.jpg|Love.jpg|Loyalty.jpg|Mercy.jpg|Moderation.jpg|Modesty.jpg|Obedience.jpg|Orderliness.jpg|Patience.jpg|Peacefulness.jpg|Prayerfulness.jpg|Purposefulness.jpg|Reliability.jpg|Respect.jpg|Responsibility.jpg|Reverence.jpg|Righteousness.jpg|Self-Discipline.jpg|Service.jpg|Steadfastness.jpg|Tact.jpg|Tolerance.jpg|Trust.jpg|Trustworthiness.jpg|Truthfulness.jpg|Unity.jpg|Wonder.jpg';
switch (vcont) {
case 'getrandomimage': path = path + "Random/";
var picks = 'Acceptance.jpg|Accountability.jpg|Appreciation.jpg|Assertiveness.jpg|Awe.jpg|Beauty.jpg|Caring.jpg|Certitude.jpg|Charity.jpg|Cheerfulness.jpg|Cleanliness.jpg|Commitment.jpg|Compassion.jpg|Confidence.jpg|Consideration.jpg|Contentment.jpg|Cooperation.jpg|Courage.jpg|Courtesy.jpg|Creativity.jpg|Decisiveness.jpg|Detachment.jpg|Determination.jpg|Devotion.jpg|Dignity.jpg|Diligence.jpg|Discernment.jpg|Empathy.jpg|Endurance.jpg|Enthusiasm.jpg|Excellence.jpg|Fairness.jpg|Faith.jpg|Faithfulness.jpg|Friendliness.jpg|Fidelity.jpg|Flexibility.jpg|Forbearance.jpg|Forgiveness.jpg|Fortitude.jpg|Generosity.jpg|Gentleness.jpg|Grace.jpg|Gratitude.jpg|Helpfulness.jpg|Honesty.jpg|Honor.jpg|Hope.jpg|Humanity.jpg|Humility.jpg|Idealism.jpg|Independence.jpg|Initiative.jpg|Integrity.jpg|Joyfulness.jpg|Justice.jpg|Kindness.jpg|Love.jpg|Loyalty.jpg|Mercy.jpg|Mindfulness.jpg|Moderation.jpg|Modesty.jpg|Nobility.jpg|Openess.jpg|Optimism.jpg|Orderliness.jpg|Patience.jpg|Peacefulness.jpg|Perceptiveness.jpg|Perseverance.jpg|Prayerfulness.jpg|Purity.jpg|Purposefulness.jpg|Reliability.jpg|Resilience.jpg|Respect.jpg|Responsibility.jpg|Reverence.jpg|Righteousness.jpg|Sacrifice.jpg|Self-Discipline.jpg|Serenity.jpg|Service.jpg|Simplicity.jpg|Sincerity.jpg|Steadfastness.jpg|Strength.jpg|Tact.jpg|Thankfulness.jpg|Thoughtfulness.jpg|Tolerance.jpg|Trust.jpg|Trustworthiness.jpg|Truthfulness.jpg|Understanding.jpg|Unity.jpg|Wisdom.jpg|Wonder.jpg|Zeal.jpg';break;

case 'getrandomimagee': path = path + "Randome/";
var picks = 'Assertiveness.jpg|Caring.jpg|Cleanliness.jpg|Commitment.jpg|Compassion.jpg|Confidence.jpg|Consideration.jpg|Cooperation.jpg|Courage.jpg|Courtesy.jpg|Creativity.jpg|Detachment.jpg|Determination.jpg|Diligence.jpg|Enthusiasm.jpg|Excellence.jpg|Friendliness.jpg|Flexibility.jpg|Forgiveness.jpg|Generosity.jpg|Gentleness.jpg|Helpfulness.jpg|Honesty.jpg|Honor.jpg|Humility.jpg|Idealism.jpg|Integrity.jpg|Joyfulness.jpg|JusticeB.jpg|Kindness.jpg|Love.jpg|Loyalty.jpg|Moderation.jpg|Modesty.jpg|Orderliness.jpg|Patience.jpg|Peacefulness.jpg|Perseverance.jpg|Purposefulness.jpg|Reliability.jpg|Respect.jpg|Responsibility.jpg|Self-Discipline.jpg|Service.jpg|Tact.jpg|Thankfulness.jpg|Tolerance.jpg|Trust.jpg|Trustworthiness.jpg|Truthfulness.jpg|Understanding.jpg|Unity.jpg';break;

case 'getrandomimageFVC': path = path + "RandomFVC/";
var picks = 'Assertiveness.jpg|Caring.jpg|Cleanliness.jpg|Compassion.jpg|Confidence.jpg|Consideration.jpg|Courage.jpg|Courtesy.jpg|Creativity.jpg|Detachment.jpg|Determination.jpg|Enthusiasm.jpg|Excellence.jpg|Faithfulness.jpg|Friendliness.jpg|Flexibility.jpg|Forgiveness.jpg|Generosity.jpg|Gentleness.jpg|Helpfulness.jpg|Honesty.jpg|Honor.jpg|Humility.jpg|Idealism.jpg|Joyfulness.jpg|Justice.jpg|Kindness.jpg|Love.jpg|Loyalty.jpg|Mercy.jpg|Moderation.jpg|Modesty.jpg|Obedience.jpg|Orderliness.jpg|Patience.jpg|Peacefulness.jpg|Prayerfulness.jpg|Purposefulness.jpg|Reliability.jpg|Respect.jpg|Responsibility.jpg|Reverence.jpg|Self-Discipline.jpg|Service.jpg|Steadfastness.jpg|Tact.jpg|Thankfulness.jpg|Tolerance.jpg|Trust.jpg|Trustworthiness.jpg|Truthfulness.jpg|Unity.jpg';break;
case 'getrandomimageA': path = path + "RandomA/";break;
case 'getrandomimageB': path = path + "RandomB/";break;
case 'getrandomimageBF': path = path + "RandomBF/";break;
case 'getrandomimageCB': path = path + "RandomCB/";break;
case 'getrandomimageCC': path = path + "RandomCC/";break;
case 'getrandomimageKJV': path = path + "RandomCKJV/";break;
case 'getrandomimageFN': path = path + "RandomFN/";break;
case 'getrandomimageH': path = path + "RandomH/";break;
case 'getrandomimageJ': path = path + "RandomJ/";break;
case 'getrandomimageLDS': path = path + "RandomLDS/";break;
case 'getrandomimageM': path = path + "RandomM/";break;
case 'getrandomimageS': path = path + "RandomS/";break;
case 'getrandomimageZ': path = path + "RandomZ/";break;

	default: return;break;
	} /* end switch */
theImages = picks.split("|");
p = theImages.length;
whichImage = Math.round(Math.random()*(p-1));
rimage.src = path + theImages[whichImage];
}

function photogallery(vcont) {
theImages.length = 0;
ldngImages=0;
rimage = d.getElementById('galpic');
path = 'Image/Photogallery/'
switch (vcont) {
	case 'getphotos': path =  path + "Homepage/";var picks = 'G1.jpg|G2.jpg|G3.jpg|G4.jpg|G5.jpg';break;
	case 'getphotospl': path =  path + "Personallife/";var picks = 'PLasacredmoment.jpg|PLcelebratethearts.jpg|PLcompanions.jpg|PLdave.jpg|PLelderstogether.jpg|PLhugs.jpg|PLmeditation.jpg|PLpog.jpg|PLreflection.jpg|PLunity.jpg|PLvirtuespick.jpg';break;
	case 'getphotose': path =  path + "Education/";var picks = 'EBanners.jpg|EBB.jpg|EDancer.jpg|EFestival.jpg|EGingerland.jpg|EMaude.jpg|ETeachers.jpg|EVIA.jpg|Evirtues-chorus-Aus.jpg|EBB.jpg|EFestival.jpg';break;
	case 'getphotosCD': path =  path + "Community/";var picks = 'First.jpg|Palau.jpg|Papua.jpg|SO.jpg';break;
	case 'getphotosF': path =  path + "Family/";var picks = 'Val2.jpg|LD.jpg|Igani.jpg|Val1.jpg|DP.jpg|Huppatz.jpg|LKPKid.jpg';break;
	case 'getphotosFC': path =  path + "Faith/";var picks = 'Choir.jpg|Hoop.jpg|Hungary.jpg|Ribbons.jpg|Muslim.jpg|Solomon.jpg|Village.jpg|RF.jpg|Peace.jpg|Crosses.jpg';break;
	case 'getphotosL': path =  path + "Leadership/";var picks = 'Chong.jpg|Crew.jpg|DCLeaders.jpg|Katcommon.jpg|Korea.jpg|KLmusWks6.jpg|Saipan.jpg|Spelman.jpg|Workshop.jpg';break;
	case 'getphotostvp': path =  path + "Tvp/";var picks = 'tvp1.jpg|tvp2.jpg|tvp3.jpg|tvp4.jpg|tvp5.jpg';break;
	case 'getphotostvpF': path =  path + "TvpFounders/";var picks = 'LindaDan.jpg|LindaJohn.jpg|Dan2.jpg|Dan3.jpg|CraigLinda.jpg|LindaChris.jpg|tvp2.jpg|tvp3.jpg|tvp4.jpg|tvp5.jpg';break;
	case 'getphotostvpB': path =  path + "TvpBoard/";var picks = 'B1.jpg|B2.jpg|CraigLinda.jpg|Dan2.jpg|Dan3.jpg|LindaChris.jpg|LindaDan.jpg|LindaJohn.jpg|tvp2.jpg|tvp3.jpg|tvp4.jpg|tvp5.jpg';break;
	case 'getphotostvpC': path =  path + "TvpConnections/";var picks = 'VC1.jpg|VC2.jpg|VC3.jpg|VC4.jpg|VC5.jpg|VC6.jpg';break;
	case 'getphotosMF': path =  path + "TvpMasterF/";var picks = 'MF1.jpg|MF2.jpg|MF3.jpg|MF4.jpg|MF5.jpg';break;
	case 'getphotosFac': path =  path + "TvpFacilitator/";var picks = 'F1.jpg|F2.jpg|F3.jpg|F4.jpg';break;
	case 'getphotosVir': path =  path + "Virtues/";var picks = 'V1.jpg|V2.jpg|V3.jpg|V4.jpg|V5.jpg|V6.jpg|V7.jpg|V8.jpg';break;
	case 'getphotosS': path =  path + "Strategies/";var picks = 'S1.jpg|S2.jpg|S3.jpg|S4.jpg|S5.jpg|S6.jpg|S7.jpg|S8.jpg|S9.jpg';break;
	case 'getphotosSL': path =  path + "StrategiesL/";var picks = 'SL1.jpg|SL2.jpg|SL3.jpg|SL4.jpg';break;
	case 'getphotosSM': path =  path + "StrategiesM/";var picks = 'SM1.jpg|SM2.jpg|SM3.jpg|SM4.jpg|SM5.jpg';break;
	case 'getphotosSC': path =  path + "StrategiesC/";var picks = 'SC1.jpg|SC2.jpg|SC3.jpg|SC4.jpg|SC5.jpg';break;
	case 'getphotosSB': path =  path + "StrategiesB/";var picks = 'SB1.jpg|SB2.jpg|SB3.jpg|SB4.jpg|SB5.jpg';break;
	case 'getphotosSS': path =  path + "StrategiesS/";var picks = 'SS1.jpg|SS2.jpg|SS3.jpg|SS4.jpg|SS5.jpg';break;
	case 'getphotosPGM': path =  path + "ProgramsS/";var picks = 'p2.jpg|p3.jpg|p4.jpg|p5.jpg|p6.jpg|p7.jpg|p8.jpg|p9.jpg|p10.jpg|p11.jpg|p12.jpg';break;
	case 'getphotoscal': path =  path + "Calendar/";var picks = 'C1.jpg|C2.jpg|C3.jpg|C4.jpg|C5.jpg|C6.jpg|C7.jpg|C8.jpg|C9.jpg|C10.jpg|C11.jpg|C12.jpg';break;
	case 'getphotosrp': path =  path + "Resources/";var picks = 'R1.jpg|R2.jpg|R3.jpg|R4.jpg|R5.jpg';break;
	default: return;break;
	} /* end switch */
theImages = picks.split("|");
inxt=0;rimage.src = path + theImages[inxt];nxtImage.src = path + theImages[inxt+1];
}

function nextphoto()
{
	p = theImages.length;
	inxt=inxt+1;
	if (p<=inxt) {inxt=0;ldngImages=1;}
	rimage.src = path + theImages[inxt];
	if (ldngImages==0 && p>inxt+1) {
		rimage.onLoad=nxtImage.src = path + theImages[inxt+1];
	}
}

function mfishow(vcont)
{
path = "Image/Masters/"
rimage = d.getElementById('galpic');
var mfi = path + vcont + '.png';
rimage.src = mfi;
}

