// JavaScript Document

function centerwindow(theurl,wname,width,height,options) {
    x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
        if (screen.availWidth > 1800) { 
        x = ((screen.availWidth/2) - width)/2; 
    } 

	theurl = theurl + location.search ;

	if (options != ""){
		options = "," + options ;
	}
	openWin = window.open(theurl, wname, 'width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x + options); 
	if(openWin.window.focus){openWin.window.focus();}

}
//toolbar [=yes | no] | [=1 | 0] (La barre d’outils des boutons)
//location [=yes | no] | [=1 | 0] (Champ de saisie du URL)
//directories [=yes | no] | [=1 | 0] (barre standard d’outils du navigateur comme, quoi de neuf etc.)
//status [=yes | no] | [=1 | 0] (La barre de STATUS)
//menubar [=yes | no] | [=1 | 0] (La barre de menu)
//scrollbars [=yes | no] | [=1 | 0] (barres de défilements)
//resizable [=yes | no] | [=1 | 0] (redimensionner)

function linkParent(url){
	var maitre; 
  if (opener.closed) {
    // si la fenêtre principale est fermée
    maitre=window.open('','nomprincipal','toolbar=yes, location=yes,status=yes,menubar=yes, scrollbars=yes,resizable=yes,copyhistory=no');
    maitre.location.href = url;
  } else {
    // Si la fenêtre principale est ouverte
    opener.location.href = url;
  }

  window.close()
	
}

function sendSoumissionForm(nform){
	name = nform.name.value;
	email = nform.courriel.value;
	pays = nform.pays.value;
	how = nform.how.value;
	
	if ((name == "") || (email == "") || (email == "@") || (pays == "") || (how == "")){
		window.alert("Field with * has to be filled!");
	
	}else {
		nform.submit();
	}

}

function sendCoordForm(nform){
	name = nform.name.value;
	email = nform.courriel.value;
	pays = nform.pays.value;
	departement = nform.departement.value;
	commentaires = nform.commentaires.value;
	
	if ((name == "") || (email == "") || (email == "@") || (pays == "") || (departement == "") || (commentaires == "")){
		window.alert("Field with * has to be filled!");
	
	}else {
		nform.submit();
	}

}

function sendPartnerForm(nform){
	name = nform.name.value;
	email = nform.courriel.value;
	pays = nform.pays.value;
	type = nform.type.value;
	how = nform.commentaires.value;
	
	if ((name == "") || (email == "") || (email == "@") || (pays == "") || (type == "") || (how == "")){
		window.alert("les champs marqué d'un * sont obligatoire!");
	
	}else {
		nform.submit();
	}

}

function sendResumeForm(nform){
	name = nform.name.value;
	email = nform.courriel.value;
	pays = nform.pays.value;
	attach = nform.fic.value;
	
	if ((name == "") || (email == "") || (email == "@") || (pays == "") || (attach == "")){
		window.alert("les champs marqué d'un * sont obligatoire!");
	
	}else {
		nform.submit();
	}

}

function sendRecommendForm(nform){
	name = nform.name.value;
	email = nform.courriel.value;
	email2 = nform.courriel2.value;
	sujet = nform.sujet.value;
	
	if ((name == "") || (email == "") || (email == "@") || (email2 == "") || (email2 == "@") || (sujet == "")){
		window.alert("les champs marqué d'un * sont obligatoire!");
	
	}else {
		nform.submit();
	}

}

function partnerForm(nform){
	email = nform.email.value;
	passw = nform.passw.value;
	
	centerwindow('partenaires/check_login.php?email='+email+'&passw='+passw, 'partenaires','520', '540','scrollbars=yes, menubar=no, resizable=no');
	
}

// stats from quebectop.com
hsh = new Date();
hsd = document;
try {
hsr = top.document.referrer.replace(/[<>]/g, '');
} catch (err){hsr='http://error.quebectop.com';}
hsi = '<img width="1" height="1" align="right" src="http://www.quebectop.com/hit.php?website=2625&p=welcome&hl=' + hsh.getHours() + 'x' + hsh.getMinutes() + 'x' + hsh.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{s=screen;hsi += '&r=' + s.width + 'x' + s.height + 'x' + s.pixelDepth + 'x' + s.colorDepth;}
hsd.writeln(hsi + '&referant=' + hsr.replace(/&/g, '$') + '">');
//------------


