cur_id = 0;

function loadProjectInfo(id, projects){
	
	if(cur_id != id){
		
		cur_id = id;
		
		$('#hover_info').html('Projectinformatie aan het ophalen.');
		
		
		urlDataString = '/project_details.php?project_id=' + id;
		
		if(projects == 'geo')
			urlDataString += '&geo=true'
		else if(projects != true)
			urlDataString += '&pub=true';
		
		$.ajax({ 
			url : urlDataString,
			dataType: 'script',
			scriptCharset: 'ISO-8859-1'
		});
		
		
		// $.ajax({ 
			// url : urlDataString,
			// dataType: 'html',
			// success: function(html){
				// $("#hover_info").html(html);
			// }
		// });
	}
	
}

function next(curel){
	
	c_picture = $('#pictures img:visible');
	
	id = getPicArrayIdentifier(c_picture.attr('src'));
	id++;
	
	h_picture = $('#pic_' + id);
	
	if(id < imagepool.length){
		c_picture.hide('slide', {direction : 'left'}, 'normal', function (){
			h_picture.show('slide', {direction : 'right'}, 'normal');
		});
		$('#link_prev').removeClass("not_active");
		if(id == imagepool.length - 1)
			$('#link_next').addClass("not_active");
	} 
}

function prev(curel){
	
	c_picture = $('#pictures img:visible');
	
	id = getPicArrayIdentifier(c_picture.attr('src'));
	id--;

	h_picture = $('#pic_' + id);

	if(id >= 0){
		c_picture.hide('slide', {direction : 'right'}, 'normal', function (){
			h_picture.show('slide', {direction : 'left'}, 'normal');
		});
		$('#link_next').removeClass("not_active");
		if(id == 0)
			$('#link_prev').addClass("not_active");
	} 
}



function getPicArrayIdentifier(cur_src){
	for(i = 0 ; i < imagepool.length ; i++)
		if(imagepool[i] == cur_src)
			return i;
}

function changeRegio (bg){
	
	$('#main').css('background-image', 'url("/img/bg/geografie/' + bg + '")');
	
}


