//<![CDATA[

Array.prototype.find = function (val) {
	for(var i=0; i<this.length; i++)
		if(this[i] == val)
			return true;
	return false;
};

function nil() {}

function questionYesNo(msg) {
	return confirm(msg);
}

function submitOnQuestion(question) {
	return questionYesNo(question);

}

function popHelp(what, lang, width, height, path) {
	open(path + "/pophelp.php?what=" + what + "&lang=" + lang, "", "width="+width+", height="+height+", resizable=0, scrollbars=1, toolbar=0, location=0, directories=0, status=0, menubar=0, copyhistory=0");
}

function popUrl(url, width, height) {
	open(url, "", "width="+width+", height="+height+", resizable=0, scrollbars=1, toolbar=0, location=0, directories=0, status=0, menubar=0, copyhistory=0");
}

function popUrlSec(url, width, height) {
	open(url, "", "width="+width+", height="+height+", resizable=0, scrollbars=1, toolbar=0, location=1, directories=0, status=1, menubar=0, copyhistory=0");
}

function popUrlMiSec(url, width, height) {
	open(url, "", "width="+width+", height="+height+", resizable=0, scrollbars=1, toolbar=0, location=0, directories=0, status=1, menubar=0, copyhistory=0");
}

function popUrlTitleSec(url, title, width, height) {
	open(url, title, "width="+width+", height="+height+", resizable=0, scrollbars=1, toolbar=0, location=0, directories=0, status=0, menubar=0, copyhistory=0");
}
function giveFocus(id) {
	if (document.getElementById) {
		document.getElementById(id).focus();
	}
	else if (document.all){
		document.all[id].focus();
	}
	else if (document.layers) {
		document.layers[id].focus();
	}
}

function switchImage(name, src) {
	document[name].src = src;
}

function searchboxes_reset(name1, value1, name2, value2) {
	if (document.getElementById(name1).value == '' && document.getElementById(name2).value == '') {
		document.getElementById(name1).value = value1;
		document.getElementById(name2).value = value2;
	}
}

function searchboxes_clear(name1, value1, name2, value2) {
	
	if (document.getElementById(name1).value == value1 && document.getElementById(name2).value == value2) {
		document.getElementById(name1).value = '';
		document.getElementById(name2).value = '';
	}
}

function pop_it(the_form) {
   my_form = eval(the_form)
   //window.open("./wait.php", "popup", "height=440,width=640,menubar='no',toolbar='no',location='yes',status='yes',scrollbars='no'");
   my_form.target = "popup";
   my_form.submit();
}

function envoi_form(the_form) {
   my_form = eval(the_form)
   //window.open("./wait.php", "popup", "height=440,width=640,menubar='no',toolbar='no',location='yes',status='yes',scrollbars='no'");
//    my_form.target = "popup";
   my_form.submit();
}

function ConfirmMessage(action, formulaire) {
       if (confirm("Voulez-vous confirmer cette action ? : "+action)) { envoi_form(formulaire); return true; }
       else return false;
   }

function VisiblePasvisible(idobject) {
	if(document.getElementById(idobject).style.visibility == 'visible') document.getElementById(idobject).style.visibility = 'hidden';
	else document.getElementById(idobject).style.visibility = 'visible';
}
//]]>