// JavaScript Document
// Contains: PreLoad, Switch Image, Detail ToolTip, emailTo,
// Menu Template VERTICAL, Menu Template HORIZONTAL, Menu Items, Menu.js


// Preload
// page's body tag to have -> onload="Preload( 'IMG URL1', 'IMG URL2' )" - Two Shown, Can Be More
function Preload()
{ 
  var args = Preload.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];
  }
}


// Switch Image
var img_count=1  
function switchImage(object_name,img_group,img_type,num_images) 
{ 
  if (document.images)
  {
    if (img_count<num_images) 
      {	    
	  img_count++
	  source_name= img_group+img_count+"."+img_type
	  document.images[object_name].src = source_name;
	  return
	  }
	  
	  {
      img_count=1
	  source_name= img_group+img_count+"."+img_type
	  document.images[object_name].src = source_name;
	  return
	  }	
	  
	}
  }


// Detail ToolTip
/***********************************************
* Fixed ToolTip script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
// Script Call from web page is: <a href="ENTER HREF HERE, OR DELETE THE HREF="" IF NONE" onMouseover="fixedtooltip('ENTER TOOLTIP TEXT AND TAGS FOR<b>WANTED TOOLTIP</b> DISPLAY', this, event, '150px')" onMouseout="delayhidetip()">ENTER LINK TEXT HERE</a>
// where the first parameter of "fixedtooltip()" is the tooltip text, and the final parameter ("150px"),
// which is an optional string you pass in to modify this particular tooltip's width, if different from the default tooltip width.
// Enter a blank string instead ("") if the tooltip width will be the same as the default width specified in the global variable
// near the top of the script.
	
var tipwidth='150px' //default tooltip width
var tipbgcolor='lightyellow'  //tooltip bgcolor
var disappeardelay="250"  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="10px" //horizontal offset of tooltip from anchor link
var horizontal_offset="0px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(menucontents, obj, e, tipwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidetip()
dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
dropmenuobj.innerHTML=menucontents

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
}

function hidetip(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidetip(){
if (ie4||ns6)
delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}


// Email To
function email(where)
{
if (where=="office") office()
if (where=="cs") officeCareandShare()
if (where=="pr") officePrayerRequest()
if (where=="manager") manager()
if (where=="ppsubscribe") ppsubscribe()
if (where=="pastor") pastor()
if (where=="beacon") beacon()
}
function office()
{             
self.location="mailto:office.dundeeumc@verizon.net"
}
function officeCareandShare()
{
self.location="mailto:office.dundeeumc@verizon.net?subject=Caring and Sharing"
}
function officePrayerRequest()
{
self.location="mailto:office.dundeeumc@verizon.net?subject=Prayer Request"
}
function manager()
{
self.location="mailto:Site Manager <webmaster.dundeeumc@verizon.net>?Subject=Dundee UMC Web Site"
}
function ppsubscribe()
{
alert ('The Email address used will be the one shown in the FROM field of this request. If you want a different address used, please type it in the body of the message')	
self.location="mailto:pastorpage.dundeeumc@verizon.net?subject=Pastor's Page Subscription Request&body=Please add me to the Pastor's Page Email Subscribers list."
}
function pastor()
{             
self.location="mailto:Rev. Doug <revolsen.dundeeumc@verizon.net>"
}
function beacon()
{             
self.location="mailto:Mary Sandefur <beacon.dundeeumc@verizon.net>"
}

// Menu Template - VERTICAL
/* Tigra Menu template structure */
var MENU_TPL_VERTICAL = [
	{
		'width': 90,
		'height': 24,
		'left': 0,
		'top': 25,
		'hide_delay': 500,
		'expd_delay': 200,
		'css': {
			'inner': 'TM0i0',
			'outer': ['TM0o0','TM0o1']
		},
		'block_left': 50,
		'block_top': 20
	},
/* Sub Menu Blocks */
	{
		'width': 120,
		'block_left': 88,
		'block_top': 1,
		'left': 0,
		'top': 25,
		'css': {
			'inner': 'TM0i0',
			'outer': ['TM1o0','TM1o1']
		}
	}
];




// Menu Template - HORIZONTAL
/* Tigra Menu template structure */
var MENU_TPL_HORIZONTAL = [
	{
		'width': 94,
		'height': 24,
		'left': 93,
		'top': 0,
		'hide_delay': 200,
		'expd_delay': 200,
		'css': {
			'inner': 'TM0i0',
			'outer': ['TM0o0','TM0o1']
		},
		'block_left': 50,
		'block_top': 20
	},
/* Sub Menu Blocks */
	{
		'width': 120,
		'block_left': 0,
		'block_top': 25,
		'left': 0,
		'top': 23,
		'css': {
			'inner': 'TM0i0',
			'outer': ['TM1o0','TM1o1']
		}
	}
];



// Menu Items
/* Tigra Menu items structure */
var MENU_ITEMS = [
	['&#8226; Home', 'index.htm'],
	['About Us', null, null,
        ['&#8226; Maps & Directions', 'map.php'],
		['&#8226; Our Role', 'us.php'],
        ['&#8226; History', 'history.php'],
        ['&#8226; Opportunities', 'opportunities.php'],		
        ['&#8226; Contact Us', 'contact_info.php']
	],
	['Events', null, null,
		['&#8226; Event Calendars', 'events.php']/*,
		['&#8226; Worship Schedule', 'schedule.shtm']*/
	],
	['Church News', null, null,
		['&#8226; Pastor\'s Page', 'pastor.php'],
		['&#8226; The Beacon', 'beacon.php']
	],
	['Missions', null, null,
		['&#8226; A "Thank You"', 'missions.php'],
		['&#8226; Caring & Sharing', 'caring_sharing.php']
	],
    ['Ministries', null, null,
		['&#8226; Sermon Library', 'sermon_library.php']
	],
	['Groups', null, null,
		['&#8226; Fun & Fellowship', 'fun_fellowship.php'],
        ['&#8226; Movie Club', 'movie_schedule.php'],		
		['&#8226; UMW', 'umw.php']
	],
	['&#8226; Resources', 'links.php']
];







//Menu.js
// Title: Tigra Menu (v2.1 06/26/2007)
// URL: http://www.javascript-menu.com/
// Tech. Support: http://www.softcomplex.com/forum/forumdisplay_29/
// Notes: This script is free. Visit official site for further details.

var A_MENUS=[];function menu(F,I){if(!document.body||!document.body.style)return;this.B=F;this.I=I;this.b=A_MENUS.length;this.D=[];this.A=[];this.expand=R;this.collapse=Q;this.onclick=T;this.onmouseout=V;this.onmouseover=W;this.onmousedown=U;this.J={'block_top':16,'block_left':16,'top':20,'left':4,'width':120,'height':22,'hide_delay':0,'expd_delay':0,'css':{'inner':'','outer':''}};this.O=function(p){return this.J[p];};this.n=this;this.a=-1;this.g=0;this.h=0;for(c=0;c<F.length;c++)new S(this,c);A_MENUS[this.b]=this;for(var c=0;c<this.A.length;c++)this.A[c].N.style.visibility='visible';}function Q(b){clearTimeout(this.o);var f=(b?this.D[b].a:0);for(b=0;b<this.D.length;b++){var j=this.D[b];if(j.a>f&&j.L){j.N.style.visibility='hidden';j.L=false;}}if(!b)this.i=null;}function R(b){if(this.k)return;var l=this.D[b];if(this.i&&this.i.a>=l.a)this.collapse(l.b);this.i=l;if(!l.A)return;for(var c=0;c<l.A.length;c++){var j=l.A[c];j.N.style.visibility='visible';j.L=true;}}function T(b){var l=this.D[b];var q=l.B[1];if(!q)return true;if(String(q).toLowerCase().indexOf('javascript:')==0)return eval(q);if(l.B[2]&&l.B[2]['tw'])window.open(q,l.B[2]['tw']);else window.location=q;return true;}function V(b){var l=this.D[b];l.N.className=l.P(0,0);l.M.className=l.P(1,0);l.s(7);this.k=setTimeout('A_MENUS['+this.b+'].collapse();',l.O('hide_delay'));}function W(b){clearTimeout(this.k);this.k=null;clearTimeout(this.o);var l=this.D[b];l.s();l.N.className=l.P(0,1);l.M.className=l.P(1,1);if(l.O('expd_delay')<0)return;this.o=setTimeout('A_MENUS['+this.b+'].expand('+b+');',l.O('expd_delay'));}function U(b){var l=this.D[b];l.N.className=l.P(0,2);l.M.className=l.P(1,2);this.expand(b);}function S(m,c){this.a=m.a+1;this.B=m.B[c+(this.a?3:0)];if(!this.B)return;this.n=m.n;this.m=m;this.c=c;this.b=this.n.D.length;this.n.D[this.b]=this;m.A[c]=this;var n=this.n,I=this.n.I;this.O=X;this.P=Y;this.s=Z;this.g=c?m.A[c-1].g+this.O('left'):m.g+this.O('block_left');this.h=c?m.A[c-1].h+this.O('top'):m.h+this.O('block_top');document.write('<div id="e',n.b,'_',this.b,'o" class="',this.P(0,0),'"',(this.B[2]&&this.B[2]['tt']?' title="'+this.B[2]['tt']+'"':''),' style="position:absolute;top: ',this.h,'px;left:',this.g,'px;width:',this.O('width'),'px;height:',this.O('height'),'px;visibility:hidden;',' z-index: ',this.a,';cursor:',(this.B[1]?'pointer':'default'),'" ','onclick="return A_MENUS[',n.b,'].onclick(',this.b,');" onmouseout="A_MENUS[',n.b,'].onmouseout(',this.b,');" onmouseover="A_MENUS[',n.b,'].onmouseover(',this.b,');" onmousedown="A_MENUS[',n.b,'].onmousedown(',this.b,');"><div id="e',n.b,'_',this.b,'i" class="',this.P(1,0),'">',this.B[0],"</div></div>");this.M=document.getElementById('e'+n.b+'_'+this.b+'i');this.N=document.getElementById('e'+n.b+'_'+this.b+'o');this.L=!this.a;if(this.B.length<4)return;this.A=[];for(var c=0;c<this.B.length-3;c++)new S(this,c);}function X(p){var r=null,G=this.n.I[this.a];if(G)r=G[p];return(r==null?this.m.O(p):r);}function Y(d,e){var C=this.O('css');var H=C[d?'inner':'outer'];if(typeof(H)=='string')return H;for(var _=e;_>=0;_--)if(H[_])return H[_];}function Z(K){window.setTimeout("window.status=unescape('"+(K?'':(this.B[2]&&this.B[2]['sb']?escape(this.B[2]['sb']):escape(this.B[0])+(this.B[1]?' ('+escape(this.B[1])+')':'')))+"')",10);}




