

	var intervalId; 

	function closeToolTip() { 
		$('crossToolTip').fade('out'); 
	}

		window.addEvent('domready',function() { 

			$$('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 = '54px'; 

				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()==54) 
					{
						tweenFx.start(267);
					}
				}); 


				el.addEvent('mouseleave',function() { 

					var tweenFx = new Fx.Tween(el, { 
						property : 'height',
						link : 'ignore'
					}); 

					if(el.style.height.toInt()==267) 
					{ 
						tweenFx.start(54); 
					}
					else 
					{ 
						TabState[this.id].isTabPendingClose = true;                         
					}
				}); 
			});     
		}); 