function openSousMenu(idopen)
{
	var allUL = document.getElementsByTagName('ul');
	if(document.getElementById(idopen))
	{
		for(var i = 0; i < allUL.length; i ++)
		{
			if(allUL[i].id == idopen)
				document.getElementById(idopen).style.display = '';
			else
				document.getElementById(allUL[i].id).style.display = 'none';
		}
	}
}
function changeCLass(what,name)
{
	var allRub = document.getElementsByName(name);
	for(var i = 0; i < allRub.length; i ++)
		allRub[i].className = 'nomRub';
	what.className = 'nomRubActiv';
		
}

function changeFiche(fiche)
{
	new Ajax.Request("loadFiche.php",{
			method : 'post',
			parameters : 'val='+fiche,
		onException: function(req,exception) { 
		alert("Request failed on Exception : "+ exception);
		},
		onFailure : function(){
		alert('l\'appel a échoué');
		},
		onSuccess : function(transport){					
			var response = transport.responseText;
			var eachResponse = response.split('|||');
			$('fichePlace').innerHTML = eachResponse[0];
			$('infoPlace').innerHTML = eachResponse[1];
			}			
		});
}

function zoomPicture(fiche)
{
    window.open('../img/imgRubrique/zoom/'+fiche,'','toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=1, copyhistory=0, menuBar=0, width=auto, height=auto, top=120, left=250');
}

function showImg(event,id,what)
{
	var x = event.clientX + (document.body.scrollLeft || document.documentElement.scrollLeft);
	var y = event.clientY + (document.body.scrollTop || document.documentElement.scrollTop);

	x = parseInt(x) + 10;
	y = parseInt(y) + 10;
	//alert(id);
	document.getElementById(id).style.top = y+'px';
	document.getElementById(id).style.left = x+'px';
	if(what == 'show')
		document.getElementById(id).style.display = '';
	else if(what == 'hide')
		document.getElementById(id).style.display = 'none';
}

function runSearch(val)
{
	var word = document.getElementById(val).value;
	if(trim(word) == '' || word == 'rechercher' || word.length < 3)
		alert('Merci de renseigner votre recherche');
	else		
	{
		word = encodeURIComponent(word);
		document.location.href = 'http://www.soluglob.fr/search.php?word='+word;
	}
		
}

function trim(chaine)
{
	return verification = chaine.replace(/ /g,'');
}















