function dp(cubing) 
{
   string = "" + cubing;
   number = string.length - string.indexOf('.');
   if (string.indexOf('.') == -1)
      return string + '';
   if (number == 1)
      return string + '';
   if (number == 2)
      return string + '';
   if (number > 3)
      return string.substring(0,string.length-number+0);
return string;
}

function checkTextEmpty(theText)
{
	if ( theText.value != "" ) {
		return true;
	}
	return false;
}

function cf() 
{
	var i;
	var myArray = new Array("l", "w", "h");
	var myItems = new Array("longueur", "largeur", "taille");

	for (i = 0; i < myArray.length; i++) {
		if (!checkTextEmpty(eval("document.mf." + myArray[i]))) {
			alert('Entrez la ' + myItems[i] + ' de votre envoi.');
			return false;
		}
	}

	return true;
}

function airCubing(form)
{
	cf();
	form.result.value = dp(((form.l.value)*(form.w.value)*(form.h.value))/115)
}

function groundCubing(form)
{
	cf();
	form.result.value = dp(((form.l.value)*(form.w.value)*(form.h.value))/166)
}

function popTrkBK(noTrk)
{
   var line = "http://206.162.187.91/SuiviAppel/index.asp?noTrk="+noTrk+"&lan=0";
   winop = window.open(line,"info" ,'');
   winop.focus();
}

function popTrk(noTrk)
{
   myString = noTrk;
   rExp = /\r/gi;
   results = myString.replace(rExp, "|");

   var line = "http://206.162.187.92/index_tracking.asp?noTrk="+escape(results)+"&lan=0";
   winop = window.open(line,"Trk" ,'');
   winop.focus();
}

function PopupSat(page,name,size) {
	var popup = window.open(page, name, size, 'border=0,directories=0,menubar=0,location=0,resizable=0,scrollbars=1,status=0,toolbar=0');
}

function PopupPickup() {
	var popup = window.open('http://206.162.187.92/','pickup','height=600,width=750,top=50,left=50,directories=1,menubar=1,location=1,resizable=1,scrollbars=1,status=1,toolbar=1');
}

        if (document.images) {            // Active Images
            img1on = new Image();      
            img1on.src = "/fr/images/A_propos_tri_active.gif"; 
            img2on = new Image(); 
            img2on.src = "/fr/images/Nos_services_tri_active.gif";  
            img3on = new Image();
            img3on.src = "/fr/images/Suivi_tri_active.gif";
            img4on = new Image();
            img4on.src = "/fr/images/Cueillette_tri_active.gif";
			img5on = new Image();      
            img5on.src = "/fr/images/Contactez_nous_tri_active.gif"; 

            img1off = new Image(); 
            img1off.src = "/fr/images/A_propos_tri_space.gif"; 
            img2off = new Image();          
            img2off.src = "/images/spacer.gif"; 
            img3off = new Image();
            img3off.src = "/images/spacer.gif";
            img4off = new Image();
            img4off.src = "/images/spacer.gif";
			img5off = new Image(); 
            img5off.src = "/images/spacer.gif"; 

		}

// Function to 'activate' images.
function imgOn(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "on.src");
        }
}

// Function to 'deactivate' images.
function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
}

