


//script to protect images from theft
/*function click()
{if (event.button==2)
{
alert('ESII Media Accueil Copyright - Tous droits réservés')
} 
}document.onmousedown=click
// end*/

function click_tree_menu(obj,bgcoll)
{
 if (obj && obj.parentNode && obj.parentNode.parentNode)
  {
	var curObj = obj.parentNode.parentNode.nextSibling;
	if (! curObj || curObj.className != "child") return;
	var vis = "none";
	if (obj.id) document.cookie = obj.id + "=0;"
	if (curObj.style.display == "none")
	 {
	   vis = "";
	   if (obj.id) document.cookie = obj.id + "=1;";
	   obj.parentNode.style.backgroundColor = bgcoll;
	 } 
	else 
	 {
	   obj.parentNode.style.backgroundColor = "";
	 } 

	while (curObj.className == "child")
	 {
	   curObj.style.display = vis;
	   curObj = curObj.nextSibling;
	 }
  }
}

//pop up image
function showPicture(pictureToShow, windowTitle)
{
	 PicWin=window.open("","PictureViewer",'status=0,scrollbars=no,resizable=yes,width=100,height=100,screenX=20,screenY=20,top=20,left=20');
	 PicWin.document.open();
	 PicWin.document.writeln('<html><head><title>' + windowTitle + '</title></head>');
	 PicWin.document.writeln('<body topmargin="0" onload="this.focus()" bgcolor="white" leftmargin="0" link="#808080" vlink="#808080">');
	 PicWin.document.writeln('<table border="0" width="100%" height="100%"><tr><td align="center" valign="middle">');
	 PicWin.document.writeln('<img onLoad="window.opener.resizeWindow(50,70,100);" border="1" src="'+ pictureToShow +'">');
	 PicWin.document.writeln('<br><a style="font-size:11px;font-family:verdana;" href="javascript:this.close()">Fermer</a></body></html>');
	 PicWin.document.close();
}
function resizeWindow(Hborder, Vborder, millisecs)
{     
	 setTimeout("PicWin.resizeTo(PicWin.document.images[0].width + " + Hborder + ", PicWin.document.images[0].height + " + Vborder + ");", millisecs);
}
//end

// preconises
function css ()
{
	var the_form = document.question;
	
	if (the_form.vo24[0].checked) {
		the_form.vi33.checked=false;
	} else if (the_form.ss9.value > 400 || the_form.ss11.value > 11 || the_form.ss3.value > 24 || the_form.vo13[0].checked || the_form.vo14[0].checked || (the_form.vo15[0].checked && the_form.vo24[0].checked)  || the_form.vo32[0].checked || the_form.vo33[0].checked) {
		the_form.vi31.checked=false;
	} else if (the_form.ss4[0].checked || the_form.ss9 > 200 || the_form.ss4[0].checked || the_form.as3[0].checked || (the_form.vo4[0].checked && the_form.vo5[0].checked)  || the_form.vo9[0].checked || the_form.vo10[0].checked || the_form.vo11[0].checked || the_form.ss3.value > 15 || the_form.vo27[0].checked) {
		the_form.vi28.checked=false;
		the_form.vi29.checked=false;
		the_form.vi30.checked=false;
	} else if (the_form.ss3.value > 10) {
		the_form.vi29.checked=false;
	} else if (document.question.ss3.value > 2){
		the_form.vi28.checked=false;
	}
}

// questionnaire
function submitquestion () 
{
	if (question.vi1.value == ""){ 
        alert ("The name of the organization is mandatory" )
        question.vi1.focus()        
		 return;}
	else if (question.vi5.value == ""){ 
        alert ("Your name is mandatory" )
        question.vi10.focus()        
		 return;}
	else if (question.vi7.value == ""){ 
        alert ("Your email is mandatory" )
        question.vi7.focus()        
		 return;}
	else if ((question.vi7.value.indexOf('@', 0) == -1) || (question.vi7.value.indexOf('.') == -1)){ 
        alert ("Your email is mandatory" )
        question.vi7.focus()        
		 return;}
	else{
        document.question.submit(); // un-comment to submit form
        return;}
}	

// numeric value only
function keyCheck(eventObj, obj)
{
	var keyCode

	// Check For Browser Type
	if (document.all){ 
		keyCode=eventObj.keyCode
	}
	else{
		keyCode=eventObj.which
	}

	var str=obj.value

	if(keyCode==46){ 
		if (str.indexOf(".")>0){
			return false
		}
	}

	if((keyCode<48 || keyCode >58)   &&   (keyCode != 46)){ // Allow only integers and decimal points
		return false
	}

	return true
}

window.alert=function( alertMessage )
    {
		 //<div id="alertPanel" style="position:absolute; z-index:1;"></div>  !!!!!! NE PAS OUBLIER CETTER LIGNE APRES LE BODY !!!!!
         var alertBox = "";
         alertBox +="<div style=\"background:#edebeb;width:350px;height:70px;border:outset\" class=\"alertBoxIn alertPosition\">";
         alertBox  +="<table width=\"100%\" height=\"100%\"><tr><td valign=\"middle\" align=\"center\"><img src=\"img/Alert/InfoBox.png\"></td><td style=\"with:5px\"></td><td valign=\"middle\" align=\"left\"><SPAN  style=\"font-family:Arial, Helvetica, sans-serif; font-size:11px; font-color:#999999\">"+alertMessage+"</SPAN></td></tr>";
         alertBox  +="<tr><td valign=\"middle\" align=\"center\" colspan=\"3\"><input type=\"button\" value=\"    OK      \" onclick=\"closeAlert();\" /></td></tr></table>";
         alertBox+="</div>";

    	result=returnSize();
		var myWidth=result[0];
		var myHeight=result[1];
		var elementWidth=350;
		var elementHeight=70;
        var myScrollLeft=document.documentElement.scrollLeft;
		var myScrollTop=document.documentElement.scrollTop;
		var posX=myScrollLeft+myWidth-myWidth/2-elementWidth/2
		var posY=myScrollTop+myHeight-myHeight/2-elementHeight/2;
 		document.getElementById("alertPanel").innerHTML = alertBox;
		document.getElementById("alertPanel").style.left=posX+"px";
		document.getElementById("alertPanel").style.top=posY+"px";
        document.getElementById("alertPanel").focus();
		 
             }

function errorBox( alertMessage )
     {
		 //<div id="alertPanel" style="position:absolute; z-index:1;"></div>  !!!!!! NE PAS OUBLIER CETTER LIGNE APRES LE BODY !!!!!
         var alertBox = "";
         alertBox +="<div style=\"background:#edebeb;width:350px;height:70px;border:outset\" class=\"alertBoxIn alertPosition\">";
         alertBox  +="<table width=\"100%\" height=\"100%\"><tr><td valign=\"middle\" align=\"center\"><img src=\"img/Alert/ErrorCircle.png\"></td><td style=\"with:5px\"></td><td valign=\"middle\" align=\"left\"><SPAN  style=\"font-family:Arial, Helvetica, sans-serif; font-size:11px; font-color:#999999\">"+alertMessage+"</SPAN></td></tr>";
         alertBox  +="<tr><td valign=\"middle\" align=\"center\" colspan=\"3\"><input type=\"button\" value=\"    OK      \" onclick=\"closeAlert();\" /></td></tr></table>";
         alertBox+="</div>";

		result=returnSize();
		var myWidth=result[0];
		var myHeight=result[1];
		var elementWidth=350;
		var elementHeight=70;
        var myScrollLeft=document.documentElement.scrollLeft;
		var myScrollTop=document.documentElement.scrollTop;
		var posX=myScrollLeft+myWidth-myWidth/2-elementWidth/2
		var posY=myScrollTop+myHeight-myHeight/2-elementHeight/2;
  		document.getElementById("alertPanel").innerHTML = alertBox;
		document.getElementById("alertPanel").style.left=posX+"px";
		document.getElementById("alertPanel").style.top=posY+"px";
        document.getElementById("alertPanel").focus();
		 
             }

function closeAlert()
            {
                var alertBox =  document.getElementById("alertPanel");
                alertBox.innerHTML ="";
            }
			
function returnSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var result = new Array(myWidth,myHeight);
  return result;
}

function showPage( Page, l, h)
     {
		 //<div id="alertPanel" style="position:absolute; z-index:1;"></div>  !!!!!! NE PAS OUBLIER CETTER LIGNE APRES LE BODY !!!!!
         var alertBox = "";
         var dLarg = l + 10;
		 var dHaut = h + 10;
		 var FermerL = l - 5;
		 var FermerH = 7;

		 alertBox +="<div style=\"background:#ffffff;width:"+dLarg+"px;height:"+dHaut+"px; border-color:55bee0; border-style-width:1px; border-style:solid\" class=\"alertBoxIn alertPosition\">";
         alertBox  +="<table width=\"100%\" height=\"100%\"><tr><td valign=\"middle\" align=\"center\"><SPAN  style=\"font-family:Arial, Helvetica, sans-serif; font-size:11px; font-color:#999999\"><iframe src=\""+Page+"\" width=\""+l+"\" height=\""+h+"\" frameborder=\"0\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" noresize></iframe></SPAN></td></tr>";
         alertBox  +="</table>";
         alertBox+="</div>"
		 alertBox+="<div style=\"position:absolute; top:"+FermerH+"px;left:"+FermerL+"px; width:20px; height:20px\"><SPAN  style=\"font-family:Arial, Helvetica, sans-serif; font-size:14px; font-color:#55bee0; font-weight:bold\" onClick=\"closeAlert()\" onMouseOver=\"this.style.cursor='hand'\" onMouseOut=\"this.style.cursor='pointer'\"><b><font color=\"#55bee0\">X</font></b></span></div>";

		//Pour placer la fenetre au milieu
			var arrayPageScroll = getPageScroll();
			var arrayPageSize = getPageSize();
			var PageCenterH = arrayPageSize[3]/2;
			var PageCenterL = arrayPageSize[2]/2;
			var posY=PageCenterH-(h/2)+arrayPageScroll[1];
			if (posY<0){posY=50+arrayPageScroll[1];}
			var posX=PageCenterL-(l/2)+arrayPageScroll[0];
		
		document.getElementById("alertPanel").innerHTML = alertBox;
		document.getElementById("alertPanel").style.left=posX+"px";
		document.getElementById("alertPanel").style.top=posY+"px";
        document.getElementById("alertPanel").focus();
		 
             }	
			 
			 
