function initAdspecify(lien,cv,left,top){
	 adDiv=eval('document.getElementById("'+cv+'").style');
	 var obj = document.getElementById(lien);
		adDiv.visibility="visible";
		adDiv.display="block";
		var curleft = left;
		var curtop = top;
		adDiv.position = "absolute";
		adDiv.left=(curleft)+"px";
		adDiv.top =(curtop)+"px";
		
}
function closeAd(cv){
	 adDiv=eval('document.getElementById("'+cv+'").style');
		adDiv.display="none";
		adDiv.visibility ="hidden";
}

function insertNews() {
		var news_name = document.getElementById("news_name").value;
		var news_email = document.getElementById("news_email").value;
		var bool = 0;
		if(news_name == '' || news_name == 'Votre Nom' ) {
			 document.getElementById("news_name").style.borderColor="#FF0000";
				bool = 1;
		}
		else {
			 document.getElementById("news_name").style.borderColor="#696744";
		}
		if(news_email == '' || news_email == 'Votre Email' || news_email.indexOf("@") == '-1' || news_email.indexOf(".") == '-1') {
			 document.getElementById("news_email").style.borderColor="#FF0000";
				bool = 1;
		} else{
			 document.getElementById("news_email").style.borderColor="#696744";
		}
		if(bool==0) {
				x_inserNewsletter(news_name, news_email, void(0));
				document.getElementById('confirm_newsletter').style.display="block";
				document.getElementById('confirm_newsletter').style.visibility="visible";
				//initAdspecify('lien1','confirm_newsletter',400,200);
		}
}

function insertKey() {
		var key_titre = document.getElementById("key_titre").value;
		var bool = 0;
		if(key_titre == '') {
			 document.getElementById("key_titre").style.borderColor="#FF0000";
				bool = 1;
		}
		else {
			 document.getElementById("key_titre").style.borderColor="#696744";
		}
		if(bool==0) {
				x_inserKey(key_titre, void(0));
				document.getElementById('confirm_keyword').style.display="block";
				document.getElementById('confirm_keyword').style.visibility="visible";
		}
}

function auth_cond() {
	 var loginCond = document.getElementById('loginCond').value;
	 var passwordCond = document.getElementById('passwordCond').value;
		if(loginCond != '' && passwordCond != 'Votre login' && passwordCond != '' && passwordCond != 'password') {
				x_authCondidat(loginCond, passwordCond, result_auth_cond);
		} else {
			 document.getElementById('loginCond').style.borderColor="#FF0000";
			 document.getElementById('passwordCond').style.borderColor="#FF0000";
		}
}

function auth_soc() {
	 var loginSoc = document.getElementById('loginSoc').value;
	 var passwordSoc = document.getElementById('passwordSoc').value;
		if(loginSoc != '' && passwordSoc != 'Votre login' && passwordSoc != '' && passwordSoc != 'password') {
				x_authSociete(loginSoc, passwordSoc, result_auth_soc);
		} else {
			 document.getElementById('loginSoc').style.borderColor="#FF0000";
			 document.getElementById('passwordSoc').style.borderColor="#FF0000";
		}
}

function auth_soc2() {
	 var loginSoc = document.getElementById('loginSoc2').value;
	 var passwordSoc = document.getElementById('passwordSoc2').value;
		if(loginSoc != '' && passwordSoc != 'Votre login' && passwordSoc != '' && passwordSoc != 'password') {
				x_authSociete(loginSoc, passwordSoc, result_auth_soc2);
				return false;
		} else {
			 document.getElementById('myauthSoc2').style.visibility="visible";
    document.getElementById('myauthSoc2').style.display="block";
				return false;
		}
}
function forgot_pass() {
  var loginSoc = document.getElementById('loginSoc3').value;
  if(loginSoc != '') {
	x_forgotPass(loginSoc, result_forgot_pass);
  } else {
    document.getElementById('msg_forgot_passrd2').style.visibility="visible";
    document.getElementById('msg_forgot_passrd2').style.display="block";
  }
  return false;
}
function deconect_soc() {
				x_deconect_soc(result_deconect_soc);
}
function result_auth_cond(result) {
	 if(result==1) {
			 document.location.href="condidat.php";
		} else {
			 document.getElementById('loginCond').style.borderColor="#FF0000";
			 document.getElementById('passwordCond').style.borderColor="#FF0000";
		}
}
function result_auth_soc(result) {
	 if(result==1) {
			 document.location.href="societe.php";
		} else {
			 document.getElementById('loginSoc').style.borderColor="#FF0000";
			 document.getElementById('passwordSoc').style.borderColor="#FF0000";
		}
}
function result_auth_soc2(result) {
	 if(result==1) {
			 document.location.href="societe.php";
		} else {
			 document.getElementById('myauthSoc2').style.visibility="visible";
    document.getElementById('myauthSoc2').style.display="block";
		}
}
function result_forgot_pass(result) {
  if(result==1) {
	document.getElementById('msg_forgot_passrd1').style.visibility="visible";
    document.getElementById('msg_forgot_passrd1').style.display="block";
	document.getElementById('msg_forgot_passrd2').style.visibility="hidden";
    document.getElementById('msg_forgot_passrd2').style.display="none";
  } else {
	document.getElementById('msg_forgot_passrd1').style.visibility="hidden";
    document.getElementById('msg_forgot_passrd1').style.display="none";
	document.getElementById('msg_forgot_passrd2').style.visibility="visible";
    document.getElementById('msg_forgot_passrd2').style.display="block";
  }
  
}
function result_deconect_soc() {
	 document.location.href="/";
}
function favoris() {
if ( navigator.appName != 'Microsoft Internet Explorer' )
{ window.sidebar.addPanel("HT Emploi Maroc - site Emploi au Maroc","http://www.ht-emploi.com",""); }
else { window.external.AddFavorite("http://www.ht-emploi.com","HT Emploi Maroc - site Emploi au Maroc"); } 
} 

function version(url) {
  x_transVersion();
		setTimeout("redirectionPage('"+url+"')",2000);		
}
function redirectionPage(url) {
	 document.location.href=url;
}
