var nav_current = nav_hide_delay = null;

function init_menu(which)

{

	var li = document.getElementById(which).childNodes, i = li.length, a;

	while (i--)

	{

		a = li.item(i).firstChild;

		while (a != null && (a.nodeType != 1 || a.tagName.toLowerCase() != 'a')) a = a.nextSibling;

		if (a != null)

		{

			a.onmouseover = siteNavHover;

			a.onmouseout = siteNavHideCurrentDelay;

		}

	}

}



function siteNavHover()

{

	siteNavHideCurrent();

	var ul = this.nextSibling;

	while (ul != null && (ul.nodeType != 1 || ul.tagName.toLowerCase() != 'ul')) ul = ul.nextSibling;

	if (ul != null)

	{

		nav_current = ul;

		nav_current.style.visibility = 'visible';

		nav_current.onmouseover = siteNavHideClearDelay;

		nav_current.onmouseout = siteNavHideCurrentDelay;

	}

}



function siteNavHideCurrent()

{

	siteNavHideClearDelay();

	if (nav_current != null)

	{

		nav_current.style.visibility = 'hidden';

		nav_current = null;

	}

}



function siteNavHideCurrentDelay()

{

	nav_hide_delay = setTimeout('siteNavHideCurrent()', 500);

}



function siteNavHideClearDelay()

{

	if (nav_hide_delay != null)

	{

		clearTimeout(nav_hide_delay);

		nav_hide_delay = null;

	}

}

function ToggleLegendData(id)

{

	var el = document.getElementById(id);

	if (el.style.display == 'block')

	{
		el.style.display = 'none';
	}

	else

	{
		el.style.display = 'block';
	}

}

function ExternalForm() 

{ 

	document.forms['rentprosupport_form'].target = "_blank";
	
}

function Scrollbox(id)
				
{
	this.scrollbox;
	this.scrollboxStartY;
	this.scrollboxY;
	this.scrollboxHeight;
	this.scrollPaused = false;

	// constructor
	this.init(id);
}

Scrollbox.prototype =

{
	init: function(id)
	
	{
		if ((this.scrollbox = document.getElementById(id)))
		
		{
			this.scrollbox.parentNode.style.position = 'relative';
			this.scrollbox.parentNode.style.overflow = 'hidden';
			this.scrollboxStartY = this.scrollboxY = this.scrollbox.parentNode.clientHeight;
			this.scrollboxHeight = this.scrollbox.scrollHeight;
			this.scrollbox.style.position = 'absolute';
			this.scrollbox.style.top = this.scrollboxStartY + 'px';

			this.scrollbox.onmouseover = this.createHandler(this.pause);
			this.scrollbox.onmouseout = this.createHandler(this.unpause);
			setInterval(this.createHandler(this.scroll), 100);
		}
	},
	
	scroll: function()
	
	{
		
		if (!this.scrollPaused)
		
		{
		
			this.scrollboxY -= 2;
			if (this.scrollboxY < -this.scrollboxHeight) this.scrollboxY = this.scrollboxStartY;
			this.scrollbox.style.top = this.scrollboxY + 'px';
		
		}
	
	},
	
	pause: function()
	
	{
		
		this.scrollPaused = true;
	
	},
	
	unpause: function()
	
	{
	
		this.scrollPaused = false;
	
	},
	createHandler: function(method)
	{
		var self = this;
		return function(e) { method.call(self, e); }
	}
}

function ExternalLinks() 
{
	if (!document.getElementsByTagName) return;
	
	var anchors = document.getElementsByTagName("a");
	
	for (var i=0; i<anchors.length; i++) 
		{
			var anchor = anchors[i];
			if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
				anchor.target = "_blank";
		}
}

function SubmitSubscribeRequest(form,helperMsg)
{
	var fields = document.getElementById('name');
	var fields2 = document.getElementById('surname');
	var fields3 = document.getElementById('email');
	
	if  (  	(fields.value.length == 0) 
			|| 
			(fields2.value.length == 0) 
			||
			(fields3.value.length == 0) 
		)
	{
		alert(helperMsg);
		return false;
	} 
	else
	{
		document.forms[form].submit();
	}
}

//stats
var a_vars = Array();
var pagename = document.title;

var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.carprosystems.nl/stats/phpmyvisites.php";