function img(chemin,width,height){
	 var myWindow=window.open("image.php?img="+chemin,'_blank','width='+width+',height='+height+',resizable=no');
  	 myWindow.moveTo(screen.width/2-(width/2),screen.height/2-(height/2))
}

function img2(chemin,width,height){
	 var myWindow=window.open("image_c.php?img="+chemin+'&w='+width+'&h='+height,'_blank','width='+width+',height='+height+',resizable=yes');
  	 myWindow.moveTo(screen.width/2-(width/2),screen.height/2-(height/2))
}
////////////////
function img3(chemin,width,height){
	 var myWindow=window.open("../image2_c.php?img="+chemin+'&w='+width+'&h='+height,'_blank','width='+width+',height='+height+',resizable=yes');
  	 myWindow.moveTo(screen.width/2-(width/2),screen.height/2-(height/2))
}
////////////////////////////
//roll over des images

function rollover(chemin,quelleImg,etat)
{
	quelleImg.src=chemin+quelleImg.name+etat+".gif";
}

function sous_menu(sous,action,btn){
	document.getElementById("sous_"+sous).style.display=action;
	
	if (action=='block')
		try{document.form_rech.recherche.blur();}catch(e){document.form_Rech.search.blur();}

}

function txt(quel,action){
	if (action=='over')
	quel.style.color='#8adf51';	
	else
	quel.style.color='#3a9202';
}

function resize(){
	if (screen.width<1024){
	document.getElementById('c_contenant').style.left='475px';
	document.getElementById('c_back').style.overflow='scroll';
	}
}


function pop_visite(page){
	 var myWindow=window.open(page,'_blank','width=746,height=498,resizable=no');
   myWindow.moveTo(screen.width/2-373,screen.height/2-249)
}

function pop_ency(page){
   var myWindow=window.open(page,'_blank','width=750,height=450,resizable=no');
   myWindow.moveTo(screen.width/2-375,screen.height/2-225)
}

//Ouvre un popup
function ouvrePopup(lien,nom,width,height)
{
	var mypopup = window.open(lien,nom,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+width+',height='+height+',top='+eval((screen.availHeight - height) / 3)+',left='+eval((screen.availWidth - width) / 2));
	mypopup.focus();
}

// Put first character to uppercase
function ucfirst(val){
	var firstC = val.substring(0,1);
	if(isNaN(firstC)){
		firstC = firstC.toUpperCase();
		val = firstC+val.substr(1);
	}
	
	return val;
}

//trims blank spaces
function trim(val)
	{
	if (!val) return val;

		while(val.charAt(0) == ' ') val = val.substring(1,val.length);
		while(val.charAt(length)==' ')  val = val.substring(0,val.length-1);

	 return val;
	}
	
	
//navig pages
function navig(page,quel,maxpage){
		var form=eval('document.form_navig'+quel);
		
		if (page<1 || isNaN(page))
		page=1;
		else if(page>maxpage)
		page=maxpage;

		form.submit();
}
