var listzone;
var couli = 1
function closetest(parentFrame) {
	if(parentFrame) {
		if(parent.Dialog) {
			parent.Dialog.closeInfo();
			closetest(parentFrame)
		}
	}
	else {
		if(Dialog) {
			Dialog.closeInfo();
			closetest(parentFrame)
		}
	}
}
function DialogWithTime(message,timeout,parentFrame) {
	if(parentFrame) {
		if(parent.Dialog)
			parent.Dialog.closeInfo();
		//parent.Dialog.testInfo();
		//alert(parent.Dialog.length);
		parent.Dialog.info(message, {width:250, height:150, showProgress: true, destroyOnClose: true, closable: true});
		setTimeout("parent.Dialog.closeInfo();parent.Dialog.okCallback();",timeout); 
	}
	else {
		if(Dialog)
			Dialog.closeInfo();
			Dialog.info(message, {width:250, height:150, showProgress: true, destroyOnClose: true, closable: true});
			setTimeout("Dialog.closeInfo();Dialog.okCallback();",timeout); 
	}
}
function requestForm(zone,variable,dest,f,charg,autoclose,evalOther,SendMethod) {
	if(charg != null && charg != 0 ) {
		//destroy(Dialog);
		if(parent.Dialog)
			parent.Dialog.closeInfo();
		if(Dialog)
			Dialog.closeInfo();
		Dialog.info("Chargement<br>Veuillez Patienter ...", {width:250, height:100, showProgress: true, destroyOnClose: true, closable: true});
	}
	if(SendMethod == null)
		SendMethod = "POST";
	//alert(SendMethod)
					//layerInfo('<span class="chargement"></span>');
listzone = 	document.getElementById(zone)
	   var xhr_object = null; 
	 
	if(window.XMLHttpRequest) // Firefox 
	   xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // Internet Explorer 
	xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else { // XMLHttpRequest non supporté par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   return; 
	} 
	 	if(SendMethod == "GET" && variable != null) { 
		   dest += "?"+variable; 
	   	variable      = null; 
		}
	   xhr_object.open(SendMethod, dest, true); 
	     
	   xhr_object.onreadystatechange = function() {
		  if(xhr_object.readyState < 4) {
	
		  }
		  else {
			 if(charg != null && autoclose != null && charg != 0 && autoclose != 0)	 {
				setTimeout("Dialog.closeInfo()",autoclose); 
			 	/*DIV_Remove('incache');
				DIV_Remove('cache');*/
			  }
			//closeLayer('incache');closeLayer('cache')
		  	putContent(zone,xhr_object.responseText);
			if(evalOther)
				eval(evalOther)
		  }
	   } 
	 if(SendMethod == "POST") 
	   xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	   xhr_object.send(variable); 
}
function putContent(zone,content) {
	document.getElementById(zone).innerHTML = content;
}
function SelectRequestGo(selObj){
	//alert(selObj.options[selObj.selectedIndex]);
	var request = selObj.options[selObj.selectedIndex].getAttribute('request')
	if(request!='none')
		eval(request)
}
function SelectRequestGo2(selObj){ //v3.0
	eval(selObj.options[selObj.selectedIndex].value)
  	//requestForm(value)
}
function multiple_action(f,variables,location) {
	f = document.selection
	var inputFields = f.getElementsByTagName('INPUT')
	var ids = ''
	var nb_select1 = 0
	var nb_select2 = 0
	
	var inputs = new Array()
	var postInReq = new Array()
	for(var no=0;no<inputFields.length;no++){
		inputs[inputs.length] = inputFields[no]
			if(inputs[no].type == 'checkbox') {
				if(inputs[no].checked == true) {
					nb_select1++
				}
			}
	}	
	for(var no=0;no<inputs.length;no++){
		//alert(inputs[no].type)
		if(inputs[no].type == 'checkbox') {
			if(inputs[no].checked == true) {
				nb_select2++
				ids += inputs[no].value
				if(nb_select2 != nb_select1)
					ids += ';'
				//alert(ids)
			}
		}
	}
  
requestForm('request_zone_temp',variables+'&id='+ids,location,0,1)
}
function checkAll(f,checkvalue) {
	var inputFields = f.getElementsByTagName('INPUT')
	var inputs = new Array()
	for(var no=0;no<inputFields.length;no++){
		inputs[inputs.length] = inputFields[no]
		var thischeckvalue = inputs[no].getAttribute('checkvalue')
		if(inputs[no].type == 'checkbox' && thischeckvalue == checkvalue) {
			inputs[no].checked = true
		}
	}	
}
