// HOME

function playmusic(){
	document.getElementById('music').innerHTML = "<iframe src='/sundays/worship.mp3' height='0' width='0' frameborder='0' border='0'></iframe>";
}

function mtext(thetext){
	document.getElementById("mtext").innerHTML = thetext;
}

var myimages=new Array()

	function preloadimages(){
	for (i=0;i<preloadimages.arguments.length;i++){
	myimages[i]=new Image();
	myimages[i].src=preloadimages.arguments[i];
	}
	}

	preloadimages('/img/guests_tab_o.jpg', '/img/family_tab_o.jpg');


function stshow(obj){
	document.getElementById(obj).style.display = 'block';
}
function sthide(obj){
	document.getElementById(obj).style.display = 'none';
}

function sttoggle(obj){
	if(document.getElementById(obj).style.display == "none"){
		stshow(obj);
	}
	else{
		sthide(obj);
	}
}


function menuTab(obj){

	if(obj == "family"){ var oth = "guests";}
	else{ var oth = "family"; }

	document.getElementById(obj+"_tab").src = "/img/" + obj + "_tab_o.jpg";
	document.getElementById(oth+"_tab").src = "/img/" + oth + "_tab.jpg";

	document.getElementById(obj+"_tab").onmouseout = function(){ document.getElementById(obj+"_tab").src = "/img/" + obj + "_tab_o.jpg"; };
	document.getElementById(oth+"_tab").onmouseout = function(){ document.getElementById(oth+"_tab").src = "/img/" + oth + "_tab.jpg"; };

	stshow(obj+"_menu");
	sthide(oth+"_menu");

}




function SimpleSwap(el,which){
  el.src=el.getAttribute(which || "origsrc");
}

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
      
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}

var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup(); Shadowbox.init();}
