sfHover = function()
{
	var sfEls = document.getElementById("sucker").getElementsByTagName("LI");
	
	for(var i=0; i<sfEls.length; i++)
	{
		sfEls[i].onmouseover=function()
		{
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function()
		{
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
}

$(function() {
	
	//sfHover();
	
	$('li',$('#sucker')).hover(
	
		function () {
			//$('div#main').css({'position':'relative','z-index':'1'});
        	$(this).addClass('sfhover');//.parent().css({'z-index':'400000000'});
        	$('ul',$(this)).show();
      	}, 
      	function () {
        	$(this).removeClass('sfhover');
        	$('ul',$(this)).hide();
      	}
	
	);
	
	/*
	$('ul:first',$('#sucker li')).mouseover(function(){
		//alert('a');
		$(this).css({'left':'auto'}).parent('li').addClass('sfhover');
	});
	*/

});

if(window.attachEvent)
{
	//window.attachEvent("onload", sfHover);
}


function open_keyword_input(select,inputid)
{
	var opt_key = select.selectedIndex;
	var selected_value = select.options[opt_key].value;
	
	//alert(selected_value);
	
	if(selected_value != '')
	{
		show(inputid);
	}
	else
	{
		hide(inputid);
	}
}

function set_backgroundimage(id,path)
{
	if(oObj = document.getElementById(id))
	{	
		//alert(oObj.style.backgroundImage);
		oObj.style.backgroundImage = 'url('+path+')';
	}
}


function winopen(url, winname, width, height)
{
	var popup = window.open(url,winname,'toolbar=no,location=no,menubar=no,scrollbars=yes,width='+width+',height='+height+',resizable=yes,status=no');
	popup.focus();
}

function popup(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function toggle(sObjId)
{
	if(oObj = document.getElementById(sObjId))
	{	
		oObj.style.display = (oObj.style.display=='block') ? 'none' : 'block';
	}
}

function show(sObjId)
{
	if(oObj = document.getElementById(sObjId))
	{	
		oObj.style.display = 'block';
	}
}

function hide(sObjId)
{
	if(oObj = document.getElementById(sObjId))
	{	
		oObj.style.display = 'none';
	}
}

function jump(fe)
{
	var opt_key = fe.selectedIndex;
	var uri_val = fe.options[opt_key].value;
	fe.selectedIndex = 0;
	window.open(uri_val,'_top');
	return true;
}            


function check_this_form()
{
	if(typeof(check) === 'undefined'){
		
		return true;
		
	} else {
	
		args = check;//check_this_form.arguments;
		
		var ret = new Array();
		
		for (i=0; i<(args.length); i++)
		{	
			if((o = document.getElementById(args[i])) && args[i] != 'to')
			{
				if(o.value == '')
				{
					// fout
					o.style.backgroundColor = "#F21D8A";
					ret[ret.length] = false;
				}
				else
				{
					// goed
					o.style.backgroundColor = "#FFFFFF";
				}
			}
		}
		
		if(ret.length > 0)
		{
			if(o = document.getElementById('form_error_report'))
			{	
				o.className = 'form_error_report';
				o.innerHTML = 'De gemarkeerde velden zijn verplicht om in te vullen.';
			}
			
			return false;
		}
		else
		{
			return true;
		}
	
	} 
}

function submit_form(formname)
{
	//alert(document.forms[formname]);
	if(document.forms[formname])
	{
		document.forms[formname].submit();
	}
	else
	{
		
	}
}


function ShowOrHide(d1, d2) {

	  if (d1 != '') DoDiv(d1);

	  if (d2 != '') DoDiv(d2);

	}

	function DoDiv(id) {

	  var item = null;

	  if (document.getElementById) {

		item = document.getElementById(id);

	  } else if (document.all){

		item = document.all[id];

	  } else if (document.layers){

		item = document.layers[id];

	  }

	  if (!item) {

	  }

	  else if (item.style) {

		if (item.style.display == "none"){ item.style.display = ""; }

		else {item.style.display = "none"; }

	  }else{ item.visibility = "show"; }

 	}
 	
 	
function switchv(theTarget)
{
	var theLayer = $('#'+theTarget);
	var display = $(theLayer).css("display");
	
	if(display != 'block')
	{
		$(theLayer).css("display",'block');
		return false;
	}
	if(display != 'none')
	{
		$(theLayer).css("display",'none');
		return false;
	}
}