var clickmessage="Powered by ProAdmin Content Management"
		
function disableclick(e) 
{
	if (document.all) 
	{
		if (event.button==2||event.button==3) 
		{
			if (event.srcElement.tagName=="IMG")
			{
				alert(clickmessage);
				return false;
			}
		}
	}
	else if (document.layers) 
	{
		if (e.which == 3) 
		{
			alert(clickmessage);
			return false;
		}
	}
	else if (document.getElementById)
	{
		if (e.which==3&&e.target.tagName=="IMG")
		{
			alert(clickmessage)
			return false
		}
	}
}

function associateimages(){
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}
/*
if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()
*/
function switchDisplay(id)
{
	if(document.getElementById(id).style.display == 'block')
	{
		document.getElementById(id).style.display = 'none';
	}
	else
	{
		document.getElementById(id).style.display = 'block';
	}

}

	$(document).ready(function() {
		
			
		$('.submenu:has(a)').each(function(){
		
			var link = $(this).prev('.sub');
			var menu = $(this);
			var attr = $(menu).children();
			var timeout;
			var position = link.position();
			var shown = false;
			var opa = '';
			
			$(link).add(menu).mouseover(function()
			{
				clearTimeout(timeout);
				
				if(shown == false)
				{
					showMenu();
				}
		 
			}).mouseout(function()
			{
				clearTimeout(timeout);
				timeout = setTimeout( function(){hideMenu();}, 300);
			});
			
			$('body').children().not(link).not(menu).click(function()
			{
				hideMenu();
			});
			
			function hideMenu()
			{
				shown = false;
				$(menu).slideUp(200, function(){$(this).css('display', 'none');});
				
			}
			function showMenu()
			{
				shown = true;
				$(menu).slideDown(200);
			}
			
		});
		
		
		var defaultValue = "Zoeken...";
		
		$('#zoekform #tekst').each(function(){
		
			$(this).attr('value', defaultValue);
			$(this).css('color', "gray");
			
			$(this).focus(function()
			{
				$(this).attr('value', "");
				$(this).css('color', "black");
			});
			
			$(this).blur(function(){
				if($(this).attr('value') == "")
				{
					$(this).attr('value', defaultValue);
					$(this).css('color', "gray");
				}
				else
				{
					$(this).parents('form').first().submit();
				}
			});
		
		});
		
	
		$('#zoekform').submit(function(event){
			elem = document.forms['zoekform'].tekst;
			if(!elem.value || elem.value == defaultValue)
			{
				event.preventDefault();
				return false;
			}
			
			return true;
		});
		
	});

	function fancyIze(frm)
	{
		$('input:visible', frm).each(function(){
			
				var field = $(this).clone();
				var zoekenbox = document.createElement('div');
				var zoekenboxleft = document.createElement('div');
				var zoekenboxright = document.createElement('div');
				var zoekenboxmiddle = document.createElement('div');

				$(zoekenboxleft).addClass('zoeken-box-left');
				$(zoekenboxright).addClass('zoeken-box-right');
				$(zoekenboxmiddle).addClass('zoeken-box-middle');
				$(zoekenbox).addClass('zoeken-box');

				zoekenbox.appendChild(zoekenboxleft);
				zoekenbox.appendChild(zoekenboxmiddle);
				zoekenbox.appendChild(zoekenboxright);
				
				$(this).replaceWith(zoekenbox);
				$(field).appendTo(zoekenboxmiddle);
			});
	}