// fonctions qui permettent la gestion des preload et rollover 


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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 MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_changeProp(objStrNS,objStrIE,theProp,theValue) { //v2.0
  var NS = (navigator.appName == 'Netscape');
  var objStr = (NS)?objStrNS:objStrIE;
  if (( NS && (objStr.indexOf('document.layers[')!=0 || document.layers!=null)) ||
      (!NS && (objStr.indexOf('document.all[')   !=0 || document.all   !=null))) {
    var obj = eval(objStr);
    if ((obj != null) && (theProp.indexOf("style.") != 0 || obj.style != null)) {
      eval(objStr+'.'+theProp + '="'+theValue+'"');
  } }
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		gic_m_pres_over = newImage("/ImagesGICPRO/gic_m_pres-over.gif");
		gic_m_quest_over = newImage("/ImagesGICPRO/gic_m_quest-over.gif");
		gic_m_cont_over = newImage("/ImagesGICPRO/gic_m_cont-over.gif");
		gic_m_lien_over = newImage("/ImagesGICPRO/gic_m_lien-over.gif");
		gic_m_plan_over = newImage("/ImagesGICPRO/gic_m_plan-over.gif");
		preloadFlag = true;
	}
}


function open_popup_construction () {
	window.open("CmmConH001.htm", "Construction", "width=216 , height=200,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
}


function open_popup_aide () {
	window.open("CmmConH001.htm", "Aide", "width=216 , height=200,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
}

function open_popup_presentation () {
	//window.open("CmmConH001.htm", "Construction", "width=216 , height=200,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
	window.location.href="/gpro/CmmPresentationH001.w";
}

function open_popup_contact () {
	//window.open("CmmContactH001.htm", "Construction", "width=216 , height=200,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
	window.location.href="/gpro/CmmContactH001.w";
}

function open_popup_question () {
	//window.open("CmmQuestionH001.htm", "Construction", "width=216 , height=200,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
	window.location.href="/gpro/CmmQuestionH001.w";
}

function open_popup_lien () {
	//window.open("CmmLienH001.htm", "Construction", "width=216 , height=200,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
	window.location.href="/gpro/CmmLienH001.w";
}

function open_popup_plan () {
   window.location.href="/gpro/CmmPlanH001.w";
}

function open_popup_ami(){
	window.open("/gpro/CmmAmiH001.w", "ami", "width=350 , height=370,top=0,left=0, toolbar=0,location=0,directories=0,status=0,copyhistory=0,menuBar=0");
}

IE4 = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
VERSION4 = (IE4 | NS4) ? 1 : 0;
if (!VERSION4) event = null;
function helpGetOffset(obj, coord) {
	var val = obj["offset"+coord] ;
	if (coord == "Top") val += obj.offsetHeight;
	while ((obj = obj.offsetParent )!=null) {
		val += obj["offset"+coord];
		if (obj.border && obj.border != 0) val++;
}
return val;
}
function helpDown () {
	if (IE4) document.all.helpBox.style.visibility = "hidden";
	if (NS4) document.helpBox.visibility = "hidden";
}
function helpOver (event,texte) {
	if (!VERSION4) return;
	var ptrObj, ptrLayer;
if (IE4) {
		ptrObj = event.srcElement;
		ptrLayer = document.all.helpBox;
}
if (NS4) {
		ptrObj = event.target;
		ptrLayer = document.helpBox;
}
	if (!ptrObj.onmouseout) ptrObj.onmouseout = helpDown;
	var str = '<DIV CLASS="helpBoxDIV">'+texte+'</DIV>';
if (IE4) {
		ptrLayer.innerHTML = str;
		ptrLayer.style.top  = helpGetOffset (ptrObj,"Top") + 20;
		ptrLayer.style.left = helpGetOffset (ptrObj,"Left");
		ptrLayer.style.visibility = "visible";
}
if (NS4) {
		ptrLayer.document.write (str);
		ptrLayer.document.close ();
		ptrLayer.document.bgColor = "#FFFFCF";
		ptrLayer.top  = ptrObj.y + 20;
		ptrLayer.left = ptrObj.x;
		ptrLayer.visibility = "show";
}
}




