function UpdateDiv(link, div) {
	
	divname = '#' + div;
	
	document.getElementById(div).innerHTML = '<p style="text-align: center"><img src="/media/images/loading.gif"/></p>'
	
	$.ajax({ url: link,
			 type: "post",
	         context: document.body, 
	       
	        success: function(data){
						
	          	document.getElementById(div).innerHTML = data;
	          	$(divname).fadeIn('slow'); 
	        
	  		}
	 }); 


}

function ShowRowTableEmploi(row) {
	
	if (document.getElementById(row).style.display == 'block') {
		$('#' + row).slideUp('slow', function() {
		    // Animation complete.
		});
	} else {
		
		$('#' + row).slideDown('slow', function() {
		    // Animation complete.
		});
		
	}
	
}

function SetCookie(name, value, seconds) {
 
		if (typeof(seconds) != 'undefined') {
			var date = new Date();
			date.setTime(date.getTime() + (seconds*1000));
			var expires = "; expires=" + date.toGMTString();
		}
		else {
			var expires = "";
		}
 
		document.cookie = name+"="+value+expires+"; path=/";
	}
 
function GetCookie(name) {
 
		name = name + "=";
		var carray = document.cookie.split(';');
 
		for(var i=0;i < carray.length;i++) {
			var c = carray[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
		}
 
		return null;
	}

function ChangeFerlac(ville) {
	
	SetCookie('ferlac-ville', ville, 99999999)
	cookie = GetCookie('ferlac-ville');
	
	window.location.href = window.location.href;
	
}
