var ShBoxOptions = {
		language:				'nl',
		counterType:			'skip',//'default',//'skip',
		overlayOpacity:	   		'0.6',
		//handleUnsupported:  	'remove',
		//onFinish:				galleryElemDesc,
		initialHeight:			'450',//'160',
		initialWidth:			'550',//'320',
		resizeDuration:			'0.2',//'0.55',
		fadeDuration:			'0.15',//'0.35',
		animSequence:			'sync',//'wh',
		handleOversize:			'resize',//'drag',
		continuous:				true,
		flvPlayer:				'gui/media/mediaplayer2.swf'
};
// Shadowbox start
Shadowbox.init(ShBoxOptions);

// ronde hoekjes
$(document).ready(function()
{
	$(".corner").corner("cc:#FFF").corner("cc:#FFF");
});

// popup route
$(document).ready(function()
{
	$(".webmapper").click(function() {
		var width = 630;
		var url = $(this).attr('href');
		var win = window.open(url, '_blank', 'width=' + width +
		',height=410,menubar,resizable,status,location,toolbar,scrollbars');
		if (win && win.focus) {
			win.focus();
			return false;
		} else {
			win = null
			return true;
		}
	});
});



$(document).ready(function()
{
	startList();
	initsize();
	
	// kaartje plaatsnamen
	
	$("map area").tooltip({
		track:true,
		delay: 0,
		showURL: false,
		fade:250
	});
	
	
	
	/*
	// vacature klapper
	$(".vacancy_entry td div.moreinfo").hide();
	$(".vacancy_entry td p.vacancylead").append("<span class='showmore'> <a href='#'><b>Lees meer &gt;</b></a></span>");
	$(".showmore a").click(function(){
		$(this).parent().hide("fast",function(){
			$(this).parent().next().next().next().fadeIn("slow");
		});
		return false;
	});
	*/
	
});

/*
// ronde hoekjes nog een keer voor safari
$(document).ready(function()
{
	$(".corner").corner("cc:#FFF");
});
*/

// variable forms check
function varformcheck(id)
{
	//return true;
	
	args = eval('check_' + id);
	
	var ret = new Array();
	
	for (i=0; i<(args.length); i++)
	{
		//alert( args[i] );
		
		// checkboxes
		if( $('input:checkbox',$('fieldset#' + args[i],$('form#' + id))).length ){
			if( $('input:checkbox:checked',$('fieldset#' + args[i],$('form#' + id))).length )
			{
				
				// goed
				$('fieldset#' + args[i],$('form#' + id)).removeClass('invalid');
			} 
			else 
			{
				// fout
				$('fieldset#' + args[i],$('form#' + id)).addClass('invalid');
				ret[ret.length] = 0;
			}
		}
		
		// other inputs
		inputfld = $(':input[name=' + args[i] + ']',$('form#' + id));
		inputval = $(inputfld).val();
		
		//alert( input.length );
		
		if( inputfld.length )
		{
			//alert( inputval );
			
			if( inputval == '' )
			{
				// fout
				$(inputfld).addClass('invalid');
				ret[ret.length] = 0;
			}
			else
			{
				// goed
				$(inputfld).removeClass('invalid');
			}
		}
		
	}
			
	if(ret.length > 0)
	{
		$('.form_error_report',$('form#' + id)).html('De gemarkeerde velden zijn verplicht om in te vullen.');
		return false;
	}
	else
	{
		return true;
		//return false;
	}
}
