
	var intervalId; 

	function closeToolTip() { 
		$('crossToolTip').fade('out'); 
	}

		window.addEvent('domready',function() { 
                        
                        
                        ////// wes added @ jan 2010
                        $$('a[class=switchPrayer]').each( function( el ) {
                            el.addEvent('click', function( link ) {
                                link.preventDefault();
                                $$('p[class~=prayer]').each( function( prayer ) {
                                    //prayer.setStyle('display', 'none');
                                    prayer.removeClass('current');
                                });
                                var hash = el.href.split('#');
                                hash = hash[hash.length - 1];
                                $$('p[id=' + hash + ']').each( function( prayer ) {
                                    //prayer.setStyle('display', 'block');
                                    prayer.addClass('current');
                                });
                            });
                        });
                        
                        
                        
			$$('div[class=tabCont]').each(function(el) { 

				el.addEvent('click',function(e) { 
					var url = 'http://' + window.location.hostname + locationHash.get(this.id);  
					window.location.href= url; 
				}); 
			}); 

			//$('crossToolTip').set('opacity',0); 

			/*
			$('crossHitTestable').addEvent('mouseenter',function() { 
				$clear(intervalId); 
				$('crossToolTip').fade('in');     
			}); 

			$('crossHitTestable').addEvent('mouseleave',function() {                 
				intervalId = closeToolTip.delay(100); 
			}); 

			$('crossToolTip').addEvent('mouseenter',function() { 
				$clear(intervalId);  
			}); 

			$('crossToolTip').addEvent('mouseleave',function() { 
				intervalId = closeToolTip();  
			}); 
			*/

			var TabState = { 
				advocacy : { 
					isTabPendingClose : false
				},
				evangelism : { 
					isTabPendingClose : false
				},
				mission : { 
					isTabPendingClose : false
				},
				partnership : { 
					isTabPendingClose : false
				}
			}





			$$('div[class=tabCont]').each(function(el) { 
				el.style.height = '33px'; 

				el.addEvent('mouseenter',function() { 

					TabState[this.id].isTabPendingClose = false; 

					var tweenFx = new Fx.Tween(el, { 
						property : 'height',
						link : 'ignore',
						onStart : function() { 

						},
						onComplete : function() { 

							if(TabState[el.id].isTabPendingClose) 
							{ 
								el.fireEvent('mouseleave'); 
							}
						}

					});

					if(el.style.height.toInt()==33) 
					{
						tweenFx.start(216);
					}
				}); 


				el.addEvent('mouseleave',function() { 

					var tweenFx = new Fx.Tween(el, { 
						property : 'height',
						link : 'ignore'
					}); 

					if(el.style.height.toInt()==216) 
					{ 
						tweenFx.start(33); 
					}
					else 
					{ 
						TabState[this.id].isTabPendingClose = true;                         
					}
				}); 
			});     
		}); 