$(function()
{
    var active = false;

	$("div.scrollrechts").mouseover(function ()
	{
		if (!active) 
		{
			active = !active;
			$("div.dias").everyTime(60, 'controlled', function() 
			{
				$("div.dias").scrollLeft($("div.dias").scrollLeft()+25);
			}
			)
		}
	});

	$("div.scrollrechts").mouseout(function ()
	{
		if (active) 
		{
			active = !active;
			$("div.dias").stopTime('controlled');
		}
	});

	$("div.scrolllinks").mouseover(function ()
	{
		if (!active) 
		{
			active = !active;
			$("div.dias").everyTime(60, 'controlled', function() 
			{
				$("div.dias").scrollLeft($("div.dias").scrollLeft()-25);
			}
			)
		}
	});

	$("div.scrolllinks").mouseout(function ()
	{
		if (active) 
		{
			active = !active;
			$("div.dias").stopTime('controlled');
		}
	});
});

function scrollrechts()
{
  $("div.dias").scrollLeft($("div.dias").scrollLeft()+500);
}

function scrolllinks()
{
  $("div.dias").scrollLeft($("div.dias").scrollLeft()-500);
}

function hoofd_foto_zetten(p_id)
{
	oldWidth = $('#td_img').height();
	$('#td_img').height(oldWidth);	
	$("#hoofdimg").fadeOut(100, function()
		{			
            pl_image_url = document.getElementById('image_url').value;
            pl_image_url = pl_image_url.replace("#1",p_id);
            pl_image_url = pl_image_url.replace("#2",'550');
			$("#hoofdimg").attr("src",pl_image_url).load(function() {
				$("#hoofdimg").fadeIn(100);
			})
			
		}
	);    
}

function eerste_keer_selecteren(id)
{	
    if (document.getElementById('pixels'))	
	{
		pixels2 = document.getElementById('pixels').value;
		$("div.dias").scrollLeft($("div.dias").scrollLeft()+(pixels2-$('#dias').width()/2));//aantal_tumb*tumb_breedte);
	}
}

function f_mode(waarde)
{
    $('#mode').val(waarde);
}

function f_del_foto(waarde)
{
    $('#del_'+waarde).val('J');
    $('#rij_'+waarde).fadeOut(100);
}

