var content_moving = false;

function move_media_gallery(moving_div, showing_div, direction_left_right, direction_up_down ) {
	// moving div propertys 
	//alert(parseInt($('moving_general').offsetWidth));
	//alert(parseInt($('moving_general').offsetHeight));
	
	var height_div = parseInt($(moving_div).offsetHeight);
	var width_div = parseInt($(moving_div).offsetWidth);
		
	// if gallery is moving stop else set time out for moving gallery
	if (content_moving) return;
    content_moving = true;
    setTimeout('content_moving = false;', 600);
	 
	// get left , top pos 
	var left_pos = parseInt($(moving_div).style.left);
	var top_pos = parseInt($(moving_div).style.top);
	
	// bereken te bewegen afstand 
	var distance = parseInt($(showing_div).style.width);
	var distance_up = parseInt($(showing_div).style.height);

	// dont move outside of range left right
	if (direction_left_right != 0){
		if (direction_left_right == 1 && left_pos >= 0){ return }
		else if (direction_left_right == -1 && left_pos <= -1 * width_div + distance){ return }

		Effect.MoveBy(moving_div, 0, distance * direction_left_right, { duration: 0.5} );
	}
	                
	// dont move outside of range up  down
	if(direction_up_down != 0){
		if (direction_up_down == 1 && top_pos >= 0){ return; }
		if (direction_up_down == -1 && top_pos <= -1 * height_div + distance_up){ return; }
	
		Effect.MoveBy(moving_div , distance_up * direction_up_down, 0, { duration: 0.5 } );
	}
}

function show_vacatures(id, form){
	
	
	new Ajax.Updater(
		'vacature_gegevens', 
		'site/vacatures.php',
		{
			method: 'post',
			parameters: 'vacature_id='+id+'&form='+form,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true
		});
}

function show_nieuws(id){

	//alert(id);

	new Ajax.Updater(
		'nieuws_items', 
		'site/nieuws_item.php',
		{
			method: 'post',
			parameters: 'nieuws_id='+id,
			requestHeaders: ['Expires', 'Thu, 17 May 2001 10:17:17 GMT', 'Cache-Control', 'no-cache, must-revalidate', 'Pragma', 'no-cache'],
			evalScripts: true
		});
}


/* SHOW HIDE */


function showHide(target_id) {
	Effect.toggle( target_id ,'slide');
} 






