// JavaScript Document
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}



function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


photoCount=0;

function hidePhotoContainer(name_p) {
	findObj(name_p).style.display="none";
//	new Effect.Scale( name_p, 20,{ scaleX: true, scaleY: true });
}

function showPhotoContainer(name_p) {
	Effect.Appear(name_p);
	//Effect.Grow(name_p);
	//new Effect.Scale( 'picture1', 20,{ scaleX: true, scaleY: false }); return false;
//	new Effect.Scale( name_p, 20,{ scaleX: true, scaleY: true });
}


function scrollToPhoto(name_p) {
	if (name_p== "photo-1") {name_p="start"}
	if (name_p== "photo"+photoCount) {name_p= "photo"+(photoCount-1)}
	new Effect.ScrollTo(name_p);
}

function addPhotoCounter() {alert("ee")}

function toggleMenu(name_p) {
	Effect.toggle(name_p,'slide');
}

function selecteMenu(name_p) {
	findObj(name_p).className="on";
}

function collapseAllMenuExpected(menuExpected) {

	menusName = new Array("reportages","presse","portraits","divers","musique")
	
	for (i=0 ; i<menusName.length; i++)
	{
		if ( menuExpected != menusName[i]) {
		findObj(menusName[i]).style.display="none";
		}
	}

}



var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
