function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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 showHideLayers()
{ 
  var i, visStr, dispStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-3); i+=4)
  {
    if ((obj = findObj(args[i])) != null)
    {
     visStr = args[i+2];
     dispStr = args[i+3];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show')
        {
		visStr = 'visible';
	}
	else if(visStr == 'hide')
	{
		visStr = 'hidden';
	}
      }
	if (dispStr != 'block')
      		dispStr = "none";
	obj.display = dispStr;
	obj.visibility = visStr;
    }
  }
}

function changeBackgroundImage(elem_name, image)
{
	var elem;
	elem = findObj(elem_name);
	if (elem)
	{
		var savebackgroundRepeat, savebackgroundPosition;
		savebackgroundRepeat = elem.style.backgroundRepeat;
		savebackgroundPosition = elem.style.backgroundPosition;
		elem.style.background = 'url(' + image + ')';
		elem.style.backgroundRepeat = savebackgroundRepeat;
		elem.style.backgroundPosition = savebackgroundPosition;
	}
}

function resizeContenu()
{
	var contenu;
	var max = 5+150+5+5*(112+4)+5;
	contenu = findObj("contenu");
	if (contenu)
	{
		var winW = max;
	
		if (parseInt(navigator.appVersion)>3)
		{
			if (navigator.appName=="Netscape")
			{
				winW = window.innerWidth;
			}
			if (navigator.appName.indexOf("Microsoft")!=-1)
			{
				winW = document.body.clientWidth;
			}
		}

		if (winW > max)
		{
			contenu.style.width = "100%";
		}
		else
		{
			contenu.style.width = parseInt(max) + "px";
		}
	}
}

function OnLoad()
{
	MM_preloadImages(
		"IMG/correlation/correlation.gif", 
		"IMG/correlation/right.gif", 
		"IMG/correlation/menu_item_on.gif", 
		"IMG/correlation/menu_item_off.gif");
	resizeContenu();
	window.onresize = resizeContenu;
}

