
var temp = "";
var pag = 1;
var total_pages = 0;
$(document).ready(function(){
  
	
		
	//$('#photo_album a').not(".car_con").lightBox({fixedNavigation:true});
	$('a.biga').lightBox({fixedNavigation:true});
	
	
	$('#photo_album a').not(".car_con").each(function(){
	$(this).click(function(act){
		act.preventDefault();
		var img = $(this).attr("href");
		var the_id = $(this).attr("the_id");
		var title = $(this).children("img").attr("alt");
		var img2 = img.replace("&w=480&h=320","&w=800&h=600");
		$("#fotoId").html("<a  class='main_photo biga' title='"+title+"' href='"+img2+"'><img border='0' src='"+img+"' TITLE='"+title+"'/></a>");
		//call the init boxover function
		//$("#odv").remove();
		//init();
		
		//remove the current pic from the hidden ones
		$("#"+the_id).attr("class","not_biga");
		//re-call the lightbox function
		$('a.biga').lightBox({fixedNavigation:true});
		$("#"+the_id).attr("class","biga");
		
		
		
		
		
	});
	});
	
	//click the first item
	var jj = $("a.lyte_link")[0];
	if($(jj).length) $(jj).click();
		
});
function mycarousel_initCallback(carousel) {
    jQuery('a.car_con').bind('click', function() {
		var pagi = jQuery.jcarousel.intval(jQuery(this).attr("pag"));
		pag = ((pagi - 1)/4) + 1;
        carousel.scroll(pagi);
		jQuery('a.car_con').children("span").css("color","#FFF");
		jQuery(this).blur().children("span").css("color","#000");
        return false;
    });



	$('.jcarousel-next').click(function() {
	if (pag > 0 && pag <total_pages)
	 {
		pag++;
		
		jQuery('a.car_con').children("span").css("color","#FFF");
		jQuery('#pag' + pag).children("span").css("color","#000");
	}
	});	


$('.jcarousel-prev').click(function() {
	if (pag > 1 && pag <=total_pages) {
		pag--;
		
		jQuery('a.car_con').children("span").css("color","#FFF");
		jQuery('#pag' + pag).children("span").css("color","#000");
	}	
});

};
var menu_obj = null;
var sub_menu_obj = null;

function checkHover()
{
	if(sub_menu_obj==null)
		$(".menu_holder").slideUp(200);
		
}
function checkHover2()
{
	if(menu_obj==null)
		$(".menu_holder").slideUp(200);
		
}

$(document).ready(function(){
	 

$(".navmenu>li").each(function(){	
	$(this).hover(
				function(){					
					$(".sub_navmenu").not($(this).children(".sub_navmenu")).hide();
					
						if ($(this).children(".sub_navmenu").length > 0) {							
							$(this).children(".sub_navmenu").slideDown(100);							
						}},
				function(){}
				);
	
});

$(".sub_navmenu>li").each(function(){	
	$(this).hover(
				function(){		
					var da_parent = $(this).parents("li");
					var da_child = $(this).children(".sub_sub_navmenu");
					if(da_parent.position().left >400)
					{
						da_child.css("right","175px");
					}
					else
					{
						da_child.css("left","167px");
					}
				//console.log(da_parent.position().top +":" +da_parent.position().left);		
					$(".sub_sub_navmenu").not(da_child).hide();
						if (da_child.length > 0) {							
							da_child.fadeIn(100);							
						}},
				function(){}
				);
	
});


$(".sub_navmenu").each(function(){
	
		$(this).hover(
			function(){},
			function(){/$(this).fadeOut(300);$(".menu_holder").css("width", "auto");*/}
		);
	
});

	
});

function verify_search()
{
	var search_term = $("#search_term").val();
	if(search_term.length < 3 || search_term=='Voer hier uw zoekterm in...' || search_term=='Zoeken...')
	{
		alert("Your search must have at least three letters!");
		return false;
	}
	var cbpa = $("#searchinpagina:checked").length;
	var cbne = $("#searchinnews:checked").length;
	var cbpr = $("#searchinprojects:checked").length;
	if(cbpa==0 && cbne==0 && cbpr==0)
	{
		alert("You must select at least one search area!");
		return false;
	}
	return true;
	
	
}

function verify_search2()
{
	var search_term = $("#search_term").val();
	if(search_term.length < 3 || search_term=='Voer hier uw zoekterm in...' || search_term=='Zoeken...')
	{
		alert("Your search must have at least three letters!");
		return false;
	}
	
	return true;
	
	
}
