// JavaScript Document
$(document).ready(function(){
	var i = 0;
	$("div.overout").mouseover(function(){
		
	}).mouseout(function(){
		
	});

	var n = 0;
	$(".FlyoutContainer").bind("mouseenter",function(){
		if ( Flyout.CloseTimeout ){
			clearTimeout ( Flyout.CloseTimeout ) ;
			Flyout.CloseTimeout = false ;
		}
	}).bind("mouseleave",function(eventObject){
		if ( $(this).context.parentNode.id != "FlyoutContainer" ) {
			Flyout.CloseFlyout();
			eventObject.stopPropagation();
		}
	});
});
  
var Flyout = new Object ( );
	Flyout = {
	FlyoutCount : 1,
	WatchDog : 0,
	CloseTimeout:false,
	AnimationWatchDog : 0,
	AnimationSteps : 5,
	Obj : null,
	Visible:false,
	Flyout : function ( ) {},
	DoFlyout : function ( doflyout ) {
		this.Obj	= document.getElementById ( 'FlyoutContainer' ) ;
		if ( this.Obj ) {
			if ( doflyout ) {
				this.Obj.style.display = "block" ;
				this.Obj.style.zIndex = "1000" ;
				this.Visible = true ;
/*				if ( this.WatchDog == 0 ) {
					this.FlyoutCount = 20 ;
					this.WatchDog = setInterval('Flyout.Timeout()', 100);
				}*/
			} else {
				this.Visible = false ;
				this.Obj.style.display = "" ;
				this.Obj.style.zIndex = "-1" ;
			}
		} else {
			//alert ( "Flyout does not exist" ) ;
		}
	},
	CloseFlyout:function(){
		if ( this.CloseTimeout ){
			this.CloseTimeout = false ;
		}
		this.Obj = document.getElementById ( 'FlyoutContainer' ) ;
		if ( this.Obj && this.Visible ) {
				this.Obj.style.display = "" ;
				this.Obj.style.zIndex = "-1" ;
				this.Visible = false ;
		}
	},
	TimeCloseFlyout:function(){
		if ( !this.CloseTimeout && this.Visible){
			this.CloseTimeout = setTimeout ( "Flyout.CloseFlyout()", 500 ) ;
		}
	},
	Monitor: function ( evt ) {
		var IE = false ;
		var backObj = document.getElementById ( 'back-wrap' ) ;
		
		if(navigator.appName == "Microsoft Internet Explorer")
		myobj = 
		IE = true;
		if(IE)
		{
			x = evt.clientX + ( document.body.scrollLeft-backObj.offsetLeft);
			y = evt.clientY + document.body.scrollTop;
		}
		else
		{
			x = evt.pageX - backObj.offsetLeft;
			y = evt.pageY ;
		}

	},
	Timeout : function  ( evt ){
		var IE = false ;
		var backObj = document.getElementById ( 'back-wrap' ) ;
		if(navigator.appName == "Microsoft Internet Explorer")
		IE = true;
		if(IE)
		{
			if ( evt && document.body.scrollLeft && backObj ) {
			x = evt.clientX + document.body.scrollLeft - backObj.offsetLeft;
			y = evt.clientY + document.body.scrollTop;
			}
		}
		else
		{
			x = evt.pageX - backObj.offsetLeft;
			y = evt.pageY;
		}
		this.FlyoutCount -- ;
		if ( x <= 210 || x >= 945 || y <= 95 || y > 530){
			clearInterval ( this.WatchDog ) ;
			this.WatchDog = 0 ;
			this.AnimationSteps = 5 ;
			if ( this.AnimationWatchDog == 0 ) {
				this.AnimationWatchDog = setInterval('Flyout.Animate()', 100);
			} else {
				this.Obj.style.display = "" ;
			}
		}
	},

	Animate : function  ( ) {
		this.AnimationSteps -- ;
		if ( this.AnimationSteps <= 0 ) {
			clearInterval ( this.AnimationWatchDog ) ;
			this.AnimationWatchDog = 0 ;
			this.Obj.style.display = "" ;
			this.Obj.style.zIndex = "-1" ;
			this.Obj.style.opacity =  1 ;
			this.Obj.style.mozOpacity = 1 ;
		} else {
			this.Obj.style.opacity = this.AnimationSteps / 5 ;
			this.Obj.style.mozOpacity = this.AnimationSteps / 5 ;
		}
	},
	Reset : function ( ) {
		this.FlyoutCount = 20 ;
	}
};