var popup;
function Labelok(texte1,texte2) 
  { 
   if (texte1=="") 
     { alert("You have to input data on  "+texte2+"!");
	   return false;
	 }
	 return true;
 }
function selection1(){
	alert('test');
}


function not_selection(f,check,nb){
	str="";
	for (i=0;i<nb;i++){
		z=eval(f+"."+check+i);
		if (z.checked==false){
			if (str=="") {
				str=z.value;
			}else{
				 str+=","+z.value;	
			}
		}

	}
return str;
}


function selection1(f,check,nb,bool)
{
	for (i=0;i<nb;i++)
	{
		z=eval(f+"."+check+i);
		z.checked=bool;
	}
}
function selection2(f,check,nb,num_child,num_row){
	for (i=num_row;i<nb;i++)
	{
		z=eval(f+"."+check+i);
	
		for(j=1;j<num_child;j++){
			num=j+i;
			//alert(num);
			child_z=eval(f+"."+check+num);
			child_z.checked=z.checked;
			
		}
		if(j>1) { num_child=0; }
		if( z.checked==false ) {
		      eval(f +".checkall").checked=false;
			   return;
		}
	}


		eval(f + ".checkall").checked=is_select_all(f,check,nb);
}

function is_select_all(f,check,nb){
	for (i=0;i<nb;i++)
	{
		z=eval(f+"."+check+i);
		if( z.checked==false ) {
		 	   return false;
		}
	}
	return true;
}
function check_selection(f,check,nb)
{

	str="";
	for (i=0;i<nb;i++)
	{
		z=eval(f+"."+check+i);
		if (z.checked==true)
		{
			if (str=="")
				str=z.value;
			else
				 str+=","+z.value;	
		}
	}
	//alert(str);
return str;

}

function is_same(f1,f2,text3){
	if(f1!=f2){
			alert(text3 + " must be the same value!");
			return false;
	}
	return true;
	   
}


function launchCenter(url, name, width, height, scrollb,params,bpop) {
  var str="";
  if (scrollb==1) str="scrollbars=yes,";
  else str="scrollbars=no,";
  
  str += "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (params!="") str+=params;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;
    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  //alert(str);
  if (popup && bpop!=1)
  {
	  popup.close();
  }
   popup=window.open(url, name, str);
  return ;
}

function make_visible(obj,v){
	
	if(v=='T')
		obj.style.visibility='visible';
	else
		obj.style.visibility='hidden';
}
function make_print(){
	window.print();
}



var marked_row = new Array;
function setPointer(theRow,theRowNum, theAction, theDefaultColor)
{
	var theCells = null;
	theCells = theRow.getElementsByTagName('td');
	
	if (theAction == 'click') {
         marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
	   	if(marked_row[theRowNum]==null)theDefaultColor="#FFFFF4" ;
   }
   else 
   	if(marked_row[theRowNum]==true) return;
	 for (c = 0; c < theCells.length; c++) {
                theCells[c].setAttribute('bgcolor', theDefaultColor, 0);
            } 	  
}

function toggleLayer(t)
{

		var style1 = document.getElementById('uniqueID1').style;
		var style2 = document.getElementById('uniqueID2').style;
		switch(t.value)
		{
		case '1' :
				style2.display=""
				style1.display="block" 
				break;
		case '2' :
				style1.display=""
				style2.display="block"
				break;
		}
}


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];}
}




