var iSEAQ = new iSEAQ_class()

function iSEAQ_class()
{
	// settings
	this.Delay = 500
	this.Current = -1

	// vars
	this.Kenmerk = new Array()

	// methods
	this.Init = function(nummer, link)
	{
		if (!this.Kenmerk[nummer])
		{
			this.Kenmerk[nummer] = new this.Kenmerk_Class(this, nummer, link)
		}
		else
		{
			if (link) this.Kenmerk[nummer].SetLink(link)
		}
	}
	
	this.Click = function(event, s, nummer)
	{
		var link = event.target ? event.target : event.srcElement
		link.blur()
		this.Init(nummer, link)
		
		if (this.Current != -1) this.Kenmerk[this.Current].Hide()
		this.Kenmerk[nummer].Show()
		this.Current = nummer
	}
	
	this.MouseOver = function(Element, nummer)
	{
		this.Init(nummer, null)
		this.Kenmerk[nummer].MouseOver()
	}
	
	this.MouseOut = function(Element, nummer)
	{
		this.Init(nummer, null)
		this.Kenmerk[nummer].MouseOut()
	}
	
	this.Hide = function(nummer)
	{
		this.Kenmerk[nummer].Hide()
	}
	
	this.Href = function()
	{
		// Dummy functie om de href te cancellen
	}
	
	this.Kenmerk_Class = function(parent, nummer, link)
	{
		this.Nummer = nummer
		this.Parent = parent
		this.Link = link
		
		this.LinkClass = (link?link.className:null)
		this.MainDiv = document.getElementById('iSEAQdiv' + this.Nummer)
		this.ShadowDiv = document.getElementById('iSEAQschaduw' + this.Nummer)
		this.iFrameDiv = null
		this.Shown = false
		this.Timeout = false
		
		this.SetLink = function(link)
		{
			if (!this.Link)
			{
				this.Link = link
				this.LinkClass = link.className
			}
		}
		
		this.Show = function()
		{
			this.Shown = true
		    y = 9
			if (navigator.userAgent.indexOf("MSIE") > -1) y = 23
			if (navigator.userAgent.indexOf("MSIE 7") > -1) y = 26
			
			this.MainDiv.style.left = '0px'
			this.MainDiv.style.top = y + 'px'
			this.MainDiv.style.display = 'block'
			
			this.ShadowDiv.style.left = '3px'
			this.ShadowDiv.style.top = (y+3) + 'px'
			this.ShadowDiv.style.width = this.MainDiv.clientWidth + 'px'
			this.ShadowDiv.style.height = this.MainDiv.clientHeight + 'px'
			this.ShadowDiv.style.display = 'block'
			
			// IE bug: over de <select> heen vallen graag.
			if ( navigator.userAgent.indexOf("MSIE 6.0") > -1 && this.iFrameDiv == null)
			{
			    this.iFrameDiv = document.createElement('DIV')
			    this.iFrameDiv.style.position = 'absolute'
			    this.iFrameDiv.innerHTML = '<iframe width="100%" height="100%"></iframe>'
			    this.MainDiv.parentElement.appendChild(this.iFrameDiv)
			//}
			//else
			//{
			//    this.iFrameDiv.style.display = 'block'
			//}
		    this.iFrameDiv.style.left = this.MainDiv.style.left
		    this.iFrameDiv.style.top = this.MainDiv.style.top
		    this.iFrameDiv.style.width = this.MainDiv.clientWidth + 'px'
		    this.iFrameDiv.style.height = this.MainDiv.clientHeight + 'px'
		    }
			this.Link.className = "iSEAQhover";
		}
		
		this.MouseOver = function()
		{
			if (this.Timeout) clearTimeout(this.Timeout)
		}
		
		this.MouseOut = function()
		{
			this.Timeout = setTimeout('iSEAQ.Hide(' + this.Nummer + ')', this.Parent.Delay)
		}
		
		this.Hide = function()
		{
			if (this.Shown == true)
			{
				this.Link.className = this.LinkClass
				this.MainDiv.style.display = 'none'
				this.ShadowDiv.style.display = 'none'
				if(this.iFrameDiv != null)
				{
				    this.iFrameDiv.style.display = 'none'
				}
			}
			this.Shown = false
		}
	}
	
}

