if(typeof Galleria != 'undefined') Galleria.loadTheme('css/galleria.classic.js');

var curI = 0;
function toggleDivs(i){
	if(jQuery("#anchor_"+curI+", #anchor_"+i+", gal_"+curI+", gal_"+i).is('*')){
		jQuery('#anchor_'+curI).html("<a href='#content' onclick='javascript:toggleDivs("+curI+");'>"+(curI+1)+"</a>");
		jQuery('#anchor_'+i).html(i+1);
		jQuery('#gal_'+curI).fadeOut(10);
		jQuery('#gal_'+i).fadeIn(500);
		curI = i;
	}
}

function imagePreLoader(list){
	if (document.images) {
		for(var i in list){
			img= new Image();
			img.src = list[i];
		}
	}
}


jQuery(window).load(function(){
	imagePreLoader(["images/btn-bleuOver.png","images/btn-cyanOver.png","images/btn-jauneOver.png","images/btn-vertOver.png","images/icon_homeOver.png","images/icon_mailOver.png"]);
	toggleDivs(0);
});




function switchCommunity(e){
	
	var x = e.options[e.selectedIndex].id.split('_');
	jQuery.ajax({
		type: "POST",
		url: "/get_regions.php",
		cache: false,
		data: "id="+x[1],
		dataType: "html",
		error:errorFunc,
		success: function(response){
			
			//document.getElementById('communityHolder').innerHTML = response;
			jQuery("#communityHolder").html(response);
		}
	});
}
function errorFunc(request, textStatus, errorThrown){
	alert("Error doing auto-installer search, proceed with ticket submission\n"
        +request.statusText);
}


function stopScroll(){
	document.body.style.overflow = 'hidden';
}
function enableScroll(){
	document.body.style.overflow = 'auto';
}
