
var preloadFlag = false;
    function preloadImages() {
        if (document.images) {
            pre_mission_on = newImage('../images_top/entreprise_on.gif');
            pre_services_on = newImage('../images_top/services_on.gif');
            pre_soumission_on = newImage('../images_top/soumission_on.gif');
            pre_contact_on = newImage('../images_top/contact_on.gif');
            pre_anglais_on = newImage('../images_top/anglais_on.jpg');
            preloadFlag = true;
        }
    }

function preloadImages() {
	if (document.images) {
		pre_mission_on = newImage('../images_top/entreprise_on.gif');
		pre_services_on = newImage('../images_top/services_on.gif');
		pre_soumission_on = newImage('../images_top/soumission_on.gif');
		pre_contact_on = newImage('../images_top/contact_on.gif');
		pre_anglais_on = newImage('../images_top/anglais_on.jpg');
		pre_usinage_over = newImage('../images_stitch/usinage-over.gif');
		pre_soudure_over = newImage('../images_stitch/soudure-over.gif');
		pre_finition_over = newImage('../images_stitch/finition-over.gif');
		pre_autres_over = newImage('../images_stitch/autres-over.gif');
		pre_certification_over = newImage('../images_stitch/certification-over.gif');
		pre_CNC_over = newImage('../images_stitch/CNC-over.gif');
		preloadFlag = true;
	}
}

function requisF(form){
// vérifie que les champs
// requis soient bien remplis
	var n,args=requisF.arguments, l=args.length - 1;
	if(l > 0) {
		for(var i=1; i<args.length; i++){
			n=args[i];
			if(n.value == '') {
					alert("Tous les champs marqués d\'un astérisque sont obligatoires!"); 
					n.focus();
					return false;
			}//if
		}//for
	}//if
	form.submit();
	return true;
}

function requisE(form){
// vérifie que les champs
// requis soient bien remplis
	var n,args=requisE.arguments, l=args.length - 1;
	if(l > 0) {
		for(var i=1; i<args.length; i++){
			n=args[i];
			if(n.value == '') {
					alert("The fields identified by an asterisk are mandatory!"); 
					n.focus();
					return false;
			}//if
		}//for
	}//if
	form.submit();
	return true;
}

function checkCourrielF(f){
// Vérifie si le champ contient bien une adresse courriel contenant "@"
	with (f){
	var s = value.split(/@/);
		if((value)&&(value.search(/ /)!=-1||s.length!=2||!(s[0])||!(s[1])||s[1].search(/\.\w/)==-1)){	
			focus();
			value = '';
			alert("Ce courriel est invalide!");					
			return false;
		}//if
		else {
			if (value == '') return false; else return true;
		}
	}//with
}//funct

function checkCourrielE(f){
// Vérifie si le champ contient bien une adresse courriel contenant "@"
	with (f){
	var s = value.split(/@/);
		if((value)&&(value.search(/ /)!=-1||s.length!=2||!(s[0])||!(s[1])||s[1].search(/\.\w/)==-1)){	
			focus();
			value = '';
			alert("Invalid email!");					
			return false;
		}//if
		else {
			if (value == '') return false; else return true;
		}
	}//with
}//funct

function PopWindow(theURL) { 
var w=(screen.availWidth/2)-200;
  window.open(theURL,'','left='+w+',top=0,scrollbars=0,menubar=no,locationbar=no,toolbar=no,width=400, height=400');
}

function openPictWindow(thePict,h,w){
 var txt, win = window.open("Ateliers BG inc.","Pict",'scrollbars=no,resizable=no,width=' + h + ',height=' + w + ',top=0,left=0');
  txt = "<html>";
  txt = txt  + "<head>";
  txt = txt + "<Title>Les Ateliers BG inc.</Title>";
  txt = txt + "</head>";
  txt = txt + "<Body leftmargin=0 topmargin=0 onBlur=self.close;>";
  txt = txt + "<img src=" + thePict + ">";
  txt = txt + "</Body>";
  txt = txt + "</html>";
  win.document.write(txt);
  win.document.close();
}//funct