function CheckMailTech()
{
	if(getElm('nom').value == ''){
		BlinkMe('nom',5);
		getElm('nom').focus();
		return false;
	}
	if(getElm('prenom').value == ''){
		BlinkMe('prenom',5);
		getElm('prenom').focus();
		return false;
	}
	if(getElm('sujet').value == ''){
		BlinkMe('sujet',5);
		getElm('sujet').focus();
		return false;
	}
	if(getElm('message').value == ''){
		BlinkMe('message',5);
		getElm('message').focus();
		return false;
	}
	if(getElm('capchamailtech').value == ''){
		BlinkMe('capchamailtech',5);
		getElm('capchamailtech').focus();
		return false;
	}
	
	return true;
}
function CloseFrame()
{
	getElm('techcontact').style.visibility = 'hidden';
	RemNod(getElm('hider'));
	if(xHRObjectMC != null) {
		xHRObjectMC = null;
	}
	getElm("sendmcstatus").style.display = 'none';
	getElm("sendmcresult").style.display = 'none';
}
function ShowMailContact()
{
	if(xHRObjectMC && xHRObjectMC.readyState == 4 && xHRObjectMC.status == 200){
		getElm("sendmcstatus").style.display = 'none';		
		var xmlDoc = xHRObjectMC.responseXML;
		var theError = xmlDoc.getElementsByTagName("errorCode")[0].firstChild.data;
		var theMessage = '';
		if(theError == '0'){
			theMessage = '<span style="color:Blue;">L\'email a été envoyé avec succsès.</span>';			
		}else if(theError == '4'){
			theMessage = '<span style="color:Red;">Le code de vérification est érroné</span>';
		}else{
			theMessage = '<span style="color:Red;">Nous sommes désolé, l\'envoi a échoué; Veuillez réessayer plus tard.</span>';
		}
		getElm("sendmcresult").innerHTML = theMessage
		getElm("sendmcresult").style.display = 'block';
		
	}
}
function SendMailTech()
{
	if(CheckMailTech()){
		var mc = getElm("techcontact");
		ShowHider('hider');
		mc.style.top = parseInt((((typeof(window.innerHeight) != 'undefined') ? window.innerHeight : document.documentElement.clientHeight) / 2)) - parseInt((mc.offsetHeight / 2)) + document.documentElement.scrollTop + 'px'; //style.bottom causes problems in opera :)
		mc.style.left = parseInt((screen.width - 500) / 2) + 'px';
		mc.style.visibility = 'visible';
		getElm("sendmcstatus").style.display = 'block';
		var theURLMC = siteURL + "ajax/contactentry.xml?d=1";
		var Inputs = new Array();
		Inputs[0] = 'nom'; Inputs[1] = 'prenom'; Inputs[2] = 'sujet'; Inputs[3] = 'message'; Inputs[4] = 'capchamailtech'; Inputs[5] = 'identree';
		xHRObjectMC = sendXHRP(Inputs,theURLMC,ShowMailContact);
	}
}
