// JavaScript Document
$(function(){
	$("#top ul li").hover(function(){
		$(this).addClass("active");
		$("ul", this).show();
	}, function(){
		$(this).removeClass("active");
		$("ul", this).hide();
	});
	
	// Nieuws en contact in het zijpaneel:
	$("#contact").hide();
	$("a.news").click(function(){
		$(this).css({background: "#1e1e1e"});
		$("a.contact").css({background: "#141414"});
		$("#news").show();
		$("#contact").hide();
		return false;
	});
	$("a.contact").click(function(){
		$(this).css({background: "#1e1e1e"});
		$("a.news").css({background: "#141414"});
		$("#news").hide();
		$("#contact").show();
		return false;
	});
	// Outline fix:
	$.outline("2px solid #f00");
	$('#upperImageCycle').cycle({ 
		fx:    'fade', 
		speed:  800,
		timeout: 6000,
		sync:	1
	 });
});

function getJobOffers(land,category,container,idx){
	$(container).empty();
	$(container).hide();
	$.ajaxSettings.cache = false;
	
	if(land == undefined){
		$(container + " .resultlist").append("<li></li>");
	}else{
		//$.getJSON("/careers/rpc_careers?l=" + land + "&c=" + category + "&jsoncallback=?",
		$.getJSON("/index.php",{ id: 295, l: land, c: category},
			function(data){
				MyList = $(container).append("<UL class=\"resultlist\"></UL>");
				//$.each(data.entries, function(i,item){
				$.each(data, function(i,item){
					// $(container + " .resultlist").append("<li><a href='detail/?jobid="+item.id+"'>"+item.title+ " &raquo; " + item.category.split(",")[idx] + " &raquo; " + item.location + "</a><small>"+item.excerpt+"</small></li>")
					$(container + " .resultlist").append("<li><a href='/index.php?id=296&amp;jobid="+item.id+"'>"+item.title+ " &raquo; " + item.category.split(",")[idx] + " &raquo; " + item.location + "</a><small>"+item.excerpt+"</small></li>");
				});
				$(container).slideDown("fast");
			}
		);
	}
}
