var openSize = 272;
var closedSize = 30;
var box1;

// function that starts the open process
function startOpen(theID, theButton){
	if(document.getElementById(theID).offsetWidth <= openSize){
		document.getElementById(theID).style.width = document.getElementById(theID).offsetWidth + 4 + 'px';
	}else{
		window.clearInterval(box1, theButton);
		document.getElementById(theButton).style.visibility = 'hidden';
	}
}

// function that starts the close process
function startClose(theID, theButton){
	if(document.getElementById(theID).offsetWidth >= closedSize){
		document.getElementById(theID).style.width =  document.getElementById(theID).offsetWidth - 8 + 'px';		
	}else{
		window.clearInterval(box1);
		document.getElementById(theButton).style.visibility = 'visible';
	}
}

// check to launch to open or close functions
function loginOpenClose(theID, theButton){
	if(document.getElementById(theID).offsetWidth < 270){
		window.clearInterval(box1);
		box1 = window.setInterval("startOpen('"+theID+"','"+theButton+"')",1);
	}else{
		window.clearInterval(box1);
		box1 = window.setInterval("startClose('"+theID+"','"+theButton+"')",1);	
	}
}

// plan de site
/* function showHide(mavariable, mafleche){
	theStyle = document.getElementById(mavariable).style ;

	if(theStyle.display == "block") {
		theStyle.display = "none";
		document.getElementById(mafleche).src = "/images/iqpf/fleche-rouge-bottom.gif";

	}
	else{
		theStyle.display = "block";
		document.getElementById(mafleche).src = "/images/iqpf/fleche-rouge-top.gif";
	}
}
*/


//changement d'image sur page accueil
/*function changeImage(num,obj) {
		
	document.getElementById('wow1').className="";
	document.getElementById('wow2').className="";
	document.getElementById('wow3').className="";

	if (num==1) {
	document.getElementById('photo1').src= "/images/iqpf/image-accueil-1.jpg";
	}
	if (num==2) {
	document.getElementById('photo1').src= "/images/iqpf/image-accueil-2.jpg";	
	}
	if (num==3) {
	document.getElementById('photo1').src= "/images/iqpf/image-accueil-3.jpg";	
	}
	obj.className="actif";
}
*/

//changement d'image sur page accueil
function showHide(theDiv,className){

	theDivArray = document.getElementsByTagName('div');
	cnt = 0;
	while(cnt < theDivArray.length){
		if(theDivArray[cnt].className == 'melanie'){
			theDivArray[cnt].style.display = 'none';
		}
	cnt++;
	}
	
	theDivArray2 = document.getElementsByTagName('a');
	cnt2 = 0;
	while(cnt2 < theDivArray2.length){
		if(theDivArray2[cnt2].className == 'actif'){
			theDivArray2[cnt2].className = '';
		}
	cnt2++;
	}



	document.getElementById(theDiv).style.display = "block";
	document.getElementById(className).className = "actif";
}



// Add to favorites
function addToFavorite(url, title) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, 'http://www.google.com',"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); 
	} 
}









