<!--//hidden

// Break out of frames (for if some other site is trying to encapsulate www.SouthAmericaMission.org or any sub-site or sub-page)
if (top.location != self.location) {
	top.location = self.location.href
}

////////////
// Platform
////////////

var agt=navigator.userAgent.toLowerCase();
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac= (agt.indexOf("mac")!=-1);
var is_firefox = (agt.indexOf("firefox") !=-1);
var is_opera = (agt.indexOf("opera") !=-1);


///////////////////////////////////
// Common function initializations
///////////////////////////////////

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function grayOut(vis, options) {
  var options = options || {}; 
  var zindex = options.zindex || 50;
  var opacity = options.opacity || 70;
  var opaque = (opacity / 100);
  var bgcolor = options.bgcolor || '#603913';
  var dark=document.getElementById('darkenScreenObject');
  if (!dark) {
    var tbody = document.getElementsByTagName("body")[0];
    var tnode = document.createElement('div');           // Create the layer.
        tnode.style.position='absolute';                 // Position absolutely
        tnode.style.top='0px';                           // In the top
        tnode.style.left='0px';                          // Left corner of the page
        tnode.style.overflow='hidden';                   // Try to avoid making scroll bars            
        tnode.style.display='none';                      // Start out Hidden
        tnode.id='darkenScreenObject';                   // Name it so we can find it later
    tbody.appendChild(tnode);                            // Add it to the web page
    dark=document.getElementById('darkenScreenObject');  // Get the object.
  }
  if (vis) {
    // Calculate the page width and height 
    if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
        var pageWidth = document.body.scrollWidth+'px';
        var pageHeight = document.body.scrollHeight+'px';
    } else if( document.body.offsetWidth ) {
      var pageWidth = document.body.offsetWidth+'px';
      var pageHeight = document.body.offsetHeight+'px';
    } else {
       var pageWidth='100%';
       var pageHeight='100%';
    }   
    //set the shader to cover the entire page and make it visible.
    dark.style.opacity=opaque;                      
    dark.style.MozOpacity=opaque;                   
    dark.style.filter='alpha(opacity='+opacity+')'; 
    dark.style.zIndex=zindex;        
    dark.style.backgroundColor=bgcolor;  
    dark.style.width= pageWidth;
    dark.style.height= pageHeight;
    dark.style.display='block';
	dark.onclick = function (evt)
				{
				MM_showHideLayers('feedback','','hide','emailfriend','','hide','donate','','hide','frmSearch','','hide');
				grayOut(false);
				}
	window.onresize = function (evt)
					{
					dark.style.width= '100%';
					dark.style.height= '100%';
					}
  } else {
     dark.style.display='none';
  }
}

//////////////////////
// Get URL
//////////////////////

function getPage(address) {
	location.href = address;
}

//////////////////////
// Preload Images
//////////////////////

// imagePreload( '01.gif', '02.gif' ); 
function imagePreload()
{ 
  var args = imagePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

//////////////////////
// Status Bar Message
//////////////////////

window.defaultStatus="New Tribes Mission";

function statusBar(msg) {
	self.status=msg;
}


//////////////////////
// Bookmark this page
//////////////////////
function bookmark() {
	var txt = "Bookmark Us!";
	var url = document.location;
	var who = document.title;

	var ver = navigator.appName;
	var num = parseInt(navigator.appVersion);
	if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
		window.external.AddFavorite(url,who);
	}else{
	   txt += "  (Ctrl+D)";
	   document.write(txt);
	}
}

////////////////////////////////////
// Popup window in center of screen
////////////////////////////////////

function popupWin(theURL,popWidth,popHeight){
	var winleft = (screen.width - popWidth) / 2;
	var winUp = (screen.height - popHeight) / 2;
	if(is_firefox){
		win2=window.open(theURL,'popup','toolbar=no,scrollbars=no,width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
		/*attach the custom property "creator" to win2, and have it contain the current window (main window)*/
		win2.creator=self;
	}else{
		window.open(theURL, 'popup','toolbar=no,scrollbars=no,width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
	}
}

function popWindow(theURL,theName,popWidth,popHeight,popScrollbars){
	var winleft = (screen.width - popWidth) / 2;
	var winUp = (screen.height - popHeight) / 2;
	if (popScrollbars != 'yes'){
		popScrollbars = 'no';
		popSizable = 'no'
	} else {
		popSizable = 'yes'
	}
	if(is_firefox){
		win2=window.open(theURL,theName,'toolbar=no,menubar=no,resizable='+popSizable+',status=no,scrollbars='+popScrollbars+',width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
		/*attach the custom property "creator" to win2, and have it contain the current window (main window)*/
		win2.creator=self;
	}else{
		window.open(theURL,theName,'toolbar=no,menubar=no,resizable='+popSizable+',status=no,scrollbars='+popScrollbars+',width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
	}
}

function popupWin_scroll(theURL,popWidth,popHeight){
	var winleft = (screen.width - popWidth) / 2;
	var winUp = (screen.height - popHeight) / 2;
	window.open(theURL, 'popup','toolbar=no,scrollbars=yes,resizable=yes,width='+popWidth+', height='+popHeight+',left='+winleft+',top='+winUp);
}

function remote_control(url){
	if(is_firefox){
		creator.location=url
	}else{
		opener.location.href=url
	}
}

////////////////////////////////////
// Popup window system implemented for myMinistry websites on 09-07-2006
////////////////////////////////////
// e.g. usage:
// <a href="/flash/start.swf" onclick="windowOpener(this.href,640,480,'flash_title',false); return false;">link</a>
////////////////////////////////////
/**/
function windowOpener(url,width,height,name,scrolls) {
	browserName = navigator.appName;
	browserVer = navigator.appVersion.substring(0,1);
	if (width==null) {width=600;}
	if (height==null) {height=400;}
	if (name==null) {name="Preview"}
	if (scrolls==true) {
		scrollsOption="yes";
	} else {
		scrollsOption="no";
	}
	var topPx = (browserName=="Netscape")?"screenX":"top";
	var leftPx = (browserName=="Netscape")?"screenY":"left";
	var winleft = (screen.width - width) / 2;
	var winUp = (screen.height - height) / 2;
	if (browserName != "Netscape" || browserVer != 2) {
		controlWindow=window.open(url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,scrollbars="+scrollsOption+",resizable=no,"+leftPx+"="+winleft+","+topPx+"="+winUp);
	}
}
/**/

////////////////////////////////////
// Map popup window - explore section
////////////////////////////////////

function popupMap(image, country, popWidth, popHeight){
	var winleft = (screen.width - popWidth) / 2;
	var winUp = (screen.height - popHeight) / 2;
	window.open("../explore/map.php?map=" + image + "&country=" + country, 'popup','toolbar=no, scrollbars=no,width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
}

////////////////////////////////////
// News image popup window - news section
////////////////////////////////////

function popupNewsImage(image, imgname, popWidth, popHeight){
	var winleft = (screen.width - popWidth) / 2;
	var winUp = (screen.height - popHeight) / 2;
	window.open("news_image.php?image=" + image + "&imgname=" + imgname, 'popup','toolbar=no, scrollbars=no,width='+popWidth+',height='+popHeight+',left='+winleft+',top='+winUp);
}

//////////////////////
// Disable Right Click
//////////////////////

function disableRightClick()
{
  var message = "Right click disabled";
  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      return false;
    }
  }
  else
  {
    return false;
  }
}
// disableRightClick();

//////////////////////
// Status Bar Message
//////////////////////

function statusBar(msg) {
	self.status=msg;
}
window.defaultStatus="South America Mission";


///////////////
// blur anchors
///////////////

function blurAnchors(){
  if(document.getElementsByTagName){
    var a = document.getElementsByTagName("a");
    for(var i = 0; i < a.length; i++){
      a[i].onfocus = function(){this.blur()};
    }
  }
}
window.onload = blurAnchors;

//////////////////
// hyper cells
//////////////////

function hyperCell_over(object, color){
	object.style.backgroundColor = color; 
	object.style.cursor = "hand";
}

function hyperCell_out(object){
	object.style.backgroundColor = "";
}

function hyperCell_click(url){
	window.location.href = url;
}

///////////////////////////////
// show or hide table elements
///////////////////////////////
// value 1 - name of select field 
// value 2 - comma separated string of select options which are the same as your id's
// value 3 - comma separated string of how many form fields corespond to value 2
function showHide(formSelect, idArray, fieldsArray){
	// initialize form elements
	form = document.forms[0];
	formSelect = form.elements[formSelect];
	// get value of form element
	idArray = idArray.split(","); 
	fieldsArray = fieldsArray.split(","); 
	formElements = document.forms[0].elements.length;
	// find element key so we can clear old element value
	for(i=0; i<form.length; i++){ if(form.elements[i].value == formSelect.value){ key = i; } }		
	// decide what to display and what not to display
	fieldsArraySum = 1;
	for(i=0; i<idArray.length; i++){ 
		if(formSelect.value == idArray[i]){ displayValue = ''; }
		else{ displayValue = 'none'; }
		// remove all value's given for input fields
		for(z=0; z<fieldsArray[i]; z++){ 		
			form.elements[fieldsArraySum + key + z].value = ''; 
		}
		fieldsArraySum = eval(fieldsArraySum + eval(fieldsArray[i]));
		// to display or not to display - that is the question		
		document.getElementById(idArray[i]).style.display = displayValue; 
	}
}

///////////////////////////////
// control flash via javascript
///////////////////////////////

function mediaPlay(type, file, name, length){
	flashObj = 'header';
   	if (navigator.appName.indexOf("Microsoft Internet")!=-1){ flashObj =  eval("window." + flashObj); }
   	else { flashObj = eval("window.document." + flashObj); }
	flashObj.SetVariable('type', type); 
	flashObj.SetVariable('file', file); 
	flashObj.SetVariable('itemName', name);
	flashObj.SetVariable('itemLength', length);
	flashObj.TCallLabel('/media_player', type); 
}
// -->

///////////////////////////////
// Automatic format numbers ONLY.
///////////////////////////////
/*
function formatNum(e,formName) {
	var isIE4=false;
	if (parseInt(navigator.appVersion.charAt(0))>=4){
		isIE4=(navigator.appName.indexOf("Microsoft"!=-1)) ? true:false
	}
	var charCode
	if (isIE4){
		var charCode = e.keyCode;
		var obj_name = window.event.srcElement.name
		var strNum = eval("document.forms['"+formName+"']."+obj_name+".value");
		if (!(charCode >= 48 && charCode <= 57)) return false;
		else return false;
		eval("document.forms['"+formName+"']."+obj_name+".value="+strNum);
	}
	else return true;
}
*/

///////////////////////////////
// Automatic format number-only fields.
///////////////////////////////
function isNumericKey(e)
{
var k = document.all ? e.keyCode : e.which;
return ((k > 47 && k < 58) || k == 8 || k == 0);
}

function extractNumeric(str)
{
return str.replace(/\D/g,"");
}

///////////////////////////////
// Automatic format phone numbers.
///////////////////////////////
function formatPhoneNum(e) {
	var isIE4=false;
	if (parseInt(navigator.appVersion.charAt(0))>=4){
		isIE4=(navigator.appName.indexOf("Microsoft"!=-1)) ? true:false
	}
	var charCode
	if (isIE4){
		var charCode = e.keyCode;
		var obj_name = window.event.srcElement.name
		var strPhone = eval("document.forms[0]."+obj_name+".value");
		if (strPhone.length<14){
			if (!(charCode >= 48 && charCode <= 57)) return false;
		}
		else return false;
		if (strPhone.length==0) eval("document.forms[0]."+obj_name+".value=('(')");
		else if (strPhone.length==4) eval("document.forms[0]."+obj_name+".value=(strPhone+') ')");
		else if (strPhone.length==9) eval("document.forms[0]."+obj_name+".value=(strPhone+'-')");
		return true;
	}
	else return true;
}

///////////////////////////////
// Automatic format date entry (99/99/9999).
///////////////////////////////
function formatDate(e,formName) {
	var isIE4=false;
	if (parseInt(navigator.appVersion.charAt(0))>=4){
		isIE4=(navigator.appName.indexOf("Microsoft"!=-1)) ? true:false
	}
	var charCode
	if (isIE4){
		var charCode = e.keyCode;
		var obj_name = window.event.srcElement.name
		var strDate = eval("document.forms['"+formName+"']."+obj_name+".value");
		if (strDate.length<11){
			if (!(charCode >= 48 && charCode <= 57)) return false;
		}
		else return false;
		if (strDate.length==2) eval("document.forms['"+formName+"']."+obj_name+".value=(strDate+'/')");
		else if (strDate.length==5) eval("document.forms['"+formName+"']."+obj_name+".value=(strDate+'/')");
		return true;
	}
	else return true;
}

///////////////////////////////
// Email validation.
///////////////////////////////
function isvalid_email(oEmail){
	if (document.layers||document.getElementById||document.all) {
		var str=oEmail.value;
		if (str!=''){
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
			if (!filter.test(str)) {
				alert("Please input a valid email address!");
				oEmail.select();
				oEmail.focus();
			}
		}
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*  
Script made by Martial Boissonneault © 2001-2003 http://getElementById.com/
This script may be used and changed freely as long as this msg is intact
Visit http://getElementById.com/ for more free scripts and tutorials.
Script featured at SimplytheBest.net http://simplythebest.net/scripts/
*/
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("cont").getElementsByTagName("DIV");
		if(el.style.display == "none"){
			for (var i=0; i<ar.length; i++){
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}
function ChangeClass(menu, newClass) { 
	 if (document.getElementById) { 
	 	document.getElementById(menu).className = newClass;
	 } 
} 
document.onselectstart = new Function("return true");

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// -------------------------------------------------------------------
// Image Thumbnail Viewer Script- By Dynamic Drive, available at: http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm
// Last updated: Jan 22nd, 2007
// -------------------------------------------------------------------

var thumbnailviewer={
enableTitle: true, //Should "title" attribute of link be used as description?
enableAnimation: true, //Enable fading animation?
definefooter: '<div class="footerbar">CLOSE X</div>', //Define HTML for footer interface
defineLoading: '<img src="loading.gif" /> loading ...', //Define HTML for "loading" div
//defineLoading: 'loading image...', //Define HTML for "loading" div

/////////////No need to edit beyond here/////////////////////////

scrollbarwidth: 16,
opacitystring: 'filter:progid:DXImageTransform.Microsoft.alpha(opacity=10); -moz-opacity: 0.1; opacity: 0.1',
targetlinks:[], //Array to hold links with rel="thumbnail"

createthumbBox:function(){
//write out HTML for Image Thumbnail Viewer plus loading div
document.write('<div id="thumbBox" onClick="thumbnailviewer.closeit()"><div id="thumbImage"></div>'+this.definefooter+'</div>')
document.write('<div id="thumbLoading">'+this.defineLoading+'</div>')
this.thumbBox=document.getElementById("thumbBox")
this.thumbImage=document.getElementById("thumbImage") //Reference div that holds the shown image
this.thumbLoading=document.getElementById("thumbLoading") //Reference "loading" div that will be shown while image is fetched
this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
},


centerDiv:function(divobj){ //Centers a div element on the page
var ie=document.all && !window.opera
var dom=document.getElementById
var scroll_top=(ie)? this.standardbody.scrollTop : window.pageYOffset
var scroll_left=(ie)? this.standardbody.scrollLeft : window.pageXOffset
var docwidth=(ie)? this.standardbody.clientWidth : window.innerWidth-this.scrollbarwidth
var docheight=(ie)? this.standardbody.clientHeight: window.innerHeight
var docheightcomplete=(this.standardbody.offsetHeight>this.standardbody.scrollHeight)? this.standardbody.offsetHeight : this.standardbody.scrollHeight //Full scroll height of document
var objwidth=divobj.offsetWidth //width of div element
var objheight=divobj.offsetHeight //height of div element
var topposition=(docheight>objheight)? scroll_top+docheight/2-objheight/2+"px" : scroll_top+10+"px" //Vertical position of div element: Either centered, or if element height larger than viewpoint height, 10px from top of viewpoint
divobj.style.left=docwidth/2-objwidth/2+"px" //Center div element horizontally
divobj.style.top=Math.floor(parseInt(topposition))+"px"
divobj.style.visibility="visible"
},

showthumbBox:function(){ //Show ThumbBox div
this.centerDiv(this.thumbBox)
if (this.enableAnimation){ //If fading animation enabled
this.currentopacity=0.1 //Starting opacity value
this.opacitytimer=setInterval("thumbnailviewer.opacityanimation()", 20)
}
},


loadimage:function(link){ //Load image function that gets attached to each link on the page with rel="thumbnail"
if (this.thumbBox.style.visibility=="visible") //if thumbox is visible on the page already
this.closeit() //Hide it first (not doing so causes triggers some positioning bug in Firefox
var imageHTML='<img src="'+link.getAttribute("href")+'" style="'+this.opacitystring+'" />' //Construct HTML for shown image
if (this.enableTitle && link.getAttribute("title")) //Use title attr of the link as description?
imageHTML+='<br />'+link.getAttribute("title")
this.centerDiv(this.thumbLoading) //Center and display "loading" div while we set up the image to be shown
this.thumbImage.innerHTML=imageHTML //Populate thumbImage div with shown image's HTML (while still hidden)
this.featureImage=this.thumbImage.getElementsByTagName("img")[0] //Reference shown image itself
this.featureImage.onload=function(){ //When target image has completely loaded
thumbnailviewer.thumbLoading.style.visibility="hidden" //Hide "loading" div
thumbnailviewer.showthumbBox() //Display "thumbbox" div to the world!
}
if (document.all && !window.createPopup) //Target IE5.0 browsers only. Address IE image cache not firing onload bug: panoramio.com/blog/onload-event/
this.featureImage.src=link.getAttribute("href")
this.featureImage.onerror=function(){ //If an error has occurred while loading the image to show
thumbnailviewer.thumbLoading.style.visibility="hidden" //Hide "loading" div, game over
}
},

setimgopacity:function(value){ //Sets the opacity of "thumbimage" div per the passed in value setting (0 to 1 and in between)
var targetobject=this.featureImage
if (targetobject.filters && targetobject.filters[0]){ //IE syntax
if (typeof targetobject.filters[0].opacity=="number") //IE6
targetobject.filters[0].opacity=value*100
else //IE 5.5
targetobject.style.filter="alpha(opacity="+value*100+")"
}
else if (typeof targetobject.style.MozOpacity!="undefined") //Old Mozilla syntax
targetobject.style.MozOpacity=value
else if (typeof targetobject.style.opacity!="undefined") //Standard opacity syntax
targetobject.style.opacity=value
else //Non of the above, stop opacity animation
this.stopanimation()
},

opacityanimation:function(){ //Gradually increase opacity function
this.setimgopacity(this.currentopacity)
this.currentopacity+=0.1
if (this.currentopacity>1)
this.stopanimation()
},

stopanimation:function(){
if (typeof this.opacitytimer!="undefined")
clearInterval(this.opacitytimer)
},


closeit:function(){ //Close "thumbbox" div function
this.stopanimation()
this.thumbBox.style.visibility="hidden"
this.thumbImage.innerHTML=""
this.thumbBox.style.left="-2000px"
this.thumbBox.style.top="-2000px"
},

cleanup:function(){ //Clean up routine on page unload
this.thumbLoading=null
if (this.featureImage) this.featureImage.onload=null
this.featureImage=null
this.thumbImage=null
for (var i=0; i<this.targetlinks.length; i++)
this.targetlinks[i].onclick=null
this.thumbBox=null
},

dotask:function(target, functionref, tasktype){ //assign a function to execute to an event handler (ie: onunload)
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype
if (target.addEventListener)
target.addEventListener(tasktype, functionref, false)
else if (target.attachEvent)
target.attachEvent(tasktype, functionref)
},

init:function(){ //Initialize thumbnail viewer script by scanning page and attaching appropriate function to links with rel="thumbnail"
if (!this.enableAnimation)
this.opacitystring=""
var pagelinks=document.getElementsByTagName("a")
for (var i=0; i<pagelinks.length; i++){ //BEGIN FOR LOOP
if (pagelinks[i].getAttribute("rel") && pagelinks[i].getAttribute("rel")=="thumbnail"){ //Begin if statement
pagelinks[i].onclick=function(){
thumbnailviewer.stopanimation() //Stop any currently running fade animation on "thumbbox" div before proceeding
thumbnailviewer.loadimage(this) //Load image
return false
}
this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link
} //end if statement
} //END FOR LOOP
//Reposition "thumbbox" div when page is resized
this.dotask(window, function(){if (thumbnailviewer.thumbBox.style.visibility=="visible") thumbnailviewer.centerDiv(thumbnailviewer.thumbBox)}, "resize")


} //END init() function

}

thumbnailviewer.createthumbBox() //Output HTML for the image thumbnail viewer
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load") //Initialize script on page load
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function validatesearch(){
	<!--- Validate form --->
	with (document.forms['searchform']){
		if (keywords.value.length <= 0) {alert('Please enter a search term.'); return false;}
		else {return true;}
	}
}
function validatefeedback(){
	<!--- Validate form --->
	with (document.forms['frmFeedback']){
		if (Full_Name.value.length <= 0) {alert('Please enter your First and Last Name.'); return false;}
		else if (Email.value.length <= 0) {alert('Please enter your Email Address.'); return false;}
		else if (Message.value.length <= 0) {alert('Please enter a Comment.'); return false;}
		else {return true;}
	}
}
function validateemailfriend(){
	<!--- Validate form --->
	with (document.forms['frmEmailfriend']){
		if (recipient.value.length <= 0) {alert('Please enter your Friend`s E-mail.'); return false;}
		else if (Name.value.length <= 0) {alert('Please enter Your Name.'); return false;}
		else if (Email.value.length <= 0) {alert('Please enter Your E-mail.'); return false;}
		else {return true;}
	}
}
function validatedonate(){
	<!--- Validate form --->
	with (document.forms['frmDonate']){
		if (accountID.value.length <= 0) {alert('Please select a Missionary or Ministry.'); return false;}
		else if (amount.value.length <= 0) {alert('Please enter the amount to be donated.'); return false;}
		else {return true;}
	}
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
