function validateForm(f)
{
	for (var i=0; i<f.elements.length; i++)
	{
		if (f.elements[i].alt=="blank" && f.elements[i].value=="")
		{
			alert("Please provide "+f.elements[i].name);
			f.elements[i].focus();
			return false;
		}
		if (f.elements[i].alt=="numeric" && (f.elements[i].value=="" || isNaN(f.elements[i].value)))
		{
			alert("Please provide "+f.elements[i].name);
			f.elements[i].focus();
			return false;
		}
		if (f.elements[i].alt!="" && f.elements[i].alt!=null)
		{
			if (f.elements[i].alt.substr(0, 7)=="equalto")
			{
				if ((f.elements[i].value!=f(f.elements[i].alt.substr(8)).value))
				{
					alert("Please provide "+f.elements[i].name);
					f.elements[i].focus();
					return false;
				}
			}
		}
	}
}
/*********************************************************tarek**********************************************/

var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos)
{

	if(pos=="random")
	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}

	if(pos=="center")
	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;
	}

	else if((pos!="center" && pos!="random") || pos==null)
	{
		LeftPosition=0;
		TopPosition=20;
	}

	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	
	win=window.open(mypage,myname,settings);
}

		var offsetxpoint=-60; //Customize x offset of tooltip
		var offsetypoint=20 ;//Customize y offset of tooltip
		var ie=document.all;
		var ns6=document.getElementById && !document.all;
		var enabletip=false;
		if (ie||ns6)
		var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "";

		function ietruebody()
		{
		return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
		}

		function ddrivetip(thetext, thecolor, thewidth)
		{
		if (ns6||ie)
		{
		if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px";
		if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor;
		tipobj.innerHTML=thetext;
		enabletip=true;
		return false
		}
		}

		function positiontip(e)
		{
		if (enabletip)
		{
		var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
		var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
		//Find out how close the mouse is to the corner of the window
		var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20;
		var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20;

		var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000;

		//if the horizontal distance isn't enough to accomodate the width of the context menu
		if (rightedge<tipobj.offsetWidth)
		//move the horizontal position of the menu to the left by it's width
		tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px";
		else if (curX<leftedge)
		tipobj.style.left="5px";
		else
		//position the horizontal position of the menu where the mouse is positioned
		tipobj.style.left=curX+offsetxpoint+"px";

		//same concept with the vertical position
		if (bottomedge<tipobj.offsetHeight)
		tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px";
		else
		tipobj.style.top=curY+offsetypoint+"px";
		tipobj.style.visibility="visible";
		}
		}

		function hideddrivetip(){
		if (ns6||ie){
		enabletip=false;
		tipobj.style.visibility="hidden";
		tipobj.style.left="-1000px";
		tipobj.style.backgroundColor='';
		tipobj.style.width='';
		}
		}

		document.onmousemove=positiontip;




/***********************************************************end**********************************************/

//function remplir(f,liste1,liste2,dossier)//remplir une liste en fonction de la valeur d'une autre liste
function remplir(f,liste1,liste2,fichier)
{
	var l1    = f.elements[liste1];
	var l2    = f.elements[liste2]; 
	var index = l1.selectedIndex;
	if(index < 1) 
	   l2.options.length = 0; 
	   
	else { 
	
	   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; 
   } 
xhr_object.open("POST",fichier, true); 
	  xhr_object.onreadystatechange = function() 
	  { 
	  	  if(xhr_object.readyState == 4)  eval(xhr_object.responseText); 
	  } 
	   xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	   var data = "catId="+escape(l1.options[index].value)+"&form="+f.name+"&select="+liste2+""; 
	   //alert(data);
	   xhr_object.send(data); 
	 
	} 	
//alert(data);
}

function refrech(form)
{
  form.submit();
}

function Deplacer(l1,l2,message) {

	if (l1.options.selectedIndex>=0) {
		o=new
 Option(l1.options[l1.options.selectedIndex].text,l1.options[l1.options.selectedIndex].value);
		l2.options[l2.options.length]=o;
		l1.options[l1.options.selectedIndex]=null;
		//alert('1111');	
	}else{
		alert(message);
	}
}

function prepEnvoi() {
	var hid = new String();
	var tab = new Array();
	var data = window.document.acceptation.list2.options;
	for (i=0;i<data.length;i++)
	{
		tab.push(data[i].value);
		//alert(data[i].value);
	}
	document.acceptation.list2value.value=tab.join(",");
}

function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=300,screenX=150,screenY=150,top=150,left=150')
}
function popupWindowparam(url, width, height) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width='+width+',height='+height+',screenX=150,screenY=150,top=150,left=150')
}

<!--
	function validateFormEx(f)
	{
		//alert('You must specify whom the checks will be payable to.');
		if ( !f.paymentType_C.checked && !f.paymentType_C.checked)
		{
			alert('You must specify a type of payment.');
			f.paymentType.focus();
			return 0;
		}
		
		if ( f.paymentType_C.checked && f.checksPayableTo.value=='')
		{
			alert('You must specify whom the checks will be payable to.');
			f.checksPayableTo.focus();
			return 0;
		}

		if ( f.paymentType_P.checked && f.paypalEmail.value=='')
		{
			alert('You must your paypal email address.');
			f.paypalEmail.focus();
			return 0;
		}

		//return validateForm(f);
	}
	
	function TJS_PrintChoixColor(nom, color, pick, alt) {
	
document.write("<TABLE border=0><TR><TD><INPUT type=text name='"+nom+"' readonly size=10px class=\"effect\" value='"+color+"' style='width:100px;font-family:arial;font-size:10px'>&nbsp;&nbsp;</TD>");
		document.write("<TD><DIV id='divcolor"+nom+"' style='position:relative; width:30px; height:15px; border-color:black; border-style:solid; border-width:1px; background-color:"+color+"'></DIV></TD>");
		document.write("<TD>&nbsp;&nbsp;<a href=\"#\" onClick=\"cp.select(F."+nom+",'"+pick+"');return false;\" name='"+pick+"' id='"+pick+"'><img src=\"images/colors.gif\" alt='"+alt+"' width=15 height=15 border=0></a></TD></TR></TABLE>");
		
	}
	function TJS_EditBGColor(nom, color) {
		//alert(color);
		
		if (document.getElementById) {
			if (document.getElementById("divcolor"+nom).style.backgroundColor = color) {}
		}
		if (document.all) {
			if (document.all["divcolor"+nom].style.backgroundColor = color) {}
		}
		if (document.layers) {
			if (document.layers["divcolor"+nom].style.backgroundColor = color) {}
		}
	}

	//-->